Index: trunk/src/orxonox.cc
===================================================================
--- trunk/src/orxonox.cc	(revision 9240)
+++ trunk/src/orxonox.cc	(revision 9406)
@@ -58,4 +58,5 @@
 
 #include "network_manager.h"
+#include "shared_network_data.h"
 
 #include "state.h"
@@ -66,5 +67,5 @@
 int verbose = 5;
 
-using namespace std;
+
 
 SHELL_COMMAND(restart, Orxonox, restart);
@@ -72,5 +73,6 @@
 REGISTER_ARG_FLAG( l, license,    "misc",  "showLicenseAndExit", "Prints the license and exit",      "1" );
 REGISTER_ARG_FLAG( c, client,     "game",  "gameType",           "Connect to Server (-H)",           "multiplayer_client" );
-REGISTER_ARG_FLAG( s, server,     "game",  "gameType",           "Start Orxonox as Game Server",     "multiplayer_server" );
+REGISTER_ARG_FLAG( s, server,     "game",  "gameType",           "Start Orxonox as Game Server",     "multiplayer_master_server" );
+REGISTER_ARG_FLAG( x, proxy,      "game",  "gameType",           "Start Orxonox as Proxy Server",    "multiplayer_proxy_server" );
 REGISTER_ARG_ARG(  H, host,       "game",  "host",               "Host to connect to",               "host");
 REGISTER_ARG_ARG(  p, port,       "game",  "port",               "Port to use",                      "port" );
@@ -79,5 +81,6 @@
 REGISTER_ARG_FLAG( f, fullscreen, "video", "Fullscreen-mode",    "start Orxonox in fullscreen mode", "1");
 REGISTER_ARG_FLAG( w, windowed,   "video", "Fullscreen-mode",    "start Orxonox in windowed mode",   "0");
-REGISTER_ARG_ARG(  r, resolution, "video", "Resolution",         "Sets resolution / window size",    "res");
+REGISTER_ARG_ARG(  r, resolution, "video", "Resolution",         "sets resolution / window size",    "res");
+REGISTER_ARG_FLAG( d, dedicated,  "video", "Norender-mode",      "the scene is not rendered",        "1" );
 
 REGISTER_ARG_FLAG( a, audio,      "audio", "Disable-Audio",      "Enable audio",                     "0" );
@@ -144,5 +147,5 @@
   SDL_QuitSubSystem(SDL_INIT_TIMER);
   ClassList::debug();
-  
+
   Preferences::getInstance()->save();
 
@@ -301,16 +304,28 @@
 {
   PRINT(3)("> Initializing networking\n");
-
-  if( this->serverName != "") // we are a client
-  {
+  std::string gameType = Preferences::getInstance()->getString( "game", "gameType", "" );
+
+  if( gameType == "multiplayer_client")
+  {    // we are a client
     State::setOnline(true);
-    NetworkManager::getInstance()->establishConnection(this->serverName, port);
-  }
-  else if( this->port > 0)
-  {    // we are a server
+    SharedNetworkData::getInstance()->setNodeType(NET_CLIENT);
+    NetworkManager::getInstance()->createClient(this->serverName, port);
+  }
+  else if( gameType == "multiplayer_master_server")
+  {    // we are a master server
     State::setOnline(true);
-    NetworkManager::getInstance()->createServer(port);
-  }
-  return 0;
+    SharedNetworkData::getInstance()->setNodeType(NET_MASTER_SERVER);
+
+    NetworkManager::getInstance()->createMasterServer(port);
+  }
+  else if( gameType == "multiplayer_proxy_server")
+  {    // we are a proxy server
+    State::setOnline(true);
+    SharedNetworkData::getInstance()->setNodeType(NET_PROXY_SERVER_ACTIVE);
+    NetworkManager::getInstance()->createProxyServer(port);
+  }
+
+  return 0;
+
 }
 
@@ -453,11 +468,12 @@
   if ( Preferences::getInstance()->getString("misc", "bt-to-file", "1") == "1" )
   {
-    SignalHandler::getInstance()->doCatch( argv[0] );
-
+    SignalHandler::getInstance()->doCatch( argv[0], "orxonox.backtrace" );
+    SignalHandler::getInstance()->registerCallback( EventHandler::releaseMouse, NULL );
   }
 
   if( Preferences::getInstance()->getString("game", "showGui", "") == "1" )
     showGui = true;
-  else if( Preferences::getInstance()->getString( "game", "gameType", "" ) == "multiplayer_server" ||
+  else if( Preferences::getInstance()->getString( "game", "gameType", "" ) == "multiplayer_master_server" ||
+           Preferences::getInstance()->getString( "game", "gameType", "" ) == "multiplayer_proxy_server" ||
            Preferences::getInstance()->getString( "game", "gameType", "" ) == "multiplayer_client" )
     return startNetworkOrxonox(argc, argv);
@@ -493,9 +509,17 @@
     startOrxonox(argc, argv, host.c_str(), port);
   }
-  else if ( gameType == "multiplayer_server" )
+  else if ( gameType == "multiplayer_master_server" )
   {
     int port = Preferences::getInstance()->getInt( "game", "port", DEFAULT_ORXONOX_PORT );
 
     printf("Starting Orxonox as server: listening on port %i\n", port);
+
+    startOrxonox(argc, argv, "", port);
+  }
+  else if ( gameType == "multiplayer_proxy_server" )
+  {
+    int port = Preferences::getInstance()->getInt( "game", "port", DEFAULT_ORXONOX_PORT );
+
+    printf("Starting Orxonox as proxy server: listening on port %i\n", port);
 
     startOrxonox(argc, argv, "", port);
