Rev | Line | |
---|
[1a3c42d] | 1 | #ifndef _MESSAGE_PROCESSOR_H
|
---|
| 2 | #define _MESSAGE_PROCESSOR_H
|
---|
| 3 |
|
---|
| 4 | #include "Message.h"
|
---|
| 5 |
|
---|
| 6 | /*
|
---|
| 7 | #define MSG_TYPE_REGISTER 1
|
---|
| 8 | #define MSG_TYPE_LOGIN 2
|
---|
| 9 | #define MSG_TYPE_LOGOUT 3
|
---|
| 10 | #define MSG_TYPE_CHAT 4
|
---|
| 11 | #define MSG_TYPE_PLAYER 5 // server sends this to update player positions
|
---|
| 12 | #define MSG_TYPE_PLAYER_MOVE 6 // client sends this when a player wants to move
|
---|
| 13 | #define MSG_TYPE_OBJECT 7
|
---|
| 14 | #define MSG_TYPE_REMOVE_OBJECT 8
|
---|
| 15 | #define MSG_TYPE_PICKUP_FLAG 9
|
---|
| 16 | #define MSG_TYPE_DROP_FLAG 10
|
---|
| 17 | #define MSG_TYPE_SCORE 11
|
---|
| 18 | #define MSG_TYPE_START_ATTACK 12
|
---|
| 19 | #define MSG_TYPE_ATTACK 13
|
---|
| 20 | #define MSG_TYPE_PROJECTILE 14
|
---|
| 21 | #define MSG_TYPE_REMOVE_PROJECTILE 15
|
---|
| 22 |
|
---|
| 23 | typedef struct
|
---|
| 24 | {
|
---|
| 25 | short type;
|
---|
| 26 | char buffer[256];
|
---|
| 27 | } NETWORK_MSG;
|
---|
| 28 | */
|
---|
| 29 |
|
---|
| 30 | class MessageProcessor {
|
---|
| 31 | public:
|
---|
| 32 | int sendMessage(NETWORK_MSG *msg, int sock, struct sockaddr_in *dest);
|
---|
| 33 | int receiveMessage(NETWORK_MSG *msg, int sock, struct sockaddr_in *dest);
|
---|
| 34 | void resendUnackedMessages();
|
---|
| 35 | void cleanAckedMessages();
|
---|
| 36 |
|
---|
| 37 | private:
|
---|
| 38 | };
|
---|
| 39 |
|
---|
| 40 | #endif
|
---|
Note:
See
TracBrowser
for help on using the repository browser.