Last change
on this file since 8a4ed74 was e1f78f5, checked in by dportnoy <dmp1488@…>, 11 years ago |
START_ATTACK and ATTACK message types have been added and the client sends a START_ATTACK message when the user right-clicks on an enemy player
|
-
Property mode
set to
100644
|
File size:
795 bytes
|
Rev | Line | |
---|
[8e540f4] | 1 | #ifndef _MESSAGE_H
|
---|
[2488852] | 2 | #define _MESSAGE_H
|
---|
[7d7df47] | 3 |
|
---|
[5f868c0] | 4 | #define MSG_TYPE_REGISTER 1
|
---|
| 5 | #define MSG_TYPE_LOGIN 2
|
---|
| 6 | #define MSG_TYPE_LOGOUT 3
|
---|
| 7 | #define MSG_TYPE_CHAT 4
|
---|
| 8 | #define MSG_TYPE_PLAYER 5 // server sends this to update player positions
|
---|
| 9 | #define MSG_TYPE_PLAYER_MOVE 6 // client sends this when a player wants to move
|
---|
| 10 | #define MSG_TYPE_OBJECT 7
|
---|
| 11 | #define MSG_TYPE_REMOVE_OBJECT 8
|
---|
[5299436] | 12 | #define MSG_TYPE_PICKUP_FLAG 9
|
---|
| 13 | #define MSG_TYPE_DROP_FLAG 10
|
---|
[b8601ee] | 14 | #define MSG_TYPE_SCORE 11
|
---|
[e1f78f5] | 15 | #define MSG_TYPE_START_ATTACK 12
|
---|
| 16 | #define MSG_TYPE_ATTACK 13
|
---|
[7d7df47] | 17 |
|
---|
| 18 | typedef struct
|
---|
| 19 | {
|
---|
[0dde5da] | 20 | short type;
|
---|
| 21 | char buffer[256];
|
---|
[7d7df47] | 22 | } NETWORK_MSG;
|
---|
| 23 |
|
---|
[a845faf] | 24 | int sendMessage(NETWORK_MSG *msg, int sock, struct sockaddr_in *dest);
|
---|
| 25 |
|
---|
| 26 | int receiveMessage(NETWORK_MSG *msg, int sock, struct sockaddr_in *dest);
|
---|
| 27 |
|
---|
[e084950] | 28 | #endif
|
---|
Note:
See
TracBrowser
for help on using the repository browser.