mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-02-03 11:03:47 +00:00
Core/Packet: WorldState (#9435)
* Core/Packet: WorldState * Test * WRONG Co-authored-by: acidmanifesto <joshua.lee.betts@gmail.com>
This commit is contained in:
committed by
GitHub
parent
7209f65896
commit
e57582accb
@@ -43,6 +43,7 @@
|
||||
#include "Util.h"
|
||||
#include "World.h"
|
||||
#include "WorldPacket.h"
|
||||
#include "WorldStatePackets.h"
|
||||
|
||||
namespace Acore
|
||||
{
|
||||
@@ -625,13 +626,13 @@ void Battleground::SetTeamStartLoc(TeamId teamId, float X, float Y, float Z, flo
|
||||
m_TeamStartLocO[teamId] = O;
|
||||
}
|
||||
|
||||
void Battleground::SendPacketToAll(WorldPacket* packet)
|
||||
void Battleground::SendPacketToAll(WorldPacket const* packet)
|
||||
{
|
||||
for (BattlegroundPlayerMap::const_iterator itr = m_Players.begin(); itr != m_Players.end(); ++itr)
|
||||
itr->second->GetSession()->SendPacket(packet);
|
||||
}
|
||||
|
||||
void Battleground::SendPacketToTeam(TeamId teamId, WorldPacket* packet, Player* sender, bool self)
|
||||
void Battleground::SendPacketToTeam(TeamId teamId, WorldPacket const* packet, Player* sender, bool self)
|
||||
{
|
||||
for (BattlegroundPlayerMap::const_iterator itr = m_Players.begin(); itr != m_Players.end(); ++itr)
|
||||
if (itr->second->GetBgTeamId() == teamId && (self || sender != itr->second))
|
||||
@@ -719,18 +720,12 @@ uint32 Battleground::GetRealRepFactionForPlayer(uint32 factionId, Player* player
|
||||
return factionId;
|
||||
}
|
||||
|
||||
void Battleground::UpdateWorldState(uint32 Field, uint32 Value)
|
||||
void Battleground::UpdateWorldState(uint32 variable, uint32 value)
|
||||
{
|
||||
WorldPacket data;
|
||||
sBattlegroundMgr->BuildUpdateWorldStatePacket(&data, Field, Value);
|
||||
SendPacketToAll(&data);
|
||||
}
|
||||
|
||||
void Battleground::UpdateWorldStateForPlayer(uint32 Field, uint32 Value, Player* player)
|
||||
{
|
||||
WorldPacket data;
|
||||
sBattlegroundMgr->BuildUpdateWorldStatePacket(&data, Field, Value);
|
||||
player->GetSession()->SendPacket(&data);
|
||||
WorldPackets::WorldState::UpdateWorldState worldstate;
|
||||
worldstate.VariableID = variable;
|
||||
worldstate.Value = value;
|
||||
SendPacketToAll(worldstate.Write());
|
||||
}
|
||||
|
||||
void Battleground::EndBattleground(TeamId winnerTeamId)
|
||||
|
||||
Reference in New Issue
Block a user