Introduction
Game Server
A timer gets initiated when the first player resister for a game server.Client has to send a request to the sever saying JOIN# in order to connect to the server. Then the server replies following replies.
- S:P<num>: < player location x>,< player location y>:<Direction># -Join accept message where directions are 0-North, 1-East, 2-South, 3-West.
- —PLAYERS_FULL# – The maximum number of players are already connected to the server.
- ALREADY_ADDED# – The player is already connected to the game server.
- GAME_ALREADY_STARTED# – The player tries to join an already started game
At the game initiation all other map details are sent in the following format.
- I:P1; < player location x>,< player location y>;: …: P5< player location x>,< player location y>;: < x>,;< x>,;< x>,….. < x>,: < x>,;< x>,;< x>,…..< x>,: < x>,;< x>,;< x>, …..< x>,# where players details:Brick details:Stone coordinates:Water coordinates.
- —OBSTACLE#
- —CELL_OCCUPIED#
- —DEAD#
- —TOO_QUICK#
- —INVALID_CELL#
- —GAME_HAS_FINISHED#
- —GAME_NOT_STARTED_YET#
- —NOT_A_VALID_CONTESTANT#
- G:P1;< player location x>,< player location y>;;< whether shot>;;< coins>;< points>: …. P5;< player location x>,< player location y>;;< whether shot>;;< coins>;< points>: < x>,,;< x>,,;< x>,,;< x>,,…..< x>,,#
Download server here
No comments:
Post a Comment