Refactor server login to allow server play, switching between client and server