Core/Channel: properly notify client about invalid channel names

Closes #16190
This commit is contained in:
ariel- authored and Aokromes committed 2018-02-10 11:49:18 +01:00
1 parent 6dc6cc7608
commit afed7f0425
2 files changed
+8 -5

No files matched your search

+2 -1
View File
@@ -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"
+6 -4
View File
@@ -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))