fix(Core/Session): Fixed loading global account data and tutorials. S… (#14038)

fix(Core/Session): Fixed loading global account data and tutorials. Source: TrinityCore.

Fixes #11974
This commit is contained in:
UltraNix
2022-12-06 13:08:46 +01:00
committed by GitHub
parent 590ad4e3e7
commit b9ea8b16af
4 changed files with 84 additions and 36 deletions

View File

@@ -313,14 +313,12 @@ void World::AddSession_(WorldSession* s)
if (pLimit > 0 && Sessions >= pLimit && AccountMgr::IsPlayerAccount(s->GetSecurity()) && !s->CanSkipQueue() && !HasRecentlyDisconnected(s))
{
AddQueuedPlayer (s);
AddQueuedPlayer(s);
UpdateMaxSessionCounters();
return;
}
s->SendAuthResponse(AUTH_OK, true);
FinalizePlayerWorldSession(s);
s->InitializeSession();
UpdateMaxSessionCounters();
}
@@ -400,13 +398,7 @@ bool World::RemoveQueuedPlayer(WorldSession* sess)
if ((!GetPlayerAmountLimit() || sessions < GetPlayerAmountLimit()) && !m_QueuedPlayer.empty())
{
WorldSession* pop_sess = m_QueuedPlayer.front();
pop_sess->SetInQueue(false);
pop_sess->ResetTimeOutTime(false);
pop_sess->SendAuthWaitQueue(0);
pop_sess->SendAccountDataTimes(GLOBAL_CACHE_MASK);
FinalizePlayerWorldSession(pop_sess);
pop_sess->InitializeSession();
m_QueuedPlayer.pop_front();
// update iter to point first queued socket or end() if queue is empty now
@@ -3390,16 +3382,6 @@ uint32 World::GetNextWhoListUpdateDelaySecs()
return uint32(std::ceil(t / 1000.0f));
}
void World::FinalizePlayerWorldSession(WorldSession* session)
{
uint32 cacheVersion = sWorld->getIntConfig(CONFIG_CLIENTCACHE_VERSION);
sScriptMgr->OnBeforeFinalizePlayerWorldSession(cacheVersion);
session->SendAddonsInfo();
session->SendClientCacheVersion(cacheVersion);
session->SendTutorialsData();
}
CliCommandHolder::CliCommandHolder(void* callbackArg, char const* command, Print zprint, CommandFinished commandFinished)
: m_callbackArg(callbackArg), m_command(strdup(command)), m_print(zprint), m_commandFinished(commandFinished)
{