1 // multiplayrxmgr.hxx -- routines for receiving multiplayer data
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.
24 #ifndef MULTIPLAYRXMGR_H
25 #define MULTIPLAYRXMGR_H
27 #define MULTIPLAYRXMGR_HID "$Id$"
30 #include "mpplayer.hxx"
31 #include "mpmessages.hxx"
40 #include <simgear/compiler.h>
41 #include <plib/netSocket.h>
43 // Maximum number of players that can exist at any time
44 #define MAX_PLAYERS 10
46 /****************************************************************
49 * Description: The multiplay rx manager is responsible for
50 * receiving and processing data from other players.
52 * Data from remote players is read from the network and processed
53 * via calling ProcessData. The models for the remote player are
54 * positioned onto the scene by calling Update.
56 *******************************************************************/
57 class FGMultiplayRxMgr {
66 /** Initialises the multiplayer receiver.
67 * @return True if initialisation succeeds, else false
71 /** Initiates processing of any data waiting at the rx socket.
73 void ProcessData(void);
75 /** Updates the model positions for the players
79 /** Closes the multiplayer manager. Stops any further player packet processing.
87 /** Holds the players that exist in the game */
88 MPPlayer *m_Player[MAX_PLAYERS];
90 /** Socket for receiving data from the server or another player */
91 netSocket *mDataRxSocket;
93 /** True if multiplay receive is initialised */
96 /** Receive address for multiplayer messages */
99 /** Receive port for multiplayer messages */
102 /** Local player's callsign */