Merge branch 'master' into Playerbot

This commit is contained in:
Yunfan Li
2025-02-19 22:29:36 +08:00
parent d1032678ff
commit 7d431dc796
277 changed files with 7092 additions and 5050 deletions

View File

@@ -30,6 +30,7 @@
#include "World.h"
#include "WorldPacket.h"
#include "WorldSession.h"
#include "WorldSessionMgr.h"
#include <boost/algorithm/string/replace.hpp>
Player* ChatHandler::GetPlayer() const
@@ -81,7 +82,7 @@ bool ChatHandler::HasLowerSecurityAccount(WorldSession* target, uint32 target_ac
return false;
// ignore only for non-players for non strong checks (when allow apply command at least to same sec level)
if (!AccountMgr::IsPlayerAccount(m_session->GetSecurity()) && !strong && !sWorld->getBoolConfig(CONFIG_GM_LOWER_SECURITY))
if (!AccountMgr::IsPlayerAccount(m_session->GetSecurity()) && !strong && sWorld->getBoolConfig(CONFIG_GM_LOWER_SECURITY))
return false;
if (target)
@@ -188,7 +189,7 @@ void ChatHandler::SendGlobalSysMessage(const char* str)
for (std::string_view line : Acore::Tokenize(str, '\n', true))
{
BuildChatPacket(data, CHAT_MSG_SYSTEM, LANG_UNIVERSAL, nullptr, nullptr, line);
sWorld->SendGlobalMessage(&data);
sWorldSessionMgr->SendGlobalMessage(&data);
}
}
@@ -198,7 +199,7 @@ void ChatHandler::SendGlobalGMSysMessage(const char* str)
for (std::string_view line : Acore::Tokenize(str, '\n', true))
{
BuildChatPacket(data, CHAT_MSG_SYSTEM, LANG_UNIVERSAL, nullptr, nullptr, line);
sWorld->SendGlobalGMMessage(&data);
sWorldSessionMgr->SendGlobalGMMessage(&data);
}
}
@@ -514,8 +515,8 @@ bool ChatHandler::HasSession() const
void ChatHandler::DoForAllValidSessions(std::function<void(Player*)> exec)
{
SessionMap::const_iterator itr;
for (itr = sWorld->GetAllSessions().begin(); itr != sWorld->GetAllSessions().end(); ++itr)
WorldSessionMgr::SessionMap const& sessionMap = sWorldSessionMgr->GetAllSessions();
for (WorldSessionMgr::SessionMap::const_iterator itr = sessionMap.begin(); itr != sessionMap.end(); ++itr)
if (Player* player = itr->second->GetPlayer())
if (player->IsInWorld())
exec(player);