detecting game state on the server