updated server state to string function and game end checking