]> git.mxchange.org Git - flightgear.git/blob - src/NetworkOLK/network.cxx
David Megginson writes:
[flightgear.git] / src / NetworkOLK / network.cxx
1 // network.cxx -- data structures for initializing & managing network.
2 //
3 // Written by Oliver Delise, started May 1999.
4 //
5 // Copyleft (C) 1999  Oliver Delise - delise@mail.isis.de
6 //
7 // This program is free software; you can redistribute it and/or
8 // modify it under the terms of the GNU General Public License as
9 // published by the Free Software Foundation; either version 2 of the
10 // License, or (at your option) any later version.
11 //
12 // This program is distributed in the hope that it will be useful, but
13 // WITHOUT ANY WARRANTY; without even the implied warranty of
14 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15 // General Public License for more details.
16 //
17 // You should have received a copy of the GNU General Public License
18 // along with this program; if not, write to the Free Software
19 // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20 //
21 // $Id$
22
23
24 #ifdef HAVE_CONFIG_H
25 #  include <config.h>
26 #endif
27
28 /*
29 #ifdef HAVE_WINDOWS_H
30 #  include <windows.h>
31 #endif
32
33 #ifdef __BORLANDC__
34 #  define exception c_exception
35 #endif
36 #include <math.h>
37
38 #include <GL/glut.h>
39 #include <stdlib.h>
40 #include <string.h>
41
42 #ifdef HAVE_VALUES_H
43 #  include <values.h>  // for MAXINT
44 #endif
45
46 #include <simgear/logstream.hxx>
47 #include <simgear/constants.h>
48 #include <simgear/fg_random.h>
49 #include <simgear/polar3d.hxx>
50
51 #include <Aircraft/aircraft.hxx>
52 #include <GUI/gui.h>
53 #include <Scenery/scenery.hxx>
54 #include <Time/fg_timer.hxx>
55
56 #if defined ( __sun__ ) || defined ( __sgi )
57 extern "C" {
58   extern void *memmove(void *, const void *, size_t);
59 }
60 #endif
61 */
62
63 #include <plib/sg.h>
64 #include <plib/ssg.h>
65
66 #include <Main/globals.hxx>
67 #include <Main/fg_props.hxx>
68
69 int  net_blast_toggle, net_hud_display, net_is_registered;
70 char *net_callsign, *FGFS_host;
71 sgMat4 sgFGD_VIEW;
72 ssgRoot *fgd_scene;
73
74 extern void list_init();
75 extern void fgd_init();
76 extern void fgd_send_com( char *FGD_com, char *FGFS_host);
77
78 char *fg_net_init( ssgRoot *orig_scene ){
79
80  // We enable display of netinfos only if user wishes it via cmd-line param
81  net_hud_display = (net_hud_display == 0) ? 0 : 1; 
82  // Get pilot's name from options, can be modified at runtime via menu
83  net_callsign = (char *)(fgGetString("/sim/networking/call-sign").c_str());
84  // Disable Blast Mode -1 = Disable, 0 = Enable  
85  net_blast_toggle = -1;
86  // We start unregistered, we reg. later via menu to fgd 
87  net_is_registered = -1;
88  fgd_scene = orig_scene;
89  // Init list of Pilots
90  list_init();
91  // Init Sockets et al...
92  fgd_init();
93  // Register to deamon
94  // fgd_send_com( "0", FGFS_host);
95  // fgd_send_com( "1", FGFS_host);
96  return("activated");
97 }