示例#1
0
CMasterServerConfig::CMasterServerConfig()
{
	r3dOutToLog("!!!!!!!!! THIS SERVER NOT FOR F****R ElectroZ FUCKYOU POON !!!!!!\n");
	r3dOutToLog("!!!!!!!!! THIS SERVER NOT FOR F****R ElectroZ FUCKYOU POON !!!!!!\n");
	r3dOutToLog("!!!!!!!!! THIS SERVER NOT FOR F****R ElectroZ FUCKYOU POON !!!!!!\n");
	r3dOutToLog("!!!!!!!!! THIS SERVER NOT FOR F****R ElectroZ FUCKYOU POON !!!!!!\n");
	r3dOutToLog("!!!!!!!!! THIS SERVER NOT FOR F****R ElectroZ FUCKYOU POON !!!!!!\n");
	r3dOutToLog("!!!!!!!!! THIS SERVER NOT FOR F****R ElectroZ FUCKYOU POON !!!!!!\n");
	r3dOutToLog("!!!!!!!!! THIS SERVER NOT FOR F****R ElectroZ FUCKYOU POON !!!!!!\n");
	r3dOutToLog("!!!!!!!!! THIS SERVER NOT FOR F****R ElectroZ FUCKYOU POON !!!!!!\n");
	r3dOutToLog("!!!!!!!!! THIS SERVER NOT FOR F****R ElectroZ FUCKYOU POON !!!!!!\n");
	r3dOutToLog("!!!!!!!!! THIS SERVER NOT FOR F****R ElectroZ FUCKYOU POON !!!!!!\n");
	const char* group      = "MasterServer";

	if(_access(configFile, 0) != 0) {
		r3dOutToLog("can't open config file %s\n", configFile);
	}
	masterPort_  = r3dReadCFG_I(configFile, group, "masterPort", SBNET_MASTER_PORT);
	clientPort_  = r3dReadCFG_I(configFile, group, "clientPort", GBNET_CLIENT_PORT);
	masterCCU_   = r3dReadCFG_I(configFile, group, "masterCCU",  3000);

	supervisorCoolDownSeconds_ = r3dReadCFG_F(configFile, group, "supervisorCoolDownSeconds",  15.0f);

#define CHECK_I(xx) if(xx == 0)  r3dError("missing %s value in %s", #xx, configFile);
#define CHECK_S(xx) if(xx == "") r3dError("missing %s value in %s", #xx, configFile);
	CHECK_I(masterPort_);
	CHECK_I(clientPort_);
#undef CHECK_I
#undef CHECK_S

	serverId_    = r3dReadCFG_I(configFile, group, "serverId", 0);
	if(serverId_ == 0)
	{
		MessageBox(NULL, "you must define serverId in MasterServer.cfg", "", MB_OK);
		r3dError("no serverId");
	}
	if(serverId_ > 255 || serverId_ < 1)
	{
		MessageBox(NULL, "bad serverId", "", MB_OK);
		r3dError("bad serverId");
	}

	LoadConfig();
   //LoadRentConfig();
	return;
}
示例#2
0
CSupervisorConfig::CSupervisorConfig()
{
  const char* configFile = "SupervisorServer.cfg";
  const char* group      = "SupervisorServer";

  if(_access(configFile, 4) != 0) {
    r3dError("can't open config file %s", configFile);
  }

  masterPort_  = r3dReadCFG_I(configFile, group, "masterPort", SBNET_MASTER_PORT);
  masterIp_    = r3dReadCFG_S(configFile, group, "masterIp", "");
  
  serverGroup_ = r3dReadCFG_I(configFile, group, "serverGroup", GBNET_REGION_Unknown);
  serverName_  = r3dReadCFG_S(configFile, group, "serverName", "");

  maxPlayers_  = r3dReadCFG_I(configFile, group, "maxPlayers", 1024);
  maxGames_    = r3dReadCFG_I(configFile, group, "maxGames", 32);
  portStart_   = r3dReadCFG_I(configFile, group, "portStart", SBNET_GAME_PORT);
  gameServerExe_ = r3dReadCFG_S(configFile, group, "gameServerExe", "WO_GameServer.exe");
  externalIpStr_ = r3dReadCFG_S(configFile, group, "externalIp", "");
  externalIpAddr_= 0;
  
  uploadLogs_ = r3dReadCFG_I(configFile, group, "uploadLogs", 0);
  
  #define CHECK_I(xx) if(xx == 0)  r3dError("missing %s value", #xx);
  #define CHECK_S(xx) if(xx == "") r3dError("missing %s value", #xx);
  CHECK_I(masterPort_);
  CHECK_S(masterIp_);

  CHECK_I(serverGroup_);
  CHECK_S(serverName_);
  CHECK_I(maxPlayers_);
  CHECK_I(maxGames_);
  CHECK_I(portStart_);
  CHECK_S(gameServerExe_);
  #undef CHECK_I
  #undef CHECK_S
  
  if(_access(gameServerExe_.c_str(), 4) != 0) {
    r3dError("can't access game server '%s'\n", gameServerExe_.c_str());
  }
  
  ParseExternalIpAddr();
  
  return;
}
示例#3
0
int NS(SendI) (NS_ARGS)
{
  SETUP_mqctx
  MQ_INT val;
  CHECK_I(val)
  CHECK_NOARGS
  ErrorMqToTclWithCheck(MqSendI(mqctx, val));
  RETURN_TCL
}