[e437a19] | 1 | This document contains all messages and descriptions of how they are used or should be used
|
---|
| 2 |
|
---|
| 3 | MSG_TYPE_ACK
|
---|
| 4 | Sent in response to a message of any other type and contains the id of the received message. When the recipient gets the ack, the know the original message with that id was received. This type is used by the MessageProcessor class.
|
---|
| 5 |
|
---|
| 6 | MSG_TYPE_REGISTER
|
---|
| 7 | Client sends this message to register a new account. Contains a username, password, and class.
|
---|
| 8 |
|
---|
| 9 | MSG_TYPE_LOGIN
|
---|
| 10 | Client sends this message to login. Contains a username and password
|
---|
| 11 |
|
---|
| 12 | MSG_TYPE_LOGOUT
|
---|
| 13 | Client sends this message to logout. Contains no extra data. The server uses the sender address to determine which player sent it.
|
---|
[1a47469] | 14 | Server broadcasts a reply with the player id if logout was successfull or sends the sender's id and a string with an error message back to the original sender.
|
---|
[e437a19] | 15 |
|
---|
| 16 | MSG_TYPE_CHAT
|
---|
| 17 | Client uses this to send chat messages to the server. The server uses it to relay chat message to the correct recipients. Contains the userame of the sender and the message itself (I think).
|
---|
| 18 |
|
---|
| 19 | MSG_TYPE_PLAYER
|
---|
| 20 | Double-check correctness of this info
|
---|
| 21 | server sends this to update player positions
|
---|
| 22 |
|
---|
| 23 | MSG_TYPE_PLAYER_MOVE
|
---|
| 24 | Double-check correctness of this info
|
---|
| 25 | Client sends this when a player wants to move
|
---|
| 26 |
|
---|
| 27 | MSG_TYPE_OBJECT
|
---|
| 28 | Server sends this to indicate that a new object appeared on the map. (Currently, the only objects are flags).
|
---|
| 29 |
|
---|
| 30 | MSG_TYPE_REMOVE_OBJECT
|
---|
| 31 | Server sends this to indicate that an object has been removed from the map. (Currently happens when a flag is picked up)
|
---|
| 32 |
|
---|
| 33 | MSG_TYPE_PICKUP_FLAG
|
---|
| 34 | Client sends this when it wants to pick up a flag. This is sent when the user presses the correct hotkey, even if there is no flag close enough to pick up.
|
---|
| 35 |
|
---|
| 36 | MSG_TYPE_DROP_FLAG
|
---|
| 37 | Client sends this when it wants to drop a flag. As above, this is sent when the hotkey is pressed, even if the player isn't holding a flag.
|
---|
| 38 |
|
---|
| 39 | MSG_TYPE_SCORE
|
---|
| 40 | The server sends this to indicate a change in the score of a team.
|
---|
| 41 |
|
---|
| 42 | MSG_TYPE_START_ATTACK
|
---|
| 43 | Info needs confirmation
|
---|
| 44 | The client sends this to indicate they are starting an attack animation.
|
---|
| 45 | I think the point here is for the server to tell other clients, so the correct animation is played on their screen as well.
|
---|
| 46 |
|
---|
| 47 | MSG_TYPE_ATTACK
|
---|
| 48 | Not sure who sends this, but I think it's the client and I think it indicates the actual attack. The server sends MSG_TYPE_PLAYER messages to indicate a decrease in the hp of the target and some other state changes.
|
---|
| 49 |
|
---|
| 50 | MSG_TYPE_PROJECTILE
|
---|
| 51 | Verify this
|
---|
| 52 | Server sends this to indicate that a projectile has been created (in the case of a ranged attack). Probably contains the position and direction of the projectile. Not sure if it contains the id or name of the target player.
|
---|
| 53 |
|
---|
| 54 | MSG_TYPE_REMOVE_PROJECTILE
|
---|
| 55 | Server sends this when a projectile should be removed (when it has reached its target).
|
---|
| 56 |
|
---|
| 57 | MSG_TYPE_CREATE_GAME
|
---|
| 58 | Client sends this when they want to create a game. Contains the game name (probably not id since the server determines the id upon creation).
|
---|
| 59 |
|
---|
| 60 | MSG_TYPE_JOIN_GAME
|
---|
| 61 | Client sends this when they want to join a game. Contains the game name or id.
|
---|
| 62 |
|
---|
| 63 | MSG_TYPE_LEAVE_GAME
|
---|
| 64 | Client sends this when they want to leave a game. Not sure what this contains. Maybe nothing.
|
---|
| 65 |
|
---|
| 66 | MSG_TYPE_GAME_INFO
|
---|
| 67 | Server sends this to tell all clients about existing games. Contains the game name and the number of players currently in it.
|
---|
| 68 |
|
---|
| 69 | MSG_TYPE_JOIN_GAME_SUCCESS
|
---|
| 70 | Server sends this to a client to indicate that a game was joined successfully. This is useful because two clients might simultaneously want to a join a game with only one open slot or maybe the game ended by the time the server got the client's message.
|
---|
| 71 |
|
---|
| 72 | MSG_TYPE_JOIN_GAME_FAILURE
|
---|
| 73 | Server sends this to indicate that a game could not be join. See explanation about. Also could be sent if the name the client specified doesn't match an existing game.
|
---|
| 74 |
|
---|
| 75 | MSG_TYPE_JOIN_GAME_ACK
|
---|
| 76 | Needs verification.
|
---|
| 77 | The client sends this upon receipt of a MSG_TYPE_JOIN_GAME_SUCCESS to indicate that he got it. This message is useful to guarantee initialization of some variables (I think of the Game variable on the client). Pretty clunky, so try to find a way of avoiding this.
|
---|