home *** CD-ROM | disk | FTP | other *** search
/ 3D Game Programming All in One / 3D Game Programming All in One Disc.iso / 3D2E / RESOURCES / KOOB / control / server / initialize.cs next >
Encoding:
Text File  |  2006-09-25  |  2.1 KB  |  58 lines

  1. //============================================================================
  2. // control/server/initialize.cs
  3. //
  4. //  server control initialization module for 3D2E Koob23 sample game
  5. //
  6. //  Copyright (c) 2003 by Kenneth C.  Finney.
  7. //============================================================================
  8. $pref::Master0 = "2:master.garagegames.com:28002";
  9. $Pref::Server::ConnectionError = "You do not have the correct version of 3D2E client or the related art needed to play on this server. This is the server for Chapter 6. Please check that chapter for directions.";
  10. $Pref::Server::FloodProtectionEnabled = 1;
  11. $Pref::Server::Info = "3D Game Programming All-In-One by Kenneth C. Finney.";
  12. $Pref::Server::MaxPlayers = 64;
  13. $Pref::Server::Name = "3D2E Book - Chapter 6 Server";
  14. $Pref::Server::Password = "";
  15. $Pref::Server::Port = 28000;
  16. $Pref::Server::RegionMask = 2;
  17. $Pref::Server::TimeLimit = 20;
  18. $Pref::Net::LagThreshold = "400";
  19. $pref::Net::PacketRateToClient = "10";
  20. $pref::Net::PacketRateToServer = "32";
  21. $pref::Net::PacketSize = "200";
  22. $pref::Net::Port = 28000;
  23.  
  24.  
  25. function InitializeServer()
  26. //----------------------------------------------------------------------------
  27. // Prepare some global server information & load the game-specific module
  28. //----------------------------------------------------------------------------
  29. {
  30.     $Server::GameType = "3D2E";
  31. $Server::MissionType = "Koob23";
  32. $Server::Status = "Unknown";
  33.  
  34.    Echo("\n++++++++++++ Initializing module: Koob23 server ++++++++++++");
  35.  
  36.    // Specify where the mission files are.
  37.    $Server::MissionFileSpec = "*/maps/*.mis";
  38.  
  39.    InitBaseServer(); // basic server features defined in the common modules
  40.  
  41.    // Load up game server support script
  42.    Exec("./server.cs");
  43. }
  44.  
  45. function InitializeDedicatedServer()
  46. {
  47.    EnableWinConsole(true);
  48.    Echo("\n--------- Starting Dedicated Server ---------");
  49.  
  50.    $Server::Dedicated = true;
  51.  
  52.    if ($mapArgument !$= "") {
  53.       CreateServer("MultiPlayer", $mapArgument);
  54.    }
  55.    else
  56.       Echo("No map specified (use -map <filename>)");
  57. }
  58.