1 // multiplay.hxx -- protocol object for multiplay in Flightgear
3 // Written by Diarmuid Tyson, started February 2003.
4 // diarmuid.tyson@airservicesaustralia.com
6 // Copyright (C) 2003 Airservices Australia
8 // This program is free software; you can redistribute it and/or
9 // modify it under the terms of the GNU General Public License as
10 // published by the Free Software Foundation; either version 2 of the
11 // License, or (at your option) any later version.
13 // This program is distributed in the hope that it will be useful, but
14 // WITHOUT ANY WARRANTY; without even the implied warranty of
15 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 // General Public License for more details.
18 // You should have received a copy of the GNU General Public License
19 // along with this program; if not, write to the Free Software
20 // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
23 #ifndef _FG_MULTIPLAY_HXX
24 #define _FG_MULTIPLAY_HXX
26 #define FG_MULTIPLAY_HID "$Id$"
28 #include <simgear/compiler.h>
32 #include <simgear/scene/model/model.hxx>
34 #include <Main/globals.hxx>
35 #include <Main/fg_props.hxx>
36 #include <Model/acmodel.hxx>
37 #include <MultiPlayer/multiplaytxmgr.hxx>
38 #include <MultiPlayer/multiplayrxmgr.hxx>
40 #include "protocol.hxx"
45 /****************************************************************
48 * Description: FGMultiplay is an FGProtocol object used as the basic
49 * interface for the multiplayer code into FlightGears generic IO
50 * subsystem. It only implements the basic FGProtocol methods: open(),
51 * process() and close(). It does not use Sim Gear's IO channels, as
52 * the MultiplayMgrs creates their own sockets through plib.
54 * It will set up it's direction and rate protocol properties when
55 * created. Subsequent calls to process will prompt the
56 * MultiplayMgr to either send or receive data over the network.
58 ******************************************************************/
60 class FGMultiplay : public FGProtocol {
64 FGMultiplay (const string &dir, const int rate, const string &host, const int port);
69 /** Enables the FGMultiplay object
73 /** Tells the multiplayer_mgr to send/receive data.
77 /** Closes the multiplayer_mgr.
86 #endif // _FG_MULTIPLAY_HXX