1 // mpmessages.hxx -- Message definitions for multiplayer communications
2 // within a multiplayer Flightgear
4 // Written by Duncan McCreanor, started February 2003.
5 // duncan.mccreanor@airservicesaustralia.com
7 // Copyright (C) 2003 Airservices Australia
9 // This program is free software; you can redistribute it and/or
10 // modify it under the terms of the GNU General Public License as
11 // published by the Free Software Foundation; either version 2 of the
12 // License, or (at your option) any later version.
14 // This program is distributed in the hope that it will be useful, but
15 // WITHOUT ANY WARRANTY; without even the implied warranty of
16 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 // General Public License for more details.
19 // You should have received a copy of the GNU General Public License
20 // along with this program; if not, write to the Free Software
21 // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
27 #define MPMESSAGES_HID "$Id$"
29 /****************************************************************
32 * Description: Each message used for multiplayer communications
33 * consists of a header and optionally a block of data. The combined
34 * header and data is sent as one IP packet.
36 ******************************************************************/
41 // Message identifiers
43 #define UNUSABLE_POS_DATA_ID 2
45 /* should be a multiple of 8! */
46 #define MAX_CALLSIGN_LEN 8
47 /** Header for use with all messages sent */
50 /** Message identifier, multiple of 8! */
53 /** Length of the message inclusive of this header */
56 /** IP address for reply to message (player's receiver address) */
57 uint32_t lReplyAddress;
59 /** Port for replies (player's receiver port) */
62 /** Callsign used by the player */
63 char sCallsign[MAX_CALLSIGN_LEN];
67 #define MAX_CHAT_MSG_LEN 48
71 /** Text of chat message */
72 char sText[MAX_CHAT_MSG_LEN];
76 /* should be a multiple of 8! */
77 #define MAX_MODEL_NAME_LEN 48
78 /** Aircraft position message */
81 /** Name of the aircraft model */
82 char sModel[MAX_MODEL_NAME_LEN];
84 /** Position data for the aircraft */
85 sgdVec3 PlayerPosition;
86 sgQuat PlayerOrientation;