aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/server/game/Handlers/CharacterHandler.cpp11
-rw-r--r--src/server/game/Server/WorldSession.cpp14
-rw-r--r--src/server/game/Server/WorldSession.h2
3 files changed, 18 insertions, 9 deletions
diff --git a/src/server/game/Handlers/CharacterHandler.cpp b/src/server/game/Handlers/CharacterHandler.cpp
index e0ed3b3a997..75f261a96bc 100644
--- a/src/server/game/Handlers/CharacterHandler.cpp
+++ b/src/server/game/Handlers/CharacterHandler.cpp
@@ -29,7 +29,6 @@
#include "CharacterCache.h"
#include "CharacterPackets.h"
#include "Chat.h"
-#include "ClientConfigPackets.h"
#include "Common.h"
#include "Containers.h"
#include "DatabaseEnv.h"
@@ -1050,6 +1049,7 @@ void WorldSession::HandlePlayerLogin(LoginQueryHolder* holder)
pCurrChar->SetVirtualPlayerRealm(GetVirtualRealmAddress());
+ SendAccountDataTimes(ObjectGuid::Empty, GLOBAL_CACHE_MASK);
SendTutorialsData();
pCurrChar->GetMotionMaster()->Initialize();
@@ -1062,14 +1062,7 @@ void WorldSession::HandlePlayerLogin(LoginQueryHolder* holder)
// load player specific part before send times
LoadAccountData(holder->GetPreparedResult(PLAYER_LOGIN_QUERY_LOAD_ACCOUNT_DATA), PER_CHARACTER_CACHE_MASK);
-
- WorldPackets::ClientConfig::AccountDataTimes accountDataTimes;
- accountDataTimes.PlayerGuid = playerGuid;
- accountDataTimes.ServerTime = GameTime::GetGameTimeSystemPoint();
- for (uint32 i = 0; i < NUM_ACCOUNT_DATA_TYPES; ++i)
- accountDataTimes.AccountTimes[i] = GetAccountData(AccountDataType(i))->Time;
-
- SendPacket(accountDataTimes.Write());
+ SendAccountDataTimes(playerGuid, ALL_ACCOUNT_DATA_CACHE_MASK);
SendFeatureSystemStatus();
diff --git a/src/server/game/Server/WorldSession.cpp b/src/server/game/Server/WorldSession.cpp
index c023813114a..f6ccf775332 100644
--- a/src/server/game/Server/WorldSession.cpp
+++ b/src/server/game/Server/WorldSession.cpp
@@ -28,6 +28,7 @@
#include "BattlenetPackets.h"
#include "CharacterPackets.h"
#include "ChatPackets.h"
+#include "ClientConfigPackets.h"
#include "DatabaseEnv.h"
#include "GameTime.h"
#include "Group.h"
@@ -809,6 +810,18 @@ void WorldSession::SetAccountData(AccountDataType type, time_t time, std::string
_accountData[type].Data = data;
}
+void WorldSession::SendAccountDataTimes(ObjectGuid playerGuid, uint32 mask)
+{
+ WorldPackets::ClientConfig::AccountDataTimes accountDataTimes;
+ accountDataTimes.PlayerGuid = playerGuid;
+ accountDataTimes.ServerTime = GameTime::GetGameTimeSystemPoint();
+ for (uint32 i = 0; i < NUM_ACCOUNT_DATA_TYPES; ++i)
+ if (mask & (1 << i))
+ accountDataTimes.AccountTimes[i] = GetAccountData(AccountDataType(i))->Time;
+
+ SendPacket(accountDataTimes.Write());
+}
+
void WorldSession::LoadTutorialsData(PreparedQueryResult result)
{
memset(_tutorials, 0, sizeof(uint32) * MAX_ACCOUNT_TUTORIAL_VALUES);
@@ -1089,6 +1102,7 @@ void WorldSession::InitializeSessionCallback(LoginDatabaseQueryHolder* realmHold
SendFeatureSystemStatusGlueScreen();
SendClientCacheVersion(sWorld->getIntConfig(CONFIG_CLIENTCACHE_VERSION));
SendAvailableHotfixes();
+ SendAccountDataTimes(ObjectGuid::Empty, GLOBAL_CACHE_MASK);
SendTutorialsData();
if (PreparedQueryResult characterCountsResult = holder->GetPreparedResult(AccountInfoQueryHolder::GLOBAL_REALM_CHARACTER_COUNTS))
diff --git a/src/server/game/Server/WorldSession.h b/src/server/game/Server/WorldSession.h
index 932dec1a298..36f2c6a03de 100644
--- a/src/server/game/Server/WorldSession.h
+++ b/src/server/game/Server/WorldSession.h
@@ -832,6 +832,7 @@ enum AccountDataType
#define NUM_ACCOUNT_DATA_TYPES 12
+#define ALL_ACCOUNT_DATA_CACHE_MASK 0xFFF
#define GLOBAL_CACHE_MASK 0x515
#define PER_CHARACTER_CACHE_MASK 0xAEA
@@ -1049,6 +1050,7 @@ class TC_GAME_API WorldSession
// Account Data
AccountData const* GetAccountData(AccountDataType type) const { return &_accountData[type]; }
void SetAccountData(AccountDataType type, time_t time, std::string const& data);
+ void SendAccountDataTimes(ObjectGuid playerGuid, uint32 mask);
void LoadAccountData(PreparedQueryResult result, uint32 mask);
void LoadTutorialsData(PreparedQueryResult result);