diff options
author | jackpoz <giacomopoz@gmail.com> | 2020-03-15 21:40:17 +0100 |
---|---|---|
committer | jackpoz <giacomopoz@gmail.com> | 2020-03-15 21:40:17 +0100 |
commit | 3fb41da57c5f6aea04f8e0b02056a6313575b764 (patch) | |
tree | 67dd1cc33658b487e70aa811be34a1ed2cd5c339 /src | |
parent | 01b2ac3ed425a3f94480c2b8a453c62ae30f6708 (diff) |
Core/Channels: Limit channel length only for custom channels
Diffstat (limited to 'src')
-rw-r--r-- | src/server/game/Handlers/ChannelHandler.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/server/game/Handlers/ChannelHandler.cpp b/src/server/game/Handlers/ChannelHandler.cpp index bde4757c513..c345a202ba3 100644 --- a/src/server/game/Handlers/ChannelHandler.cpp +++ b/src/server/game/Handlers/ChannelHandler.cpp @@ -57,19 +57,13 @@ void WorldSession::HandleJoinChannel(WorldPacket& recvPacket) return; } - if (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 (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(channelName)) + if (!DisallowHyperlinksAndMaybeKick(channelName)) return; if (ChannelMgr* cMgr = ChannelMgr::forTeam(GetPlayer()->GetTeam())) @@ -81,6 +75,12 @@ void WorldSession::HandleJoinChannel(WorldPacket& recvPacket) } else { // custom channel + if (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(channelName)) channel->JoinChannel(GetPlayer(), password); else if (Channel* channel = cMgr->CreateCustomChannel(channelName)) |