diff --git a/Thanks b/Thanks index c227431b0..287c97ae1 100644 --- a/Thanks +++ b/Thanks @@ -111,7 +111,7 @@ Dave Cornish Oliver Delise FAQ Maintainer, Documentation, Public Relations. - Working on adding some networking / multi-user support. + Author of (the now depreciated) networking / multi-user support. Founder of the FlightGear MultiPilot Project : http://www.isis.de/members/~odelise/progs/flightgear diff --git a/configure.ac b/configure.ac index e60b948f1..e89dd2dc8 100644 --- a/configure.ac +++ b/configure.ac @@ -59,24 +59,14 @@ fi # Specify if we want to build with Multiplayer support # default to with_network=yes -AC_ARG_WITH(multiplayer, [ --with-multiplayer Include default multiplayer support]) -AC_ARG_WITH(network_olk, [ --with-network-olk Include Oliver's multi-pilot networking support [default=no]]) +AC_ARG_WITH(multiplayer, [ --with-multiplayer Include multiplayer support [default=yes]]) -if test "x$with_multiplayer" = "xno" -a "x$with_network_olk" = "xno"; then +if test "x$with_multiplayer" = "xno"; then echo "Building without any kind of multiplayer support" - -elif test "x$with_multiplayer" = "xno"; then -# echo "Building without default multiplayer support" - echo "Building with Oliver's multi-pilot network support" - AC_DEFINE([FG_NETWORK_OLK], 1, [Define to build with Oliver's networking]) - else - echo "Building with default multiplayer support" -# echo "Building without Oliver's multi-pilot network support" - AC_DEFINE([FG_MPLAYER_AS], 1, [Define to build with default multiplayer support]) + echo "Building with multiplayer support" + AC_DEFINE([FG_MPLAYER_AS], 1, [Define to build with multiplayer support]) fi - -AM_CONDITIONAL(ENABLE_NETWORK_OLK, test "x$with_network_olk" != "xno" -a "x$with_multiplayer" = "xno") AM_CONDITIONAL(ENABLE_MPLAYER_AS, test "x$with_multiplayer" != "xno") @@ -541,7 +531,6 @@ AC_CONFIG_FILES([ \ src/MultiPlayer/Makefile \ src/Navaids/Makefile \ src/Network/Makefile \ - src/NetworkOLK/Makefile \ src/Objects/Makefile \ src/Replay/Makefile \ src/Scenery/Makefile \ @@ -592,9 +581,7 @@ else fi if test "x$with_multiplayer" != "xno"; then - echo "Using default multiplayer support" -elif test "x$with_network_olk" != "xno"; then - echo "Using Oliver's multi-pilot network support" + echo "Building with multiplayer support" fi if test "x$with_threads" = "xyes"; then diff --git a/src/Cockpit/hud.cxx b/src/Cockpit/hud.cxx index 3b3285dfa..18e0ef636 100644 --- a/src/Cockpit/hud.cxx +++ b/src/Cockpit/hud.cxx @@ -54,9 +54,6 @@ #include #include
#include
-#ifdef FG_NETWORK_OLK -#include -#endif #include #if defined ( __sun__ ) || defined ( __sgi ) @@ -1165,12 +1162,6 @@ void drawHUD() HUD_TextList.add( fgText(40, 10, get_formated_gmt_time(), 0) ); -#ifdef FG_NETWORK_OLK - if ( net_hud_display ) { - net_hud_update(); - } -#endif - int apY = 480 - 80; // char scratch[128]; diff --git a/src/GUI/Makefile.am b/src/GUI/Makefile.am index 75f894c3a..44bb278f2 100644 --- a/src/GUI/Makefile.am +++ b/src/GUI/Makefile.am @@ -1,13 +1,5 @@ noinst_LIBRARIES = libGUI.a -EXTRA_DIST = net_dlg.cxx net_dlg.hxx - -if ENABLE_NETWORK_OLK -NETWORK_SRCS = net_dlg.cxx net_dlg.hxx -else -NETWORK_SRCS = -endif - libGUI_a_SOURCES = \ new_gui.cxx new_gui.hxx \ dialog.cxx dialog.hxx \ @@ -15,7 +7,6 @@ libGUI_a_SOURCES = \ gui.cxx gui.h gui_funcs.cxx \ gui_local.cxx gui_local.hxx \ mouse.cxx \ - $(NETWORK_SRCS) \ preset_dlg.cxx preset_dlg.hxx \ prop_picker.cxx prop_picker.hxx \ sgVec3Slider.cxx sgVec3Slider.hxx \ diff --git a/src/GUI/README b/src/GUI/README index 677143dda..43b5d629f 100644 --- a/src/GUI/README +++ b/src/GUI/README @@ -12,7 +12,6 @@ gui_funcs.cxx Implementation of internal GUI functions (deprecated). gui_local.[ch]xx More internal GUI functions (deprecated). menubar.[ch]xx XML-configurable menu bar. mouse.cxx Old GUI mouse support (deprecated). -net_dlg.[ch]xx Hard-coded network dialog (deprecated). new_gui.[ch]xx Top-level for the GUI subsystem. preset_dlg.[ch]xx Internal functions for presets (deprecated). prop_picker.[ch]xx Built-in property-tree dialog. @@ -21,4 +20,4 @@ trackball.[ch] Old mouse view support (deprecated). David Megginson -2003-09-26 \ No newline at end of file +2003-09-26 diff --git a/src/GUI/gui.cxx b/src/GUI/gui.cxx index 4f07a7049..48deee30c 100644 --- a/src/GUI/gui.cxx +++ b/src/GUI/gui.cxx @@ -48,7 +48,6 @@ #include "gui.h" #include "gui_local.hxx" -#include "net_dlg.hxx" #include "preset_dlg.hxx" @@ -126,10 +125,5 @@ void guiInit() ConfirmExitDialogInit(); fgPresetInit(); -#ifdef FG_NETWORK_OLK - NewNetIdInit(); - NewNetFGDInit(); -#endif - mkDialogInit(); } diff --git a/src/GUI/gui_funcs.cxx b/src/GUI/gui_funcs.cxx index 5f56ac7c7..46a4cdf0e 100644 --- a/src/GUI/gui_funcs.cxx +++ b/src/GUI/gui_funcs.cxx @@ -80,10 +80,6 @@ #include
#include
-#ifdef FG_NETWORK_OLK -#include -#endif - #if defined( WIN32 ) && !defined( __CYGWIN__ ) && !defined(__MINGW32__) # include # include @@ -91,7 +87,6 @@ #include "gui.h" #include "gui_local.hxx" -#include "net_dlg.hxx" #include "preset_dlg.hxx" #include "prop_picker.hxx" #include "sgVec3Slider.hxx" @@ -104,10 +99,6 @@ extern void fgHUDalphaAdjust( puObject * ); // from cockpit.cxx extern void fgLatLonFormatToggle( puObject *); -#ifdef FG_NETWORK_OLK -extern void net_fgd_scan(puObject *cb); -#endif // #ifdef FG_NETWORK_OLK - #if defined( TR_HIRES_SNAP) #include extern void trRenderFrame( void ); @@ -170,15 +161,6 @@ const __fg_gui_fn_t __fg_gui_fn[] = { {"fgPresetAirspeed", fgPresetAirspeed}, {"fgPresetCommit", fgPresetCommit}, - // Network -#ifdef FG_NETWORK_OLK - {"net_display_toggle", net_display_toggle}, - {"NewCallSign", NewCallSign}, - {"net_fgd_scan", net_fgd_scan}, - {"net_register", net_register}, - {"net_unregister", net_unregister}, -#endif - // Autopilot {"NewAltitude", NewAltitude}, {"NewHeading", NewHeading}, @@ -404,12 +386,6 @@ void goodBye(puObject *) // "Program exiting normally at user request." ); cout << "Program exiting normally at user request." << endl; -#ifdef FG_NETWORK_OLK - if ( fgGetBool("/sim/networking/network-olk") ) { - if ( net_is_registered == 0 ) fgd_send_com( "8", FGFS_host); - } -#endif - // close all external I/O connections globals->get_io()->shutdown_all(); @@ -861,25 +837,3 @@ void fgDumpSnapShot () { } } -#ifdef FG_NETWORK_OLK -void net_display_toggle( puObject *cb) -{ - net_hud_display = (net_hud_display) ? 0 : 1; - printf("Toggle net_hud_display : %d\n", net_hud_display); -} - -void net_register( puObject *cb) -{ - fgd_send_com( "1", FGFS_host ); - net_is_registered = 0; - printf("Registering to deamon\n"); -} - -void net_unregister( puObject *cb) -{ - fgd_send_com( "8", FGFS_host ); - net_is_registered = -1; - printf("Unregistering from deamon\n"); -} - -#endif // #ifdef FG_NETWORK_OLK diff --git a/src/GUI/net_dlg.cxx b/src/GUI/net_dlg.cxx deleted file mode 100644 index 278962ee2..000000000 --- a/src/GUI/net_dlg.cxx +++ /dev/null @@ -1,308 +0,0 @@ -// net_dlg.cxx -- data structures for initializing & managing network. -// -// Written by Oliver Delise, started May 1999. -// -// Copyleft (C) 1999 Oliver Delise - delise@rp-plus.de -// -// This program is free software; you can redistribute it and/or -// modify it under the terms of the GNU General Public License as -// published by the Free Software Foundation; either version 2 of the -// License, or (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, but -// WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program; if not, write to the Free Software -// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -// - -#ifdef HAVE_CONFIG_H -# include -#endif - -#include - -#ifdef HAVE_WINDOWS_H -# include -#endif - -#include - -#include -#include -#include - -#include -#include - -#include
-#include
-#include - -#include "gui.h" -#include "net_dlg.hxx" - -/// The beginnings of networking :-) -// Needs cleaning up but works -// These statics should disapear when this is a class -static puDialogBox *NetIdDialog = 0; -static puFrame *NetIdDialogFrame = 0; -static puText *NetIdDialogMessage = 0; -static puInput *NetIdDialogInput = 0; - -static char NewNetId[16]; -static char NewNetIdLabel[] = "Enter New Callsign"; -extern char *fgd_callsign; - -static puOneShot *NetIdDialogOkButton = 0; -static puOneShot *NetIdDialogCancelButton = 0; - -void NetIdDialog_Cancel(puObject *) -{ - FG_POP_PUI_DIALOG( NetIdDialog ); -} - -void NetIdDialog_OK (puObject *) -{ - string NetId; - - static const SGPropertyNode *master_freeze - = fgGetNode("/sim/freeze/master"); - - bool freeze = master_freeze->getBoolValue(); - if ( !freeze ) { - fgSetBool("/sim/freeze/master", true); - } - -/* - The following needs some cleanup because - "string options.NetId" and "char *net_callsign" -*/ - NetIdDialogInput->getValue(&net_callsign); - NetId = net_callsign; - - NetIdDialog_Cancel( NULL ); - fgSetString("/networking/call-sign", NetId.c_str() ); - strcpy( fgd_callsign, net_callsign); -// strcpy( fgd_callsign, fgGetString("/sim/networking/call-sign").c_str()); -/* Entering a callsign indicates : user wants Net HUD Info */ - net_hud_display = 1; - - if ( !freeze ) { - fgSetBool("/sim/freeze/master", false); - } -} - -void NewCallSign(puObject *cb) -{ - sprintf( NewNetId, "%s", fgGetString("/sim/networking/call-sign") ); -// sprintf( NewNetId, "%s", fgd_callsign ); - NetIdDialogInput->setValue( NewNetId ); - - FG_PUSH_PUI_DIALOG( NetIdDialog ); -} - -void NewNetIdInit(void) -{ - sprintf( NewNetId, "%s", fgGetString("/sim/networking/call-sign") ); -// sprintf( NewNetId, "%s", fgd_callsign ); - int len = 150 - puGetDefaultLabelFont().getStringWidth( NewNetIdLabel ) / 2; - - NetIdDialog = new puDialogBox (150, 50); - { - NetIdDialogFrame = new puFrame (0,0,350, 150); - NetIdDialogMessage = new puText (len, 110); - NetIdDialogMessage -> setLabel (NewNetIdLabel); - - NetIdDialogInput = new puInput (50, 70, 300, 100); - NetIdDialogInput -> setValue (NewNetId); - NetIdDialogInput -> acceptInput(); - - NetIdDialogOkButton = new puOneShot (50, 10, 110, 50); - NetIdDialogOkButton -> setLegend (gui_msg_OK); - NetIdDialogOkButton -> setCallback (NetIdDialog_OK); - NetIdDialogOkButton -> makeReturnDefault(TRUE); - - NetIdDialogCancelButton = new puOneShot (240, 10, 300, 50); - NetIdDialogCancelButton -> setLegend (gui_msg_CANCEL); - NetIdDialogCancelButton -> setCallback (NetIdDialog_Cancel); - - } - FG_FINALIZE_PUI_DIALOG( NetIdDialog ); -} - - -/*************** Deamon communication **********/ - -// These statics should disapear when this is a class -static puDialogBox *NetFGDDialog = 0; -static puFrame *NetFGDDialogFrame = 0; -static puText *NetFGDDialogMessage = 0; -//static puInput *NetFGDDialogInput = 0; - -//static char NewNetId[16]; -static char NewNetFGDLabel[] = "Scan for deamon "; -static char NewFGDHost[64] = "olk.mcp.de"; -static int NewFGDPortLo = 10000; -static int NewFGDPortHi = 10001; - -//extern char *fgd_callsign; -extern u_short base_port, end_port; -extern int fgd_ip, verbose, current_port; -extern char *fgd_host; - - -static puOneShot *NetFGDDialogOkButton = 0; -static puOneShot *NetFGDDialogCancelButton = 0; -static puOneShot *NetFGDDialogScanButton = 0; - -static puInput *NetFGDHostDialogInput = 0; -static puInput *NetFGDPortLoDialogInput = 0; -static puInput *NetFGDPortHiDialogInput = 0; - -void NetFGDDialog_Cancel(puObject *) -{ - FG_POP_PUI_DIALOG( NetFGDDialog ); -} - -void NetFGDDialog_OK (puObject *) -{ - char *NetFGD; - - static const SGPropertyNode *master_freeze - = fgGetNode("/sim/freeze/master"); - - bool freeze = master_freeze->getBoolValue(); - if ( !freeze ) { - fgSetBool("/sim/freeze/master", true); - } - - NetFGDHostDialogInput->getValue( &NetFGD ); - strcpy( fgd_host, NetFGD); - NetFGDPortLoDialogInput->getValue( (int *) &base_port ); - NetFGDPortHiDialogInput->getValue( (int *) &end_port ); - NetFGDDialog_Cancel( NULL ); - - if ( !freeze ) { - fgSetBool("/sim/freeze/master", false); - } -} - -void NetFGDDialog_SCAN (puObject *) -{ - char *NetFGD; - int fgd_port; - - static const SGPropertyNode *master_freeze - = fgGetNode("/sim/freeze/master"); - - bool freeze = master_freeze->getBoolValue(); - if ( !freeze ) { - fgSetBool("/sim/freeze/master", true); - } - -// printf("Vor getvalue %s\n"); - NetFGDHostDialogInput->getValue( &NetFGD ); -// printf("Vor strcpy %s\n", (char *) NetFGD); - strcpy( fgd_host, NetFGD); - NetFGDPortLoDialogInput->getValue( (int *) &base_port ); - NetFGDPortHiDialogInput->getValue( (int *) &end_port ); - printf("FGD: %s Port-Start: %d Port-End: %d\n", fgd_host, - base_port, end_port); - net_resolv_fgd(fgd_host); - printf("Resolve : %d\n", net_r); - - if ( !freeze ) { - fgSetBool("/sim/freeze/master", false); - } - - if ( net_r == 0 ) { - fgd_port = 10000; - strcpy( fgd_name, ""); - for( current_port = base_port; ( current_port <= end_port); current_port++) { - fgd_send_com("0" , FGFS_host); - sprintf( NewNetFGDLabel , "Scanning for deamon Port: %d", current_port); - printf("FGD: searching %s\n", fgd_name); - if ( strcmp( fgd_name, "") != 0 ) { - sprintf( NewNetFGDLabel , "Found %s at Port: %d", - fgd_name, current_port); - fgd_port = current_port; - current_port = end_port+1; - } - } - current_port = end_port = base_port = fgd_port; - } - NetFGDDialog_Cancel( NULL ); -} - - -void net_fgd_scan(puObject *cb) -{ - NewFGDPortLo = base_port; - NewFGDPortHi = end_port; - strcpy( NewFGDHost, fgd_host); - NetFGDPortLoDialogInput->setValue( NewFGDPortLo ); - NetFGDPortHiDialogInput->setValue( NewFGDPortHi ); - NetFGDHostDialogInput->setValue( NewFGDHost ); - - FG_PUSH_PUI_DIALOG( NetFGDDialog ); -} - - -void NewNetFGDInit(void) -{ -// sprintf( NewNetId, "%s", fgGetString("/sim/networking/call-sign").c_str() ); -// sprintf( NewNetId, "%s", fgd_callsign ); - int len = 170 - - puGetDefaultLabelFont().getStringWidth( NewNetFGDLabel ) / 2; - - NetFGDDialog = new puDialogBox (310, 30); - { - NetFGDDialogFrame = new puFrame (0,0,320, 170); - NetFGDDialogMessage = new puText (len, 140); - NetFGDDialogMessage -> setLabel (NewNetFGDLabel); - - NetFGDPortLoDialogInput = new puInput (50, 70, 127, 100); - NetFGDPortLoDialogInput -> setValue (NewFGDPortLo); - NetFGDPortLoDialogInput -> acceptInput(); - - NetFGDPortHiDialogInput = new puInput (199, 70, 275, 100); - NetFGDPortHiDialogInput -> setValue (NewFGDPortHi); - NetFGDPortHiDialogInput -> acceptInput(); - - NetFGDHostDialogInput = new puInput (50, 100, 275, 130); - NetFGDHostDialogInput -> setValue (NewFGDHost); - NetFGDHostDialogInput -> acceptInput(); - - NetFGDDialogScanButton = new puOneShot (130, 10, 200, 50); - NetFGDDialogScanButton -> setLegend ("Scan"); - NetFGDDialogScanButton -> setCallback (NetFGDDialog_SCAN); - NetFGDDialogScanButton -> makeReturnDefault(FALSE); - - NetFGDDialogOkButton = new puOneShot (50, 10, 120, 50); - NetFGDDialogOkButton -> setLegend (gui_msg_OK); - NetFGDDialogOkButton -> setCallback (NetFGDDialog_OK); - NetFGDDialogOkButton -> makeReturnDefault(TRUE); - - NetFGDDialogCancelButton = new puOneShot (210, 10, 280, 50); - NetFGDDialogCancelButton -> setLegend (gui_msg_CANCEL); - NetFGDDialogCancelButton -> setCallback (NetFGDDialog_Cancel); - - } - FG_FINALIZE_PUI_DIALOG( NetFGDDialog ); -} - -/* -static void net_display_toggle( puObject *cb) -{ - net_hud_display = (net_hud_display) ? 0 : 1; - printf("Toggle net_hud_display : %d\n", net_hud_display); -} - -*/ - -/*************** End Networking **************/ - diff --git a/src/GUI/net_dlg.hxx b/src/GUI/net_dlg.hxx deleted file mode 100644 index 54fa417b1..000000000 --- a/src/GUI/net_dlg.hxx +++ /dev/null @@ -1,37 +0,0 @@ -// net_dlg.hxx -- data structures for initializing & managing network. -// -// Written by Oliver Delise, started May 1999. -// -// Copyleft (C) 1999 Oliver Delise - delise@rp-plus.de -// -// This program is free software; you can redistribute it and/or -// modify it under the terms of the GNU General Public License as -// published by the Free Software Foundation; either version 2 of the -// License, or (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, but -// WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program; if not, write to the Free Software -// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -// - -//#ifdef FG_NETWORK_OLK - -#include - -extern void NetIdDialog_Cancel(puObject *); -extern void NewCallSign(puObject *cb); -extern void NetIdDialog_OK (puObject *); -extern void NewNetIdInit(void); - -extern void NetFGDDialog_Cancel(puObject *); -extern void NetFGDDialog_OK (puObject *); -extern void NetFGDDialog_SCAN (puObject *); -extern void net_fgd_scan(puObject *cb); -extern void NewNetFGDInit(void); - -//#endif // FG_NETWORK_OLK diff --git a/src/Main/Makefile.am b/src/Main/Makefile.am index a5492ddb0..7230ff957 100644 --- a/src/Main/Makefile.am +++ b/src/Main/Makefile.am @@ -10,12 +10,6 @@ else MPLAYER_LIBS = endif -if ENABLE_NETWORK_OLK -NETWORK_LIBS = $(top_builddir)/src/NetworkOLK/libNetworkOLK.a -else -NETWORK_LIBS = -endif - if WITH_THREADS THREAD_LIBS = -lsgthreads $(thread_LIBS) else @@ -92,7 +86,6 @@ fgfs_LDADD = \ $(top_builddir)/src/Sound/libSound.a \ $(top_builddir)/src/Airports/libAirports.a \ $(MPLAYER_LIBS) \ - $(NETWORK_LIBS) \ $(top_builddir)/src/Objects/libObjects.a \ $(top_builddir)/src/Replay/libReplay.a \ $(top_builddir)/src/Systems/libSystems.a \ diff --git a/src/Main/main.cxx b/src/Main/main.cxx index dc8c5a8da..c761df4ae 100644 --- a/src/Main/main.cxx +++ b/src/Main/main.cxx @@ -88,10 +88,6 @@ #include