Core: Improve constant channel handling

- Implement area restrictions
  - Disable constant channels in arenas
  - Implement city requirement
- Implement global constant channels
- Fix some packets

--HG--
branch : trunk
This commit is contained in:
linencloth
2010-10-16 12:59:53 +02:00
parent 3bd1ee0665
commit ae213dd580
9 changed files with 122 additions and 53 deletions
@@ -27,7 +27,23 @@ void WorldSession::HandleJoinChannel(WorldPacket& recvPacket)
uint8 unknown1, unknown2;
std::string channelname, pass;
recvPacket >> channel_id >> unknown1 >> unknown2;
recvPacket >> channel_id;
if (channel_id)
{
ChatChannelsEntry const* channel = sChatChannelsStore.LookupEntry(channel_id);
if (!channel)
return;
AreaTableEntry const* current_zone = GetAreaEntryByAreaID(_player->GetZoneId());
if (!current_zone)
return;
if (!_player->CanJoinConstantChannelInZone(channel, current_zone))
return;
}
recvPacket >> unknown1 >> unknown2;
recvPacket >> channelname;
if (channelname.empty())