fix(Core/WorldSession): incorrect fmt formatting (#20926)

This commit is contained in:
Exitare
2024-12-20 06:38:17 -08:00
committed by GitHub
parent 330873400a
commit 25fb6cca47
3 changed files with 35 additions and 46 deletions

View File

@@ -22,6 +22,7 @@
#include "WorldSession.h"
#include "AccountMgr.h"
#include "BattlegroundMgr.h"
#include "BanMgr.h"
#include "CharacterPackets.h"
#include "Common.h"
#include "DatabaseEnv.h"
@@ -44,6 +45,7 @@
#include "ScriptMgr.h"
#include "SocialMgr.h"
#include "Transport.h"
#include "Tokenize.h"
#include "Vehicle.h"
#include "WardenWin.h"
#include "World.h"
@@ -52,8 +54,6 @@
#include "WorldState.h"
#include <zlib.h>
#include "BanMgr.h"
namespace
{
std::string const DefaultPlayerName = "<none>";
@@ -202,6 +202,19 @@ std::string WorldSession::GetPlayerInfo() const
return ss.str();
}
void WorldSession::SendAreaTriggerMessage(std::string_view str)
{
std::vector<std::string_view> lines = Acore::Tokenize(str, '\n', true);
for (std::string_view line : lines)
{
uint32 length = line.size() + 1;
WorldPacket data(SMSG_AREA_TRIGGER_MESSAGE, 4 + length);
data << length;
data << line.data();
SendPacket(&data);
}
}
/// Get player guid if available. Use for logging purposes only
ObjectGuid::LowType WorldSession::GetGuidLow() const
{
@@ -766,8 +779,8 @@ bool WorldSession::ValidateHyperlinksAndMaybeKick(std::string_view str)
if (Acore::Hyperlinks::CheckAllLinks(str))
return true;
LOG_ERROR("network", "Player {} {} sent a message with an invalid link:\n%.*s", GetPlayer()->GetName(),
GetPlayer()->GetGUID().ToString(), STRING_VIEW_FMT_ARG(str));
LOG_ERROR("network", "Player {} {} sent a message with an invalid link:\n{}", GetPlayer()->GetName(),
GetPlayer()->GetGUID().ToString(), str);
if (sWorld->getIntConfig(CONFIG_CHAT_STRICT_LINK_CHECKING_KICK))
KickPlayer("WorldSession::ValidateHyperlinksAndMaybeKick Invalid chat link");
@@ -780,8 +793,8 @@ bool WorldSession::DisallowHyperlinksAndMaybeKick(std::string_view str)
if (str.find('|') == std::string_view::npos)
return true;
LOG_ERROR("network", "Player {} {} sent a message which illegally contained a hyperlink:\n%.*s", GetPlayer()->GetName(),
GetPlayer()->GetGUID().ToString(), STRING_VIEW_FMT_ARG(str));
LOG_ERROR("network", "Player {} {} sent a message which illegally contained a hyperlink:\n{}", GetPlayer()->GetName(),
GetPlayer()->GetGUID().ToString(), str);
if (sWorld->getIntConfig(CONFIG_CHAT_STRICT_LINK_CHECKING_KICK))
KickPlayer("WorldSession::DisallowHyperlinksAndMaybeKick Illegal chat link");