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$"
31 #include "protocol.hxx"
32 #include <simgear/compiler.h>
33 #include <Main/globals.hxx>
34 #include <Main/fg_props.hxx>
35 #include <Model/acmodel.hxx>
36 #include <Model/model.hxx>
37 #include <MultiPlayer/multiplaytxmgr.hxx>
38 #include <MultiPlayer/multiplayrxmgr.hxx>
40 /****************************************************************
43 * Description: FGMultiplay is an FGProtocol object used as the basic
44 * interface for the multiplayer code into FlightGears generic IO
45 * subsystem. It only implements the basic FGProtocol methods: open(),
46 * process() and close(). It does not use Sim Gear's IO channels, as
47 * the MultiplayMgrs creates their own sockets through plib.
49 * It will set up it's direction and rate protocol properties when
50 * created. Subsequent calls to process will prompt the
51 * MultiplayMgr to either send or receive data over the network.
53 ******************************************************************/
55 class FGMultiplay : public FGProtocol {
59 FGMultiplay (const string &dir, const int rate, const string &host, const int port);
64 /** Enables the FGMultiplay object
68 /** Tells the multiplayer_mgr to send/receive data.
72 /** Closes the multiplayer_mgr.
81 #endif // _FG_MULTIPLAY_HXX