*Add config option CheckDB to check if the contents in FULL folder are applied.

--HG--
branch : trunk
This commit is contained in:
megamage
2009-06-17 14:09:17 -05:00
parent cf99758b0b
commit 2d569883e6
8 changed files with 46 additions and 0 deletions

View File

@@ -1087,6 +1087,7 @@ void World::LoadConfigSettings(bool reload)
m_configs[CONFIG_SHOW_KICK_IN_WORLD] = sConfig.GetBoolDefault("ShowKickInWorld", false);
m_configs[CONFIG_INTERVAL_LOG_UPDATE] = sConfig.GetIntDefault("RecordUpdateTimeDiffInterval", 60000);
m_configs[CONFIG_MIN_LOG_UPDATE] = sConfig.GetIntDefault("MinRecordUpdateTimeDiff", 10);
m_configs[CONFIG_CHECK_DB] = sConfig.GetBoolDefault("CheckDB", true);
std::string forbiddenmaps = sConfig.GetStringDefault("ForbiddenMaps", "");
char * forbiddenMaps = new char[forbiddenmaps.length() + 1];
@@ -1485,6 +1486,13 @@ void World::SetInitialWorldSettings()
if(!LoadScriptingModule())
exit(1);
/// Check db
if(m_configs[CONFIG_CHECK_DB] && (!objmgr.CheckDB() || !spellmgr.CheckDB()))
{
sLog.outError("Your world DB is outdated. Please reapply sqls in sql\\FULL folder, or disable CheckDB option in config file (not recommended).");
exit(1);
}
///- Initialize game time and timers
sLog.outDebug( "DEBUG:: Initialize game time and timers" );
m_gameTime = time(NULL);