From 67bacbb731824be177061b1be3797b07b5ff34e1 Mon Sep 17 00:00:00 2001 From: hondacrx Date: Fri, 21 Aug 2020 20:30:53 -0400 Subject: [PATCH] Core/PacketIO: Send the expected value in available hotfixes packet - realm address, not arbitrary number (it no longer has any effect for clearing client cache) Port From (https://github.com/TrinityCore/TrinityCore/commit/2c99678118798279372f17d4bb5f5a88ac95c413) --- Source/Framework/Constants/SharedConst.cs | 1 - Source/Game/Handlers/HotfixHandler.cs | 4 ++-- Source/Game/Networking/Packets/HotfixPackets.cs | 8 ++++---- Source/Game/Server/WorldConfig.cs | 11 ----------- Source/Game/Server/WorldManager.cs | 3 +-- Source/Game/Server/WorldSession.cs | 2 +- Source/WorldServer/WorldServer.conf.dist | 8 -------- 7 files changed, 8 insertions(+), 29 deletions(-) diff --git a/Source/Framework/Constants/SharedConst.cs b/Source/Framework/Constants/SharedConst.cs index 425317fb8..b7aa804be 100644 --- a/Source/Framework/Constants/SharedConst.cs +++ b/Source/Framework/Constants/SharedConst.cs @@ -1172,7 +1172,6 @@ namespace Framework.Constants GuildResetHour, GuildSaveInterval, HonorAfterDuel, - HotfixCacheVersion, InstanceIgnoreLevel, InstanceIgnoreRaid, InstancemapLoadGrids, diff --git a/Source/Game/Handlers/HotfixHandler.cs b/Source/Game/Handlers/HotfixHandler.cs index a8a84cd3d..394b3ce06 100644 --- a/Source/Game/Handlers/HotfixHandler.cs +++ b/Source/Game/Handlers/HotfixHandler.cs @@ -57,9 +57,9 @@ namespace Game } } - void SendAvailableHotfixes(int version) + void SendAvailableHotfixes() { - SendPacket(new AvailableHotfixes(version, Global.DB2Mgr.GetHotfixCount(), Global.DB2Mgr.GetHotfixData())); + SendPacket(new AvailableHotfixes(Global.WorldMgr.GetRealmId().GetAddress(), Global.DB2Mgr.GetHotfixCount(), Global.DB2Mgr.GetHotfixData())); } [WorldPacketHandler(ClientOpcodes.HotfixRequest, Status = SessionStatus.Authed)] diff --git a/Source/Game/Networking/Packets/HotfixPackets.cs b/Source/Game/Networking/Packets/HotfixPackets.cs index 8c3dee627..d1749daf1 100644 --- a/Source/Game/Networking/Packets/HotfixPackets.cs +++ b/Source/Game/Networking/Packets/HotfixPackets.cs @@ -78,23 +78,23 @@ namespace Game.Networking.Packets class AvailableHotfixes : ServerPacket { - public AvailableHotfixes(int hotfixCacheVersion, uint hotfixCount, List hotfixes) : base(ServerOpcodes.AvailableHotfixes) + public AvailableHotfixes(uint virtualRealmAddress, uint hotfixCount, List hotfixes) : base(ServerOpcodes.AvailableHotfixes) { - HotfixCacheVersion = hotfixCacheVersion; + VirtualRealmAddress = virtualRealmAddress; HotfixCount = hotfixCount; Hotfixes = hotfixes; } public override void Write() { - _worldPacket.WriteInt32(HotfixCacheVersion); + _worldPacket.WriteUInt32(VirtualRealmAddress); _worldPacket.WriteUInt32(HotfixCount); foreach (HotfixRecord hotfixRecord in Hotfixes) hotfixRecord.Write(_worldPacket); } - public int HotfixCacheVersion; + public uint VirtualRealmAddress; public uint HotfixCount; public List Hotfixes; } diff --git a/Source/Game/Server/WorldConfig.cs b/Source/Game/Server/WorldConfig.cs index 20d740f6d..0a55dfae9 100644 --- a/Source/Game/Server/WorldConfig.cs +++ b/Source/Game/Server/WorldConfig.cs @@ -738,17 +738,6 @@ namespace Game } Log.outInfo(LogFilter.ServerLoading, "Client cache version set to: {0}", clientCacheId); - int hotfixCacheId = GetDefaultValue("HotfixCacheVersion", 0); - if (hotfixCacheId != 0) - { - // overwrite DB/old value - if (hotfixCacheId > 0) - Values[WorldCfg.HotfixCacheVersion] = hotfixCacheId; - else - Log.outError(LogFilter.ServerLoading, "HotfixCacheVersion can't be negative {0}, ignored.", hotfixCacheId); - } - Log.outInfo(LogFilter.ServerLoading, "Hotfix cache version set to: {0}", hotfixCacheId); - Values[WorldCfg.GuildNewsLogCount] = GetDefaultValue("Guild.NewsLogRecordsCount", GuildConst.NewsLogMaxRecords); if ((int)Values[WorldCfg.GuildNewsLogCount] > GuildConst.NewsLogMaxRecords) Values[WorldCfg.GuildNewsLogCount] = GuildConst.NewsLogMaxRecords; diff --git a/Source/Game/Server/WorldManager.cs b/Source/Game/Server/WorldManager.cs index ea569101c..e098fb58a 100644 --- a/Source/Game/Server/WorldManager.cs +++ b/Source/Game/Server/WorldManager.cs @@ -2075,13 +2075,12 @@ namespace Game { var DBVersion = "Unknown world database."; - SQLResult result = DB.World.Query("SELECT db_version, cache_id, hotfix_cache_id FROM version LIMIT 1"); + SQLResult result = DB.World.Query("SELECT db_version, cache_id FROM version LIMIT 1"); if (!result.IsEmpty()) { DBVersion = result.Read(0); // will be overwrite by config values if different and non-0 WorldConfig.SetValue(WorldCfg.ClientCacheVersion, result.Read(1)); - WorldConfig.SetValue(WorldCfg.HotfixCacheVersion, result.Read(2)); } return DBVersion; diff --git a/Source/Game/Server/WorldSession.cs b/Source/Game/Server/WorldSession.cs index 00aee21ac..49e620685 100644 --- a/Source/Game/Server/WorldSession.cs +++ b/Source/Game/Server/WorldSession.cs @@ -743,7 +743,7 @@ namespace Game SendSetTimeZoneInformation(); SendFeatureSystemStatusGlueScreen(); SendClientCacheVersion(WorldConfig.GetUIntValue(WorldCfg.ClientCacheVersion)); - SendAvailableHotfixes(WorldConfig.GetIntValue(WorldCfg.HotfixCacheVersion)); + SendAvailableHotfixes(); SendTutorialsData(); SQLResult result = holder.GetResult(AccountInfoQueryLoad.GlobalRealmCharacterCounts); diff --git a/Source/WorldServer/WorldServer.conf.dist b/Source/WorldServer/WorldServer.conf.dist index 2236dd4b3..1e0920d76 100644 --- a/Source/WorldServer/WorldServer.conf.dist +++ b/Source/WorldServer/WorldServer.conf.dist @@ -1145,14 +1145,6 @@ OffhandCheckAtSpellUnlearn = 1 ClientCacheVersion = 0 -# -# HotfixCacheVersion -# Description: Hotfix cache version for hotfix cache data reset. Use any value different -# from DB and not recently been used to trigger client side cache reset. -# Default: 0 - (Use DB value from world DB version.hotfix_id field) - -HotfixCacheVersion = 0 - # # Event.Announce # Description: Announce events.