mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-19 08:55:32 +01:00
Core/Channel: properly notify client about invalid channel names
Closes #16190
This commit is contained in:
@@ -16,8 +16,9 @@
|
||||
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "Channel.h"
|
||||
#include "ChannelMgr.h"
|
||||
#include "Channel.h"
|
||||
#include "DBCStores.h"
|
||||
#include "Player.h"
|
||||
#include "World.h"
|
||||
#include "WorldSession.h"
|
||||
|
||||
@@ -54,11 +54,13 @@ void WorldSession::HandleJoinChannel(WorldPacket& recvPacket)
|
||||
return;
|
||||
}
|
||||
|
||||
if (channelName.empty())
|
||||
return;
|
||||
|
||||
if (isdigit(channelName[0]))
|
||||
if (channelName.empty() || isdigit(channelName[0]))
|
||||
{
|
||||
WorldPacket data(SMSG_CHANNEL_NOTIFY, 1 + channelName.size());
|
||||
data << uint8(CHAT_INVALID_NAME_NOTICE) << channelName;
|
||||
SendPacket(&data);
|
||||
return;
|
||||
}
|
||||
|
||||
if (ChannelMgr* cMgr = ChannelMgr::forTeam(GetPlayer()->GetTeam()))
|
||||
if (Channel* channel = cMgr->GetJoinChannel(channelId, channelName, zone))
|
||||
|
||||
Reference in New Issue
Block a user