]> git.mxchange.org Git - flightgear.git/blob - src/Network/multiplay.hxx
2b673e092422a450b5cd3603d097ef563d0d5d69
[flightgear.git] / src / Network / multiplay.hxx
1 // multiplay.hxx -- protocol object for multiplay in Flightgear
2 //
3 // Written by Diarmuid Tyson, started February 2003.
4 // diarmuid.tyson@airservicesaustralia.com
5 //
6 // Copyright (C) 2003  Airservices Australia
7 //
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.
12 //
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.
17 //
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.
21 //
22
23 #ifndef _FG_MULTIPLAY_HXX
24 #define _FG_MULTIPLAY_HXX
25
26 #define FG_MULTIPLAY_HID "$Id$"
27
28 #include <simgear/compiler.h>
29
30 #include STL_STRING
31
32 #include <simgear/scene/model/model.hxx>
33
34 #include <Main/globals.hxx>
35 #include <Main/fg_props.hxx>
36 #include <Model/acmodel.hxx>
37 #include <MultiPlayer/multiplaymgr.hxx>
38
39 #include "protocol.hxx"
40
41 SG_USING_STD(string);
42
43
44 /****************************************************************
45 * @version $Id$
46 *
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.
52 *
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.
56 *
57 ******************************************************************/
58
59 class FGMultiplay : public FGProtocol {
60 public:
61
62     /** Constructor */
63     FGMultiplay (const string &dir, const int rate, const string &host, const int port);
64
65     /** Destructor. */
66     ~FGMultiplay ();
67
68     /** Enables the FGMultiplay object
69     */
70     bool open();
71
72     /** Tells the multiplayer_mgr to send/receive data.
73     */
74     bool process();
75
76     /** Closes the multiplayer_mgr.
77     */
78     bool close();
79
80 private:
81
82 };
83
84
85 #endif // _FG_MULTIPLAY_HXX