Core/PacketIO: Add a validating string helper class for use in packet classes

(cherry picked from commit f2f47f774f3d9c5da1a38b5f20cbfe59c2ff66af)
This commit is contained in:
Shauren
2021-12-23 23:55:58 +01:00
parent def97385cc
commit 3ebfa8cc64
6 changed files with 192 additions and 7 deletions
+16
View File
@@ -425,6 +425,22 @@ bool WorldSession::Update(uint32 diff, PacketFilter& updater)
break;
}
}
catch (WorldPackets::InvalidHyperlinkException const& ihe)
{
TC_LOG_ERROR("network", "%s sent %s with an invalid link:\n%s", GetPlayerInfo().c_str(),
GetOpcodeNameForLogging(static_cast<OpcodeClient>(packet->GetOpcode())).c_str(), ihe.GetInvalidValue().c_str());
if (sWorld->getIntConfig(CONFIG_CHAT_STRICT_LINK_CHECKING_KICK))
KickPlayer();
}
catch (WorldPackets::IllegalHyperlinkException const& ihe)
{
TC_LOG_ERROR("network", "%s sent %s which illegally contained a hyperlink:\n%s", GetPlayerInfo().c_str(),
GetOpcodeNameForLogging(static_cast<OpcodeClient>(packet->GetOpcode())).c_str(), ihe.GetInvalidValue().c_str());
if (sWorld->getIntConfig(CONFIG_CHAT_STRICT_LINK_CHECKING_KICK))
KickPlayer();
}
catch (WorldPackets::PacketArrayMaxCapacityException const& pamce)
{
TC_LOG_ERROR("network", "PacketArrayMaxCapacityException: %s while parsing %s from %s.",