aboutsummaryrefslogtreecommitdiff
path: root/src/game/World.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/game/World.cpp')
-rw-r--r--src/game/World.cpp23
1 files changed, 20 insertions, 3 deletions
diff --git a/src/game/World.cpp b/src/game/World.cpp
index bfd7893c7b6..e3be8c8420c 100644
--- a/src/game/World.cpp
+++ b/src/game/World.cpp
@@ -251,6 +251,11 @@ World::AddSession_ (WorldSession* s)
s->SendPacket (&packet);
s->SendAddonsInfo();
+
+ WorldPacket pkt(SMSG_CLIENTCACHE_VERSION, 4);
+ pkt << uint32(sWorld.getConfig(CONFIG_CLIENTCACHE_VERSION));
+ s->SendPacket(&pkt);
+
s->SendTutorialsData();
UpdateMaxSessionCounters ();
@@ -922,7 +927,7 @@ void World::LoadConfigSettings(bool reload)
m_configs[CONFIG_MAX_OVERSPEED_PINGS] = sConfig.GetIntDefault("MaxOverspeedPings",2);
if(m_configs[CONFIG_MAX_OVERSPEED_PINGS] != 0 && m_configs[CONFIG_MAX_OVERSPEED_PINGS] < 2)
{
- sLog.outError("MaxOverspeedPings (%i) must be in range 2..infinity (or 0 to disable check. Set to 2.",m_configs[CONFIG_MAX_OVERSPEED_PINGS]);
+ sLog.outError("MaxOverspeedPings (%i) must be in range 2..infinity (or 0 to disable check). Set to 2.",m_configs[CONFIG_MAX_OVERSPEED_PINGS]);
m_configs[CONFIG_MAX_OVERSPEED_PINGS] = 2;
}
@@ -1010,6 +1015,15 @@ void World::LoadConfigSettings(bool reload)
m_configs[CONFIG_OFFHAND_CHECK_AT_TALENTS_RESET] = sConfig.GetBoolDefault("OffhandCheckAtTalentsReset", false);
+ if(int clientCacheId = sConfig.GetIntDefault("ClientCacheVersion", 0))
+ {
+ // overwrite DB/old value
+ if(clientCacheId > 0)
+ m_configs[CONFIG_CLIENTCACHE_VERSION] = clientCacheId;
+ else
+ sLog.outError("ClientCacheVersion can't be negative %d, ignored.", clientCacheId);
+ }
+
m_configs[CONFIG_INSTANT_LOGOUT] = sConfig.GetIntDefault("InstantLogout", SEC_MODERATOR);
m_VisibleUnitGreyDistance = sConfig.GetFloatDefault("Visibility.Distance.Grey.Unit", 1);
@@ -2500,14 +2514,17 @@ void World::UpdateMaxSessionCounters()
void World::LoadDBVersion()
{
- QueryResult* result = WorldDatabase.Query("SELECT db_version, script_version FROM version LIMIT 1");
- //QueryResult* result = WorldDatabase.Query("SELECT version, creature_ai_version FROM db_version LIMIT 1");
+ QueryResult* result = WorldDatabase.Query("SELECT db_version, script_version, cache_id FROM version LIMIT 1");
+ //QueryResult* result = WorldDatabase.Query("SELECT version, creature_ai_version, cache_id FROM db_version LIMIT 1");
if(result)
{
Field* fields = result->Fetch();
m_DBVersion = fields[0].GetCppString();
m_CreatureEventAIVersion = fields[1].GetCppString();
+
+ // will be overwrite by config values if different and non-0
+ m_configs[CONFIG_CLIENTCACHE_VERSION] = fields[2].GetUInt32();
delete result;
}