integrated the server with the game logic