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 ******************************************************************/
38 #include <simgear/compiler.h>
45 // Message identifiers
47 #define UNUSABLE_POS_DATA_ID 2
49 /* should be a multiple of 8! */
50 #define MAX_CALLSIGN_LEN 8
51 /** Header for use with all messages sent */
54 /** Message identifier, multiple of 8! */
57 /** Length of the message inclusive of this header */
60 /** IP address for reply to message (player's receiver address) */
61 uint32_t lReplyAddress;
63 /** Port for replies (player's receiver port) */
66 /** Callsign used by the player */
67 char sCallsign[MAX_CALLSIGN_LEN];
71 #define MAX_CHAT_MSG_LEN 48
75 /** Text of chat message */
76 char sText[MAX_CHAT_MSG_LEN];
80 /* should be a multiple of 8! */
81 #define MAX_MODEL_NAME_LEN 48
82 /** Aircraft position message */
85 /** Name of the aircraft model */
86 char sModel[MAX_MODEL_NAME_LEN];
88 /** Position data for the aircraft */
89 sgdVec3 PlayerPosition;
90 sgQuat PlayerOrientation;