TrinityCore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
ChannelPackets.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2008-2016 TrinityCore <http://www.trinitycore.org/>
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 ChannelPackets_h__
19 #define ChannelPackets_h__
20 
21 #include "Packet.h"
22 #include "Channel.h"
23 #include "ObjectGuid.h"
24 
25 namespace WorldPackets
26 {
27  namespace Channel
28  {
29  class ChannelListResponse final : public ServerPacket
30  {
31  public:
33  {
34  ChannelPlayer(ObjectGuid const& guid, uint32 virtualRealmAddress, uint8 flags) :
35  Guid(guid), VirtualRealmAddress(virtualRealmAddress), Flags(flags) { }
36 
40  };
41 
43 
44  WorldPacket const* Write() override;
45 
46  std::vector<ChannelPlayer> _Members;
47  std::string _Channel;
49  bool _Display = false;
50  };
51 
52  class ChannelNotify final : public ServerPacket
53  {
54  public:
56 
57  WorldPacket const* Write() override;
58 
59  std::string Sender;
62  uint8 Type = 0;
65  std::string _Channel;
70  };
71 
72  class ChannelNotifyJoined final : public ServerPacket
73  {
74  public:
76 
77  WorldPacket const* Write() override;
78 
79  std::string ChannelWelcomeMsg;
83  std::string _Channel;
84  };
85 
86  class ChannelNotifyLeft final : public ServerPacket
87  {
88  public:
90 
91  WorldPacket const* Write() override;
92 
93  std::string Channel;
95  bool Suspended = false;
96  };
97 
98  class UserlistAdd final : public ServerPacket
99  {
100  public:
102 
103  WorldPacket const* Write() override;
104 
109  std::string ChannelName;
110  };
111 
112  class UserlistRemove final : public ServerPacket
113  {
114  public:
116 
117  WorldPacket const* Write() override;
118 
122  std::string ChannelName;
123  };
124 
125  class UserlistUpdate final : public ServerPacket
126  {
127  public:
129 
130  WorldPacket const* Write() override;
131 
136  std::string ChannelName;
137  };
138 
139  class ChannelPlayerCommand final : public ClientPacket
140  {
141  public:
143  {
144  switch (GetOpcode())
145  {
146  default:
147  ABORT();
170  break;
171  }
172  }
173 
174  void Read() override;
175 
176  std::string ChannelName;
177  std::string Name;
178  };
179 
180  class JoinChannel final : public ClientPacket
181  {
182  public:
184 
185  void Read() override;
186 
187  std::string Password;
188  std::string ChannelName;
189  bool CreateVoiceSession = false;
191  bool Internal = false;
192  };
193 
194  class LeaveChannel final : public ClientPacket
195  {
196  public:
198 
199  void Read() override;
200 
202  std::string ChannelName;
203  };
204  }
205 }
206 
207 #endif // ChannelPackets_h__
WorldPacket const * Write() override
Definition: ChannelPackets.cpp:63
ChannelNotifyLeft()
Definition: ChannelPackets.h:89
JoinChannel(WorldPacket &&packet)
Definition: ChannelPackets.h:183
Definition: Opcodes.h:181
Definition: Opcodes.h:171
Definition: Opcodes.h:178
WorldPacket const * Write() override
Definition: ChannelPackets.cpp:38
Definition: ChannelPackets.h:125
std::string Channel
Channel Name.
Definition: ChannelPackets.h:93
UserlistUpdate()
Definition: ChannelPackets.h:128
std::string Sender
Definition: ChannelPackets.h:59
int32 ChatChannelId
Definition: ChannelPackets.h:190
ChannelNotifyJoined()
Definition: ChannelPackets.h:75
std::string ChannelName
Definition: ChannelPackets.h:122
uint32 ChannelID
Definition: ChannelPackets.h:121
uint32 TargetVirtualRealm
Definition: ChannelPackets.h:68
int32 ZoneChannelID
Definition: ChannelPackets.h:201
Definition: ChannelPackets.h:98
std::string ChannelName
Definition: ChannelPackets.h:136
ObjectGuid AddedUserGUID
Definition: ChannelPackets.h:105
ObjectGuid SenderGuid
Definition: ChannelPackets.h:60
Definition: ChannelPackets.h:52
int32 ChatChannelID
Definition: ChannelPackets.h:94
std::string Password
Definition: ChannelPackets.h:187
STL namespace.
ObjectGuid Guid
Player Guid.
Definition: ChannelPackets.h:37
Definition: Opcodes.h:173
int32 ChatChannelID
Definition: ChannelPackets.h:69
void Read() override
Definition: ChannelPackets.cpp:181
ObjectGuid RemovedUserGUID
Definition: ChannelPackets.h:119
Definition: Opcodes.h:192
Definition: Opcodes.h:185
std::string ChannelName
Definition: ChannelPackets.h:109
Definition: Opcodes.h:188
Definition: Opcodes.h:186
uint32 VirtualRealmAddress
Definition: ChannelPackets.h:38
std::string _Channel
Channel Name.
Definition: ChannelPackets.h:65
Definition: Channel.h:126
Definition: Opcodes.h:886
Definition: Opcodes.h:174
std::string Name
Definition: ChannelPackets.h:177
std::string ChannelName
Definition: ChannelPackets.h:176
bool Internal
Definition: ChannelPackets.h:191
void Read() override
Definition: ChannelPackets.cpp:121
ChannelPlayerCommand(WorldPacket &&packet)
Definition: ChannelPackets.h:142
ObjectGuid SenderAccountID
Definition: ChannelPackets.h:61
uint32 _ChannelFlags
Definition: ChannelPackets.h:48
WorldPacket const * Write() override
Definition: ChannelPackets.cpp:98
Definition: ChannelPackets.h:112
Definition: Opcodes.h:193
Definition: Packet.h:59
Definition: Channel.h:82
std::string _Channel
Channel Name.
Definition: ChannelPackets.h:83
uint8 UserFlags
Definition: ChannelPackets.h:107
Definition: Opcodes.h:176
Definition: ChannelPackets.h:29
Definition: Opcodes.h:190
Definition: Opcodes.h:885
Definition: Packet.h:46
Definition: ChannelPackets.h:72
Definition: Opcodes.h:1607
Definition: Opcodes.h:1608
std::string ChannelWelcomeMsg
Definition: ChannelPackets.h:79
void Read() override
Definition: ChannelPackets.cpp:170
uint32 _ChannelFlags
Definition: ChannelPackets.h:106
WorldPacket const * Write() override
Definition: ChannelPackets.cpp:20
int32_t int32
Definition: Define.h:146
OpcodeClient GetOpcode() const
Definition: Packet.h:72
uint32_t uint32
Definition: Define.h:150
Definition: ChannelPackets.h:139
bool _Display
Definition: ChannelPackets.h:49
int32 ChatChannelID
Definition: ChannelPackets.h:80
std::string ChannelName
Definition: ChannelPackets.h:202
uint32 _ChannelFlags
Definition: ChannelPackets.h:120
bool Suspended
User Leave - false, On Zone Change - true.
Definition: ChannelPackets.h:95
Definition: Opcodes.h:175
Definition: ChannelPackets.h:180
ChannelPlayer(ObjectGuid const &guid, uint32 virtualRealmAddress, uint8 flags)
Definition: ChannelPackets.h:34
Definition: Opcodes.h:184
Definition: BattlegroundMgr.h:57
Definition: ChannelPackets.h:194
UserlistRemove()
Definition: ChannelPackets.h:115
uint32 SenderVirtualRealm
Definition: ChannelPackets.h:66
UserlistAdd()
Definition: ChannelPackets.h:101
ObjectGuid TargetGuid
Definition: ChannelPackets.h:67
Definition: Opcodes.h:180
Definition: Opcodes.h:179
uint32 _ChannelFlags
Definition: ChannelPackets.h:133
Definition: Opcodes.h:191
WorldPacket const * Write() override
Definition: ChannelPackets.cpp:76
WorldPacket const * Write() override
Definition: ChannelPackets.cpp:86
Definition: Opcodes.h:187
int32 ChannelID
Definition: ChannelPackets.h:135
std::vector< ChannelPlayer > _Members
Definition: ChannelPackets.h:46
Definition: Opcodes.h:189
int32 InstanceID
Definition: ChannelPackets.h:81
Definition: Channel.h:115
#define ABORT
Definition: Errors.h:56
std::string ChannelName
Definition: ChannelPackets.h:188
Definition: Opcodes.h:884
uint8_t uint8
Definition: Define.h:152
uint8 NewFlags
Definition: ChannelPackets.h:64
uint32 _ChannelFlags
Definition: ChannelPackets.h:82
Definition: Opcodes.h:194
LeaveChannel(WorldPacket &&packet)
Definition: ChannelPackets.h:197
Definition: Opcodes.h:883
Definition: ObjectGuid.h:189
uint8 flags
Definition: DisableMgr.cpp:44
Definition: ChannelPackets.h:86
WorldPacket const * Write() override
Definition: ChannelPackets.cpp:109
Definition: Opcodes.h:183
Type
Type of JSON value.
Definition: rapidjson.h:642
Definition: Opcodes.h:182
uint8 UserFlags
Definition: ChannelPackets.h:134
uint8 OldFlags
Definition: ChannelPackets.h:63
Definition: WorldPacket.h:26
bool CreateVoiceSession
Definition: ChannelPackets.h:189
Definition: Opcodes.h:1606
Definition: Opcodes.h:172
ChannelListResponse()
Definition: ChannelPackets.h:42
std::string _Channel
Channel Name.
Definition: ChannelPackets.h:47
ChannelNotify()
Definition: ChannelPackets.h:55
int32 ChannelID
Definition: ChannelPackets.h:108
ObjectGuid UpdatedUserGUID
Definition: ChannelPackets.h:132
Definition: Opcodes.h:177