mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-15 23:20:36 +01:00
Core/Channels: Limit channel length only for custom channels
(cherry picked from commit 3fb41da57c)
This commit is contained in:
@@ -65,11 +65,11 @@ void WorldSession::HandleJoinChannel(WorldPackets::Channel::JoinChannel& packet)
|
||||
|
||||
if (packet.Password.length() > MAX_CHANNEL_PASS_STR)
|
||||
{
|
||||
TC_LOG_ERROR("network", "Player %s tried to create a channel with a password more that " SZFMTD " characters long - blocked", GetPlayer()->GetGUID().ToString().c_str(), MAX_CHANNEL_PASS_STR);
|
||||
TC_LOG_ERROR("network", "Player %s tried to create a channel with a password more than " SZFMTD " characters long - blocked", GetPlayer()->GetGUID().ToString().c_str(), MAX_CHANNEL_PASS_STR);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!ValidateHyperlinksAndMaybeKick(packet.ChannelName))
|
||||
if (!DisallowHyperlinksAndMaybeKick(packet.ChannelName))
|
||||
return;
|
||||
|
||||
if (ChannelMgr* cMgr = ChannelMgr::ForTeam(GetPlayer()->GetTeam()))
|
||||
@@ -81,6 +81,12 @@ void WorldSession::HandleJoinChannel(WorldPackets::Channel::JoinChannel& packet)
|
||||
}
|
||||
else
|
||||
{ // custom channel
|
||||
if (packet.ChannelName.length() > MAX_CHANNEL_NAME_STR)
|
||||
{
|
||||
TC_LOG_ERROR("network", "Player %s tried to create a channel with a name more than " SZFMTD " characters long - blocked", GetPlayer()->GetGUID().ToString().c_str(), MAX_CHANNEL_NAME_STR);
|
||||
return;
|
||||
}
|
||||
|
||||
if (Channel* channel = cMgr->GetCustomChannel(packet.ChannelName))
|
||||
channel->JoinChannel(GetPlayer(), packet.Password);
|
||||
else if (Channel* channel = cMgr->CreateCustomChannel(packet.ChannelName))
|
||||
|
||||
Reference in New Issue
Block a user