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/multiplaymgr.hxx>
39 #include "protocol.hxx"
44 /****************************************************************
47 * Description: FGMultiplay is an FGProtocol object used as the basic
48 * interface for the multiplayer code into FlightGears generic IO
49 * subsystem. It only implements the basic FGProtocol methods: open(),
50 * process() and close(). It does not use Sim Gear's IO channels, as
51 * the MultiplayMgrs creates their own sockets through plib.
53 * It will set up it's direction and rate protocol properties when
54 * created. Subsequent calls to process will prompt the
55 * MultiplayMgr to either send or receive data over the network.
57 ******************************************************************/
59 class FGMultiplay : public FGProtocol {
63 FGMultiplay (const string &dir, const int rate, const string &host, const int port);
68 /** Enables the FGMultiplay object
72 /** Tells the multiplayer_mgr to send/receive data.
76 /** Closes the multiplayer_mgr.
85 #endif // _FG_MULTIPLAY_HXX