aboutsummaryrefslogtreecommitdiff
path: root/src/game/World.cpp
diff options
context:
space:
mode:
authormegamage <none@none>2009-06-17 14:09:17 -0500
committermegamage <none@none>2009-06-17 14:09:17 -0500
commit2d569883e643ac08d5af6b23f9a0cd3ac4dc0d80 (patch)
tree9b2201d23090a9fddabf04e19a4afea0aaa70b2f /src/game/World.cpp
parentcf99758b0b0f857dda37e355801929ece4e6e928 (diff)
*Add config option CheckDB to check if the contents in FULL folder are applied.
--HG-- branch : trunk
Diffstat (limited to 'src/game/World.cpp')
-rw-r--r--src/game/World.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/game/World.cpp b/src/game/World.cpp
index 4c14da07fd5..1db8b7c0478 100644
--- a/src/game/World.cpp
+++ b/src/game/World.cpp
@@ -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);