]> git.mxchange.org Git - flightgear.git/blob - src/MultiPlayer/mpmessages.hxx
MSVC fix from Frederic Bouvier
[flightgear.git] / src / MultiPlayer / mpmessages.hxx
1 #ifndef MPMESSAGES_H
2 #define MPMESSAGES_H
3
4 #define MPMESSAGES_HID "$Id$"
5
6 /****************************************************************
7 * @version $Id$
8 *
9 * Description: Each message used for multiplayer communications
10 * consists of a header and optionally a block of data. The combined
11 * header and data is sent as one IP packet.
12 *
13 ******************************************************************/
14
15 #include <plib/sg.h>
16
17 // Message identifiers
18 #define CHAT_MSG_ID 1
19 #define POS_DATA_ID 2
20
21 #define MAX_CALLSIGN_LEN 10
22 /** Header for use with all messages sent */
23 typedef struct {
24
25     /** Message identifier */
26     char MsgId;
27
28     /** Length of the message inclusive of this header */
29     unsigned int iMsgLen;
30
31     /** IP address for reply to message (player's receiver address) */
32     unsigned long int lReplyAddress;
33
34     /** Port for replies (player's receiver port) */
35     unsigned int iReplyPort;
36
37     /** Callsign used by the player */
38     char sCallsign[MAX_CALLSIGN_LEN];
39
40 } T_MsgHdr;
41
42 #define MAX_CHAT_MSG_LEN 50
43 /** Chat message */
44 typedef struct {
45
46     /** Text of chat message */
47     char sText[MAX_CHAT_MSG_LEN];
48
49 } T_ChatMsg;
50
51
52 #define MAX_MODEL_NAME_LEN 50
53 /** Aircraft position message */
54 typedef struct {
55
56     /** Name of the aircraft model */
57     char sModel[MAX_MODEL_NAME_LEN];
58
59     /** Position data for the aircraft */
60     sgMat4 PlayerPos;
61
62 } T_PositionMsg;
63
64
65
66 #endif
67
68