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)
This commit is contained in:
@@ -1172,7 +1172,6 @@ namespace Framework.Constants
|
||||
GuildResetHour,
|
||||
GuildSaveInterval,
|
||||
HonorAfterDuel,
|
||||
HotfixCacheVersion,
|
||||
InstanceIgnoreLevel,
|
||||
InstanceIgnoreRaid,
|
||||
InstancemapLoadGrids,
|
||||
|
||||
@@ -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)]
|
||||
|
||||
@@ -78,23 +78,23 @@ namespace Game.Networking.Packets
|
||||
|
||||
class AvailableHotfixes : ServerPacket
|
||||
{
|
||||
public AvailableHotfixes(int hotfixCacheVersion, uint hotfixCount, List<HotfixRecord> hotfixes) : base(ServerOpcodes.AvailableHotfixes)
|
||||
public AvailableHotfixes(uint virtualRealmAddress, uint hotfixCount, List<HotfixRecord> 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<HotfixRecord> Hotfixes;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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<string>(0);
|
||||
// will be overwrite by config values if different and non-0
|
||||
WorldConfig.SetValue(WorldCfg.ClientCacheVersion, result.Read<uint>(1));
|
||||
WorldConfig.SetValue(WorldCfg.HotfixCacheVersion, result.Read<uint>(2));
|
||||
}
|
||||
|
||||
return DBVersion;
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user