void leagueOverSeer::loadConfig(const char* cmdLine) //Load the plugin configuration file { PluginConfig config = PluginConfig(cmdLine); std::string section = "leagueOverSeer"; if (config.errors) bz_shutdown(); //Shutdown the server //Extract all the data in the configuration file and assign it to plugin variables rotLeague = toBool(config.item(section, "ROTATIONAL_LEAGUE")); mapchangePath = config.item(section, "MAPCHANGE_PATH"); SQLiteDB = config.item(section, "SQLITE_DB"); LEAGUE_URL = config.item(section, "LEAGUE_OVER_SEER_URL"); DEBUG = atoi((config.item(section, "DEBUG_LEVEL")).c_str()); //Check for errors in the configuration data. If there is an error, shut down the server if (strcmp(LEAGUE_URL.c_str(), "") == 0) { bz_debugMessage(0, "*** DEBUG :: League Over Seer :: No URLs were choosen to report matches or query teams. ***"); bz_shutdown(); } if (DEBUG > 4 || DEBUG < 0) { bz_debugMessage(0, "*** DEBUG :: League Over Seer :: Invalid debug level in the configuration file. ***"); bz_shutdown(); } }
int PluginInit() { PluginManager::Get()->Initialize(); ConfigManager::Get()->Deserialize(); // start server //if ( ConfigManager::Get()->GetConfig()->IsAutoStartEnabled() ) // Server::Get()->Start(); #ifdef _DEBUG PluginConfig(); #endif return 0; // OK }