refactor(Core/World): Create WorldSessionMgr to split session logic out of World (#21400)

This commit is contained in:
Takenbacon
2025-02-12 22:04:38 -08:00
committed by GitHub
parent 0f0b341d9d
commit edcfaeb845
32 changed files with 713 additions and 686 deletions

View File

@@ -47,6 +47,7 @@
#include "WaypointMovementGenerator.h"
#include "World.h"
#include "WorldPacket.h"
#include "WorldSessionMgr.h"
/// @todo: this import is not necessary for compilation and marked as unused by the IDE
// however, for some reasons removing it would cause a damn linking issue
@@ -2818,7 +2819,7 @@ void Creature::SendZoneUnderAttackMessage(Player* attacker)
{
WorldPacket data(SMSG_ZONE_UNDER_ATTACK, 4);
data << (uint32)GetAreaId();
sWorld->SendGlobalMessage(&data, nullptr, (attacker->GetTeamId() == TEAM_ALLIANCE ? TEAM_HORDE : TEAM_ALLIANCE));
sWorldSessionMgr->SendGlobalMessage(&data, nullptr, (attacker->GetTeamId() == TEAM_ALLIANCE ? TEAM_HORDE : TEAM_ALLIANCE));
}
/**

View File

@@ -84,6 +84,7 @@
#include "World.h"
#include "WorldPacket.h"
#include "WorldSession.h"
#include "WorldSessionMgr.h"
#include "WorldState.h"
#include <cmath>
@@ -363,7 +364,7 @@ Player::Player(WorldSession* session): Unit(true), m_mover(this)
m_ControlledByPlayer = true;
sWorld->IncreasePlayerCount();
sWorldSessionMgr->IncreasePlayerCount();
m_ChampioningFaction = 0;
@@ -447,7 +448,7 @@ Player::~Player()
delete m_reputationMgr;
delete _cinematicMgr;
sWorld->DecreasePlayerCount();
sWorldSessionMgr->DecreasePlayerCount();
if (!m_isInSharedVisionOf.empty())
{