//===========================================================================================
void CLoginProgressPostThread::init(NLMISC::CConfigFile &configFile)
{
	std::string installStartupPage;
	std::string installStartupHost;
	static std::string httpStr = "http://";
	// The url where the stats system are has changed from
	// http://r2linux03:80/login2/client_install.php (using InstallStartupPage and StartupPage )
	// http://r2linux03:80/stats/stats.php (using InstallStatsUrl

	if (configFile.getVarPtr("InstallStatsUrl") )
	{

		static std::string httpStr = "http://";
		static std::string::size_type httpStrSize = httpStr.size();
		std::string tmp = configFile.getVarPtr("InstallStatsUrl")->asString(0);
		std::string::size_type it= tmp.find(httpStr);
		if (it != std::string::npos)
		{
			std::string::size_type hostPageSeparator = tmp.find("/", httpStrSize);
			if (hostPageSeparator != std::string::npos)
			{
				installStartupPage = tmp.substr(hostPageSeparator); //keep the leading slash
				installStartupHost = tmp.substr(httpStrSize, hostPageSeparator  - httpStrSize); // dont keep the last slah
			}
		}
	}
	else
	{
		nlwarning("Error the InstallStatsUrl is not in the client_default.cfg.");
	}
	init(installStartupHost, installStartupPage);
}
Esempio n. 2
0
void				CUdpSimSock::setSimValues (NLMISC::CConfigFile &cf)
{
	cf.setCallback ("SimInLag", cbSimVar);
	cf.setCallback ("SimInPacketLost", cbSimVar);
	cf.setCallback ("SimOutLag", cbSimVar);
	cf.setCallback ("SimOutPacketLost", cbSimVar);
	cf.setCallback ("SimOutPacketDuplication", cbSimVar);
	cf.setCallback ("SimOutPacketDisordering", cbSimVar);

	CConfigFile::CVar *pv;
	pv = cf.getVarPtr("SimInLag");
	if( pv )
		cbSimVar( *pv );
	pv = cf.getVarPtr("SimInPacketLost");
	if( pv )
		cbSimVar( *pv );
	pv = cf.getVarPtr("SimOutLag");
	if( pv )
		cbSimVar( *pv );
	pv = cf.getVarPtr("SimOutPacketLost");
	if( pv )
		cbSimVar( *pv );
	pv = cf.getVarPtr("SimOutPacketDuplication");
	if( pv )
		cbSimVar( *pv );
	pv = cf.getVarPtr("SimOutPacketDisordering");
	if( pv )
		cbSimVar( *pv );
}