mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-16 07:30:42 +01:00
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)
This commit is contained in:
1
sql/updates/world/master/2020_08_13_00_world.sql
Normal file
1
sql/updates/world/master/2020_08_13_00_world.sql
Normal file
@@ -0,0 +1 @@
|
||||
ALTER TABLE `version` DROP `hotfix_cache_id`;
|
||||
@@ -22,6 +22,7 @@
|
||||
#include "HotfixPackets.h"
|
||||
#include "Log.h"
|
||||
#include "ObjectDefines.h"
|
||||
#include "Realm.h"
|
||||
#include "World.h"
|
||||
|
||||
void WorldSession::HandleDBQueryBulk(WorldPackets::Hotfix::DBQueryBulk& dbQuery)
|
||||
@@ -55,9 +56,9 @@ void WorldSession::HandleDBQueryBulk(WorldPackets::Hotfix::DBQueryBulk& dbQuery)
|
||||
}
|
||||
}
|
||||
|
||||
void WorldSession::SendAvailableHotfixes(int32 version)
|
||||
void WorldSession::SendAvailableHotfixes()
|
||||
{
|
||||
SendPacket(WorldPackets::Hotfix::AvailableHotfixes(version, sDB2Manager.GetHotfixCount(), sDB2Manager.GetHotfixData()).Write());
|
||||
SendPacket(WorldPackets::Hotfix::AvailableHotfixes(realm.Id.GetAddress(), sDB2Manager.GetHotfixCount(), sDB2Manager.GetHotfixData()).Write());
|
||||
}
|
||||
|
||||
void WorldSession::HandleHotfixRequest(WorldPackets::Hotfix::HotfixRequest& hotfixQuery)
|
||||
|
||||
@@ -63,7 +63,7 @@ WorldPacket const* DBReply::Write()
|
||||
|
||||
WorldPacket const* AvailableHotfixes::Write()
|
||||
{
|
||||
_worldPacket << int32(HotfixCacheVersion);
|
||||
_worldPacket << int32(VirtualRealmAddress);
|
||||
_worldPacket << uint32(HotfixCount);
|
||||
for (DB2Manager::HotfixRecord const& hotfixRecord : Hotfixes)
|
||||
_worldPacket << hotfixRecord;
|
||||
|
||||
@@ -61,12 +61,12 @@ namespace WorldPackets
|
||||
class AvailableHotfixes final : public ServerPacket
|
||||
{
|
||||
public:
|
||||
AvailableHotfixes(int32 hotfixCacheVersion, uint32 hotfixCount, DB2Manager::HotfixContainer const& hotfixes)
|
||||
: ServerPacket(SMSG_AVAILABLE_HOTFIXES), HotfixCacheVersion(hotfixCacheVersion), HotfixCount(hotfixCount), Hotfixes(hotfixes) { }
|
||||
AvailableHotfixes(int32 virtualRealmAddress, uint32 hotfixCount, DB2Manager::HotfixContainer const& hotfixes)
|
||||
: ServerPacket(SMSG_AVAILABLE_HOTFIXES), VirtualRealmAddress(virtualRealmAddress), HotfixCount(hotfixCount), Hotfixes(hotfixes) { }
|
||||
|
||||
WorldPacket const* Write() override;
|
||||
|
||||
int32 HotfixCacheVersion;
|
||||
int32 VirtualRealmAddress;
|
||||
uint32 HotfixCount;
|
||||
DB2Manager::HotfixContainer const& Hotfixes;
|
||||
};
|
||||
|
||||
@@ -1078,7 +1078,7 @@ void WorldSession::InitializeSessionCallback(LoginDatabaseQueryHolder* realmHold
|
||||
SendSetTimeZoneInformation();
|
||||
SendFeatureSystemStatusGlueScreen();
|
||||
SendClientCacheVersion(sWorld->getIntConfig(CONFIG_CLIENTCACHE_VERSION));
|
||||
SendAvailableHotfixes(int32(sWorld->getIntConfig(CONFIG_HOTFIX_CACHE_VERSION)));
|
||||
SendAvailableHotfixes();
|
||||
SendTutorialsData();
|
||||
|
||||
if (PreparedQueryResult characterCountsResult = holder->GetPreparedResult(AccountInfoQueryHolder::GLOBAL_REALM_CHARACTER_COUNTS))
|
||||
|
||||
@@ -930,7 +930,7 @@ class TC_GAME_API WorldSession
|
||||
|
||||
void SendAuthResponse(uint32 code, bool queued, uint32 queuePos = 0);
|
||||
void SendClientCacheVersion(uint32 version);
|
||||
void SendAvailableHotfixes(int32 version);
|
||||
void SendAvailableHotfixes();
|
||||
|
||||
void InitializeSession();
|
||||
void InitializeSessionCallback(LoginDatabaseQueryHolder* realmHolder, CharacterDatabaseQueryHolder* holder);
|
||||
|
||||
@@ -1216,16 +1216,6 @@ void World::LoadConfigSettings(bool reload)
|
||||
}
|
||||
TC_LOG_INFO("server.loading", "Client cache version set to: %u", m_int_configs[CONFIG_CLIENTCACHE_VERSION]);
|
||||
|
||||
if (int32 hotfixCacheId = sConfigMgr->GetIntDefault("HotfixCacheVersion", 0))
|
||||
{
|
||||
// overwrite DB/old value
|
||||
if (hotfixCacheId > 0)
|
||||
m_int_configs[CONFIG_HOTFIX_CACHE_VERSION] = hotfixCacheId;
|
||||
else
|
||||
TC_LOG_ERROR("server.loading", "HotfixCacheVersion can't be negative %d, ignored.", hotfixCacheId);
|
||||
}
|
||||
TC_LOG_INFO("server.loading", "Hotfix cache version set to: %u", m_int_configs[CONFIG_HOTFIX_CACHE_VERSION]);
|
||||
|
||||
m_int_configs[CONFIG_GUILD_NEWS_LOG_COUNT] = sConfigMgr->GetIntDefault("Guild.NewsLogRecordsCount", GUILD_NEWSLOG_MAX_RECORDS);
|
||||
if (m_int_configs[CONFIG_GUILD_NEWS_LOG_COUNT] > GUILD_NEWSLOG_MAX_RECORDS)
|
||||
m_int_configs[CONFIG_GUILD_NEWS_LOG_COUNT] = GUILD_NEWSLOG_MAX_RECORDS;
|
||||
@@ -3440,14 +3430,13 @@ void World::UpdateMaxSessionCounters()
|
||||
|
||||
void World::LoadDBVersion()
|
||||
{
|
||||
if (QueryResult result = WorldDatabase.Query("SELECT db_version, cache_id, hotfix_cache_id FROM version LIMIT 1"))
|
||||
if (QueryResult result = WorldDatabase.Query("SELECT db_version, cache_id FROM version LIMIT 1"))
|
||||
{
|
||||
Field* fields = result->Fetch();
|
||||
|
||||
m_DBVersion = fields[0].GetString();
|
||||
// will be overwrite by config values if different and non-0
|
||||
m_int_configs[CONFIG_CLIENTCACHE_VERSION] = fields[1].GetUInt32();
|
||||
m_int_configs[CONFIG_HOTFIX_CACHE_VERSION] = fields[2].GetUInt32();
|
||||
}
|
||||
|
||||
if (m_DBVersion.empty())
|
||||
|
||||
@@ -340,7 +340,6 @@ enum WorldIntConfigs
|
||||
CONFIG_LOGDB_CLEARINTERVAL,
|
||||
CONFIG_LOGDB_CLEARTIME,
|
||||
CONFIG_CLIENTCACHE_VERSION,
|
||||
CONFIG_HOTFIX_CACHE_VERSION,
|
||||
CONFIG_GUILD_NEWS_LOG_COUNT,
|
||||
CONFIG_GUILD_EVENT_LOG_COUNT,
|
||||
CONFIG_GUILD_BANK_EVENT_LOG_COUNT,
|
||||
|
||||
@@ -1193,14 +1193,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