source: network-game/common/Message.h@ cee623e

Last change on this file since cee623e was edfd1d0, checked in by dportnoy <dmp1488@…>, 12 years ago

Moved the Player class to the common directory, added a position to Player, added a new message type for sending player info, and made the server broadcast player positions everytime it receives and replies to a message

  • Property mode set to 100644
File size: 423 bytes
Line 
1#ifndef _MESSAGE_H
2#define _MESSAGE_H
3
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
9
10typedef struct
11{
12 short type;
13 char buffer[256];
14} NETWORK_MSG;
15
16int sendMessage(NETWORK_MSG *msg, int sock, struct sockaddr_in *dest);
17
18int receiveMessage(NETWORK_MSG *msg, int sock, struct sockaddr_in *dest);
19
20#endif
Note: See TracBrowser for help on using the repository browser.