TrinityCore
Loading...
Searching...
No Matches
ChannelPackets.h
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#ifndef TRINITYCORE_CHANNEL_PACKETS_H
19#define TRINITYCORE_CHANNEL_PACKETS_H
20
21#include "Packet.h"
22#include "ObjectGuid.h"
23
24namespace WorldPackets
25{
26 namespace Channel
27 {
28 class ChannelListResponse final : public ServerPacket
29 {
30 public:
32 {
33 ChannelPlayer(ObjectGuid const& guid, uint32 virtualRealmAddress, uint8 flags) :
34 Guid(guid), VirtualRealmAddress(virtualRealmAddress), Flags(flags) { }
35
39 };
40
42
43 WorldPacket const* Write() override;
44
45 std::vector<ChannelPlayer> _Members;
46 std::string _Channel;
48 bool _Display = false;
49 };
50
52 {
53 public:
55
56 WorldPacket const* Write() override;
57
58 std::string Sender;
61 uint8 Type = 0;
62 uint8 OldFlags = 0;
63 uint8 NewFlags = 0;
64 std::string _Channel;
65 uint32 SenderVirtualRealm = 0;
67 uint32 TargetVirtualRealm = 0;
68 int32 ChatChannelID = 0;
69 };
70
86
87 class ChannelNotifyLeft final : public ServerPacket
88 {
89 public:
91
92 WorldPacket const* Write() override;
93
94 std::string Channel;
96 bool Suspended = false;
97 };
98
99 class UserlistAdd final : public ServerPacket
100 {
101 public:
103
104 WorldPacket const* Write() override;
105
110 std::string ChannelName;
111 };
112
113 class UserlistRemove final : public ServerPacket
114 {
115 public:
117
118 WorldPacket const* Write() override;
119
123 std::string ChannelName;
124 };
125
126 class UserlistUpdate final : public ServerPacket
127 {
128 public:
130
131 WorldPacket const* Write() override;
132
137 std::string ChannelName;
138 };
139
140 class ChannelCommand final : public ClientPacket
141 {
142 public:
143 explicit ChannelCommand(WorldPacket&& packet);
144
145 void Read() override;
146
147 std::string ChannelName;
148 };
149
151 {
152 public:
153 explicit ChannelPlayerCommand(WorldPacket&& packet);
154
155 void Read() override;
156
157 std::string ChannelName;
158 std::string Name;
159 };
160
161 class ChannelPassword final : public ClientPacket
162 {
163 public:
165
166 void Read() override;
167
168 std::string ChannelName;
169 std::string Password;
170 };
171
172 class JoinChannel final : public ClientPacket
173 {
174 public:
175 explicit JoinChannel(WorldPacket&& packet) : ClientPacket(CMSG_CHAT_JOIN_CHANNEL, std::move(packet)) { }
176
177 void Read() override;
178
179 std::string Password;
180 std::string ChannelName;
181 bool CreateVoiceSession = false;
183 bool Internal = false;
184 };
185
186 class LeaveChannel final : public ClientPacket
187 {
188 public:
189 explicit LeaveChannel(WorldPacket&& packet) : ClientPacket(CMSG_CHAT_LEAVE_CHANNEL, std::move(packet)) { }
190
191 void Read() override;
192
194 std::string ChannelName;
195 };
196 }
197}
198
199#endif // TRINITYCORE_CHANNEL_PACKETS_H
#define TC_GAME_API
Definition Define.h:129
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
uint16 flags
@ SMSG_CHANNEL_LIST
Definition Opcodes.h:1297
@ SMSG_USERLIST_REMOVE
Definition Opcodes.h:2433
@ SMSG_CHANNEL_NOTIFY
Definition Opcodes.h:1298
@ SMSG_USERLIST_UPDATE
Definition Opcodes.h:2434
@ SMSG_CHANNEL_NOTIFY_JOINED
Definition Opcodes.h:1299
@ SMSG_USERLIST_ADD
Definition Opcodes.h:2432
@ SMSG_CHANNEL_NOTIFY_LEFT
Definition Opcodes.h:1300
@ CMSG_CHAT_CHANNEL_PASSWORD
Definition Opcodes.h:205
@ CMSG_CHAT_LEAVE_CHANNEL
Definition Opcodes.h:213
@ CMSG_CHAT_JOIN_CHANNEL
Definition Opcodes.h:212
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
STL namespace.
ChannelPlayer(ObjectGuid const &guid, uint32 virtualRealmAddress, uint8 flags)