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#include "PacketOperators.h"
22
24{
26{
27 _worldPacket << Bits<1>(_Display);
28 _worldPacket << SizedString::BitsSize<7>(_Channel);
30 _worldPacket << Size<uint32>(_Members);
32
33 for (ChannelPlayer const& player : _Members)
34 {
35 _worldPacket << player.Guid;
36 _worldPacket << uint32(player.VirtualRealmAddress);
37 _worldPacket << uint8(player.Flags);
38 }
39
40 return &_worldPacket;
41}
42
44{
45 _worldPacket << Bits<6>(Type);
46 _worldPacket << SizedString::BitsSize<7>(_Channel);
47 _worldPacket << SizedString::BitsSize<6>(Sender);
48
55
57 {
60 }
61
64
65 return &_worldPacket;
66}
67
69{
70 _worldPacket << SizedString::BitsSize<7>(_Channel);
71 _worldPacket << SizedString::BitsSize<11>(ChannelWelcomeMsg);
79
80 return &_worldPacket;
81}
82
84{
85 _worldPacket << SizedString::BitsSize<7>(Channel);
86 _worldPacket << Bits<1>(Suspended);
89
90 return &_worldPacket;
91}
92
94{
99 _worldPacket << SizedString::BitsSize<7>(ChannelName);
101
103
104 return &_worldPacket;
105}
106
108{
112 _worldPacket << SizedString::BitsSize<7>(ChannelName);
114
116
117 return &_worldPacket;
118}
119
121{
126 _worldPacket << SizedString::BitsSize<7>(ChannelName);
128
130
131 return &_worldPacket;
132}
133
135{
136 switch (packet.GetOpcode())
137 {
143 break;
144 default:
145 ABORT();
146 break;
147 }
148}
149
151{
152 _worldPacket >> SizedString::BitsSize<7>(ChannelName);
153
155}
156
176
178{
179 _worldPacket >> SizedString::BitsSize<7>(ChannelName);
180 _worldPacket >> SizedString::BitsSize<9>(Name);
181
184}
185
187{
188 _worldPacket >> SizedString::BitsSize<7>(ChannelName);
189 _worldPacket >> SizedString::BitsSize<7>(Password);
190
193}
194
196{
199 _worldPacket >> Bits<1>(Internal);
200 _worldPacket >> SizedString::BitsSize<7>(ChannelName);
201 _worldPacket >> SizedString::BitsSize<7>(Password);
202
205}
206
208{
210 _worldPacket >> SizedString::BitsSize<7>(ChannelName);
212}
213}
@ CHAT_MODE_CHANGE_NOTICE
Definition Channel.h:55
uint8_t uint8
Definition Define.h:156
int32_t int32
Definition Define.h:150
uint64_t uint64
Definition Define.h:153
uint32_t uint32
Definition Define.h:154
#define ABORT
Definition Errors.h:87
@ CMSG_CHAT_CHANNEL_UNBAN
Definition Opcodes.h:208
@ CMSG_CHAT_CHANNEL_SILENCE_ALL
Definition Opcodes.h:207
@ CMSG_CHAT_CHANNEL_DISPLAY_LIST
Definition Opcodes.h:198
@ CMSG_CHAT_CHANNEL_SET_OWNER
Definition Opcodes.h:206
@ CMSG_CHAT_CHANNEL_MODERATOR
Definition Opcodes.h:203
@ CMSG_CHAT_CHANNEL_BAN
Definition Opcodes.h:196
@ CMSG_CHAT_CHANNEL_DECLINE_INVITE
Definition Opcodes.h:197
@ CMSG_CHAT_CHANNEL_INVITE
Definition Opcodes.h:199
@ CMSG_CHAT_CHANNEL_UNMODERATOR
Definition Opcodes.h:209
@ CMSG_CHAT_CHANNEL_KICK
Definition Opcodes.h:200
@ CMSG_CHAT_CHANNEL_LIST
Definition Opcodes.h:201
@ CMSG_CHAT_CHANNEL_OWNER
Definition Opcodes.h:204
@ CMSG_CHAT_CHANNEL_UNSILENCE_ALL
Definition Opcodes.h:210
@ CMSG_CHAT_CHANNEL_ANNOUNCEMENTS
Definition Opcodes.h:195
void FlushBits()
Definition ByteBuffer.h:141
std::vector< ChannelPlayer > _Members
WorldPacket const * Write() override
WorldPacket const * Write() override
WorldPacket const * Write() override
bool Suspended
User Leave - false, On Zone Change - true.
std::string _Channel
Channel Name.
WorldPacket const * Write() override
WorldPacket const * Write() override
WorldPacket const * Write() override
WorldPacket const * Write() override
OpcodeClient GetOpcode() const
Definition Packet.h:68
WorldPacket _worldPacket
Definition Packet.h:43
DataWriter< Container > Data(Container const &value)
STL namespace.