Core/Channel: properly notify client about invalid channel names

Closes #16190
This commit is contained in:
ariel-
2018-02-05 13:45:52 -03:00
committed by Aokromes
parent 6dc6cc7608
commit afed7f0425
2 changed files with 8 additions and 5 deletions

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"

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))