mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-25 22:56:24 +00:00
fix(Core/Weather): Improve weather system thread safety (#22772)
Co-authored-by: Shauren <shauren.trinity@gmail.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
@@ -398,29 +398,6 @@ void WorldSessionMgr::SendGlobalGMMessage(WorldPacket const* packet, WorldSessio
|
||||
}
|
||||
}
|
||||
|
||||
/// Send a packet to all players (or players selected team) in the zone (except self if mentioned)
|
||||
bool WorldSessionMgr::SendZoneMessage(uint32 zone, WorldPacket const* packet, WorldSession* self, TeamId teamId)
|
||||
{
|
||||
bool foundPlayerToSend = false;
|
||||
SessionMap::const_iterator itr;
|
||||
|
||||
for (itr = _sessions.begin(); itr != _sessions.end(); ++itr)
|
||||
{
|
||||
if (itr->second &&
|
||||
itr->second->GetPlayer() &&
|
||||
itr->second->GetPlayer()->IsInWorld() &&
|
||||
itr->second->GetPlayer()->GetZoneId() == zone &&
|
||||
itr->second != self &&
|
||||
(teamId == TEAM_NEUTRAL || itr->second->GetPlayer()->GetTeamId() == teamId))
|
||||
{
|
||||
itr->second->SendPacket(packet);
|
||||
foundPlayerToSend = true;
|
||||
}
|
||||
}
|
||||
|
||||
return foundPlayerToSend;
|
||||
}
|
||||
|
||||
/// Send a server message to the user(s)
|
||||
void WorldSessionMgr::SendServerMessage(ServerMessageType messageID, std::string stringParam /*= ""*/, Player* player /*= nullptr*/)
|
||||
{
|
||||
@@ -435,14 +412,6 @@ void WorldSessionMgr::SendServerMessage(ServerMessageType messageID, std::string
|
||||
SendGlobalMessage(chatServerMessage.Write());
|
||||
}
|
||||
|
||||
/// Send a System Message to all players in the zone (except self if mentioned)
|
||||
void WorldSessionMgr::SendZoneText(uint32 zone, std::string text, WorldSession* self, TeamId teamId)
|
||||
{
|
||||
WorldPacket data;
|
||||
ChatHandler::BuildChatPacket(data, CHAT_MSG_SYSTEM, LANG_UNIVERSAL, nullptr, nullptr, text.c_str());
|
||||
SendZoneMessage(zone, &data, self, teamId);
|
||||
}
|
||||
|
||||
void WorldSessionMgr::DoForAllOnlinePlayers(std::function<void(Player*)> exec)
|
||||
{
|
||||
std::shared_lock lock(*HashMapHolder<Player>::GetLock());
|
||||
|
||||
@@ -81,8 +81,6 @@ public:
|
||||
|
||||
void SendGlobalMessage(WorldPacket const* packet, WorldSession* self = nullptr, TeamId teamId = TEAM_NEUTRAL);
|
||||
void SendGlobalGMMessage(WorldPacket const* packet, WorldSession* self = nullptr, TeamId teamId = TEAM_NEUTRAL);
|
||||
bool SendZoneMessage(uint32 zone, WorldPacket const* packet, WorldSession* self = nullptr, TeamId teamId = TEAM_NEUTRAL);
|
||||
void SendZoneText(uint32 zone, std::string text, WorldSession* self = nullptr, TeamId teamId = TEAM_NEUTRAL);
|
||||
void SendServerMessage(ServerMessageType messageID, std::string stringParam = "", Player* player = nullptr);
|
||||
|
||||
void DoForAllOnlinePlayers(std::function<void(Player*)> exec);
|
||||
|
||||
Reference in New Issue
Block a user