MCPcopy Create free account
hub / github.com/OpenDungeons/OpenDungeons / loadGlobalGameConfig

Method loadGlobalGameConfig

source/utils/ConfigManager.cpp:428–622  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

426}
427
428bool ConfigManager::loadGlobalGameConfig(std::stringstream& configFile)
429{
430 std::string nextParam;
431 uint32_t paramsOk = 0;
432 while(configFile.good())
433 {
434 if(!(configFile >> nextParam))
435 break;
436
437 if(nextParam == "[/GameConfig]")
438 break;
439
440 if(nextParam == "NetworkPort")
441 {
442 configFile >> nextParam;
443 mNetworkPort = Helper::toUInt32(nextParam);
444 paramsOk |= 1;
445 }
446
447 if(nextParam == "ClientConnectionTimeout")
448 {
449 configFile >> nextParam;
450 mClientConnectionTimeout = Helper::toUInt32(nextParam);
451 // Not mandatory
452 }
453
454 if(nextParam == "CreatureDeathCounter")
455 {
456 configFile >> nextParam;
457 mCreatureDeathCounter = Helper::toUInt32(nextParam);
458 // Not mandatory
459 }
460
461 if(nextParam == "MaxCreaturesPerSeatAbsolute")
462 {
463 configFile >> nextParam;
464 mMaxCreaturesPerSeatAbsolute = Helper::toUInt32(nextParam);
465 // Not mandatory
466 }
467
468 if(nextParam == "MaxCreaturesPerSeatDefault")
469 {
470 configFile >> nextParam;
471 mMaxCreaturesPerSeatDefault = Helper::toUInt32(nextParam);
472 // Not mandatory
473 }
474
475 if(nextParam == "SlapDamagePercent")
476 {
477 configFile >> nextParam;
478 mSlapDamagePercent = Helper::toDouble(nextParam);
479 // Not mandatory
480 }
481
482 if(nextParam == "SlapEffectDuration")
483 {
484 configFile >> nextParam;
485 mSlapEffectDuration = Helper::toDouble(nextParam);

Callers

nothing calls this directly

Calls 5

toUInt32Function · 0.85
toDoubleFunction · 0.85
toIntFunction · 0.85
splitFunction · 0.85
toStringFunction · 0.70

Tested by

no test coverage detected