TrinityCore
Loading...
Searching...
No Matches
ChannelPackets.cpp
Go to the documentation of this file.
1/*
2 * This file is part of the TrinityCore Project. See AUTHORS file for Copyright information
3 *
4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License as published by the
6 * Free Software Foundation; either version 2 of the License, or (at your
7 * option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12 * more details.
13 *
14 * You should have received a copy of the GNU General Public License along
15 * with this program. If not, see <http://www.gnu.org/licenses/>.
16 */
17
18#include "ChannelPackets.h"
19#include "Channel.h"
20#include "Errors.h"
21
23{
27 _worldPacket << uint32(Members.size());
28
29 for (ChannelPlayer const& player : Members)
30 {
31 _worldPacket << player.Guid;
32 _worldPacket << uint8(player.Flags);
33 }
34
35 return &_worldPacket;
36}
37
39{
40 _worldPacket << uint8(Type);
41 _worldPacket << _Channel;
42
43 switch (Type)
44 {
57 _worldPacket << SenderGuid;
58 break;
60 _worldPacket << uint8(NewFlags);
61 _worldPacket << int32(ChatChannelID);
62 _worldPacket << int32(InstanceID);
63 break;
65 _worldPacket << int32(ChatChannelID);
66 _worldPacket << uint8(Suspended);
67 break;
73 _worldPacket << Sender;
74 break;
76 _worldPacket << SenderGuid;
77 _worldPacket << uint8(OldFlags);
78 _worldPacket << uint8(NewFlags);
79 break;
83 _worldPacket << TargetGuid;
84 _worldPacket << SenderGuid;
85 break;
86 default:
87 break;
88 }
89
90 return &_worldPacket;
91}
92
112
114{
115 _worldPacket >> ChannelName;
116}
117
139
141{
142 _worldPacket >> ChannelName;
143 _worldPacket >> Name;
144}
145
147{
148 _worldPacket >> ChannelName;
149 _worldPacket >> Password;
150}
151
153{
154 _worldPacket >> ChatChannelId;
155 _worldPacket >> CreateVoiceSession;
156 _worldPacket >> Internal;
157 _worldPacket >> ChannelName;
158 _worldPacket >> Password;
159}
160
162{
163 _worldPacket >> ZoneChannelID;
164 _worldPacket >> ChannelName;
165}
166
168{
169 _worldPacket << ChannelName;
170 _worldPacket << uint8(_ChannelFlags);
171 _worldPacket << uint32(MemberCount);
172
173 return &_worldPacket;
174}
@ CHAT_YOU_JOINED_NOTICE
Definition Channel.h:36
@ CHAT_MODERATION_OFF_NOTICE
Definition Channel.h:51
@ CHAT_PLAYER_UNBANNED_NOTICE
Definition Channel.h:56
@ CHAT_PLAYER_NOT_FOUND_NOTICE
Definition Channel.h:44
@ CHAT_PLAYER_NOT_BANNED_NOTICE
Definition Channel.h:57
@ CHAT_PLAYER_INVITED_NOTICE
Definition Channel.h:64
@ CHAT_PLAYER_KICKED_NOTICE
Definition Channel.h:53
@ CHAT_VOICE_OFF_NOTICE
Definition Channel.h:70
@ CHAT_MODE_CHANGE_NOTICE
Definition Channel.h:47
@ CHAT_ANNOUNCEMENTS_ON_NOTICE
Definition Channel.h:48
@ CHAT_JOINED_NOTICE
Definition Channel.h:33
@ CHAT_LEFT_NOTICE
Definition Channel.h:34
@ CHAT_PLAYER_BANNED_NOTICE
Definition Channel.h:55
@ CHAT_PLAYER_ALREADY_MEMBER_NOTICE
Definition Channel.h:58
@ CHAT_OWNER_CHANGED_NOTICE
Definition Channel.h:43
@ CHAT_ANNOUNCEMENTS_OFF_NOTICE
Definition Channel.h:49
@ CHAT_VOICE_ON_NOTICE
Definition Channel.h:69
@ CHAT_YOU_LEFT_NOTICE
Definition Channel.h:38
@ CHAT_CHANNEL_OWNER_NOTICE
Definition Channel.h:46
@ CHAT_PLAYER_INVITE_BANNED_NOTICE
Definition Channel.h:65
@ CHAT_INVITE_NOTICE
Definition Channel.h:59
@ CHAT_PASSWORD_CHANGED_NOTICE
Definition Channel.h:42
@ CHAT_MODERATION_ON_NOTICE
Definition Channel.h:50
uint8_t uint8
Definition Define.h:135
int32_t int32
Definition Define.h:129
uint32_t uint32
Definition Define.h:133
#define ABORT
Definition Errors.h:74
std::vector< ChannelPlayer > Members
WorldPacket const * Write() override
WorldPacket const * Write() override
WorldPacket const * Write() override
OpcodeClient GetOpcode() const
Definition Packet.h:67
WorldPacket _worldPacket
Definition Packet.h:42
@ CMSG_CHANNEL_UNSILENCE_ALL
Definition Opcodes.h:1004
@ CMSG_CHANNEL_BAN
Definition Opcodes.h:194
@ CMSG_CHANNEL_KICK
Definition Opcodes.h:193
@ CMSG_CHANNEL_SET_OWNER
Definition Opcodes.h:186
@ CMSG_CHANNEL_UNMUTE
Definition Opcodes.h:191
@ CMSG_CHANNEL_OWNER
Definition Opcodes.h:187
@ CMSG_CHANNEL_MUTE
Definition Opcodes.h:190
@ CMSG_CHANNEL_UNBAN
Definition Opcodes.h:195
@ CMSG_CHANNEL_LIST
Definition Opcodes.h:183
@ CMSG_SET_CHANNEL_WATCH
Definition Opcodes.h:1036
@ CMSG_CHANNEL_DISPLAY_LIST
Definition Opcodes.h:1007
@ CMSG_DECLINE_CHANNEL_INVITE
Definition Opcodes.h:1069
@ CMSG_CHANNEL_INVITE
Definition Opcodes.h:192
@ CMSG_CHANNEL_VOICE_OFF
Definition Opcodes.h:1012
@ CMSG_CHANNEL_SILENCE_ALL
Definition Opcodes.h:1002
@ CMSG_CHANNEL_VOICE_ON
Definition Opcodes.h:1011
@ CMSG_CHANNEL_ANNOUNCEMENTS
Definition Opcodes.h:196
@ CMSG_CHANNEL_UNMODERATOR
Definition Opcodes.h:189
@ CMSG_CHANNEL_MODERATOR
Definition Opcodes.h:188
@ CMSG_GET_CHANNEL_MEMBER_COUNT
Definition Opcodes.h:1009
STL namespace.