Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 9396 in orxonox.OLD for branches/proxy/src/orxonox.cc


Ignore:
Timestamp:
Jul 23, 2006, 10:07:23 PM (18 years ago)
Author:
patrick
Message:

committing my weekends work: 2100 lines :D

  • proxy server now accepts and synchronizes clients like a master server
  • network manager got different network setup interface
  • network stream got different constructure scheme
  • permissions checking and algorithm extended and changed
  • starting ability to connect to multiple network nodes at the same time
  • some very much smaller changes here and there
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/proxy/src/orxonox.cc

    r9357 r9396  
    7272REGISTER_ARG_FLAG( l, license,    "misc",  "showLicenseAndExit", "Prints the license and exit",      "1" );
    7373REGISTER_ARG_FLAG( c, client,     "game",  "gameType",           "Connect to Server (-H)",           "multiplayer_client" );
    74 REGISTER_ARG_FLAG( s, server,     "game",  "gameType",           "Start Orxonox as Game Server",     "multiplayer_server" );
     74REGISTER_ARG_FLAG( s, server,     "game",  "gameType",           "Start Orxonox as Game Server",     "multiplayer_master_server" );
     75REGISTER_ARG_FLAG( x, proxy,      "game",  "gameType",           "Start Orxonox as Proxy Server",    "multiplayer_proxy_server" );
    7576REGISTER_ARG_ARG(  H, host,       "game",  "host",               "Host to connect to",               "host");
    7677REGISTER_ARG_ARG(  p, port,       "game",  "port",               "Port to use",                      "port" );
     
    7980REGISTER_ARG_FLAG( f, fullscreen, "video", "Fullscreen-mode",    "start Orxonox in fullscreen mode", "1");
    8081REGISTER_ARG_FLAG( w, windowed,   "video", "Fullscreen-mode",    "start Orxonox in windowed mode",   "0");
    81 REGISTER_ARG_ARG(  r, resolution, "video", "Resolution",         "Sets resolution / window size",    "res");
     82REGISTER_ARG_ARG(  r, resolution, "video", "Resolution",         "sets resolution / window size",    "res");
     83REGISTER_ARG_FLAG( d, dedicated,  "video", "Norender-mode",      "the scene is not rendered",        "1" );
    8284
    8385REGISTER_ARG_FLAG( a, audio,      "audio", "Disable-Audio",      "Enable audio",                     "0" );
     
    144146  SDL_QuitSubSystem(SDL_INIT_TIMER);
    145147  ClassList::debug();
    146  
     148
    147149  Preferences::getInstance()->save();
    148150
     
    301303{
    302304  PRINT(3)("> Initializing networking\n");
    303 
    304   if( this->serverName != "") // we are a client
     305  std::string gameType = Preferences::getInstance()->getString( "game", "gameType", "" );
     306
     307  if( gameType == "multiplayer_client") // we are a client
    305308  {
    306309    State::setOnline(true);
    307     NetworkManager::getInstance()->establishConnection(this->serverName, port);
    308   }
    309   else if( this->port > 0)
    310   {    // we are a server
     310    NetworkManager::getInstance()->createClient(this->serverName, port);
     311  }
     312  else if( gameType == "multiplayer_master_server")
     313  {    // we are a master server
    311314    State::setOnline(true);
    312     NetworkManager::getInstance()->createServer(port);
    313   }
    314   return 0;
     315    NetworkManager::getInstance()->createMasterServer(port);
     316  }
     317  else if( gameType == "multiplayer_proxy_server")
     318  {    // we are a proxy server
     319    State::setOnline(true);
     320    NetworkManager::getInstance()->createProxyServer(port);
     321  }
     322
     323  return 0;
     324
    315325}
    316326
     
    459469  if( Preferences::getInstance()->getString("game", "showGui", "") == "1" )
    460470    showGui = true;
    461   else if( Preferences::getInstance()->getString( "game", "gameType", "" ) == "multiplayer_server" ||
     471  else if( Preferences::getInstance()->getString( "game", "gameType", "" ) == "multiplayer_master_server" ||
     472           Preferences::getInstance()->getString( "game", "gameType", "" ) == "multiplayer_proxy_server" ||
    462473           Preferences::getInstance()->getString( "game", "gameType", "" ) == "multiplayer_client" )
    463474    return startNetworkOrxonox(argc, argv);
     
    493504    startOrxonox(argc, argv, host.c_str(), port);
    494505  }
    495   else if ( gameType == "multiplayer_server" )
     506  else if ( gameType == "multiplayer_master_server" )
    496507  {
    497508    int port = Preferences::getInstance()->getInt( "game", "port", DEFAULT_ORXONOX_PORT );
    498509
    499510    printf("Starting Orxonox as server: listening on port %i\n", port);
     511
     512    startOrxonox(argc, argv, "", port);
     513  }
     514  else if ( gameType == "multiplayer_proxy_server" )
     515  {
     516    int port = Preferences::getInstance()->getInt( "game", "port", DEFAULT_ORXONOX_PORT );
     517
     518    printf("Starting Orxonox as proxy server: listening on port %i\n", port);
    500519
    501520    startOrxonox(argc, argv, "", port);
Note: See TracChangeset for help on using the changeset viewer.