TrinityCore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
BattlenetPackets.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 BattlenetPackets_h__
19 #define BattlenetPackets_h__
20 
21 #include "Packet.h"
22 #include "MessageBuffer.h"
23 #include "BattlenetRpcErrorCodes.h"
24 
25 namespace WorldPackets
26 {
27  namespace Battlenet
28  {
29  struct MethodCall
30  {
31  uint64 Type = 0;
34 
35  uint32 GetServiceHash() const { return uint32(Type >> 32); }
36  uint32 GetMethodId() const { return uint32(Type & 0xFFFFFFFF); }
37  };
38 
39  class Notification final : public ServerPacket
40  {
41  public:
43 
44  WorldPacket const* Write() override;
45 
48  };
49 
50  class Response final : public ServerPacket
51  {
52  public:
53  Response() : ServerPacket(SMSG_BATTLENET_RESPONSE, 4 + 8 + 8 + 4 + 4) { }
54 
55  WorldPacket const* Write() override;
56 
60  };
61 
62  class SetSessionState final : public ServerPacket
63  {
64  public:
66 
67  WorldPacket const* Write() override;
68 
69  uint8 State = 0;
70  };
71 
72  class RealmListTicket final : public ServerPacket
73  {
74  public:
76 
77  WorldPacket const* Write() override;
78 
80  bool Allow;
82  };
83 
84  class Request final : public ClientPacket
85  {
86  public:
87  Request(WorldPacket&& packet) : ClientPacket(CMSG_BATTLENET_REQUEST, std::move(packet)) { }
88 
89  void Read() override;
90 
93  };
94 
95  class RequestRealmListTicket final : public ClientPacket
96  {
97  public:
99 
100  void Read() override;
101 
103  std::array<uint8, 32> Secret;
104  };
105  }
106 }
107 
108 #endif // BattlenetPackets_h__
RequestRealmListTicket(WorldPacket &&packet)
Definition: BattlenetPackets.h:98
Response()
Definition: BattlenetPackets.h:53
WorldPacket const * Write() override
Definition: BattlenetPackets.cpp:45
uint32 GetMethodId() const
Definition: BattlenetPackets.h:36
Definition: BattlenetPackets.h:39
Definition: ByteBuffer.h:70
bool Allow
Definition: BattlenetPackets.h:80
Definition: method_options.pb.h:28
WorldPacket const * Write() override
Definition: BattlenetPackets.cpp:63
Definition: Opcodes.h:796
STL namespace.
uint8 State
Definition: BattlenetPackets.h:69
MethodCall Method
Definition: BattlenetPackets.h:58
Definition: BattlenetPackets.h:29
Notification()
Definition: BattlenetPackets.h:42
uint32 Token
Definition: BattlenetPackets.h:102
uint32 Token
Definition: BattlenetPackets.h:33
Definition: Packet.h:59
MethodCall Method
Definition: BattlenetPackets.h:46
void Read() override
Definition: BattlenetPackets.cpp:73
Definition: BattlenetPackets.h:62
Definition: BattlenetPackets.h:84
std::array< uint8, 32 > Secret
Definition: BattlenetPackets.h:103
Definition: Packet.h:46
Definition: BattlenetPackets.h:95
Definition: Opcodes.h:794
RealmListTicket()
Definition: BattlenetPackets.h:75
uint32_t uint32
Definition: Define.h:150
uint64_t uint64
Definition: Define.h:149
BattlenetRpcErrorCode BnetStatus
Definition: BattlenetPackets.h:57
Definition: Opcodes.h:797
Definition: BattlenetPackets.h:50
MethodCall Method
Definition: BattlenetPackets.h:91
Definition: BattlegroundMgr.h:57
ByteBuffer Data
Definition: BattlenetPackets.h:47
Definition: BattlenetRpcErrorCodes.h:25
BattlenetRpcErrorCode
Definition: BattlenetRpcErrorCodes.h:23
void Read() override
Definition: BattlenetPackets.cpp:85
Definition: Opcodes.h:91
uint64 ObjectId
Definition: BattlenetPackets.h:32
Definition: Opcodes.h:795
ByteBuffer Data
Definition: BattlenetPackets.h:59
Request(WorldPacket &&packet)
Definition: BattlenetPackets.h:87
ByteBuffer Ticket
Definition: BattlenetPackets.h:81
uint8_t uint8
Definition: Define.h:152
Definition: BattlenetPackets.h:72
uint32 Token
Definition: BattlenetPackets.h:79
MessageBuffer Data
Definition: BattlenetPackets.h:92
uint32_t uint32
Definition: g3dmath.h:168
SetSessionState()
Definition: BattlenetPackets.h:65
Type
Type of JSON value.
Definition: rapidjson.h:642
WorldPacket const * Write() override
Definition: BattlenetPackets.cpp:36
WorldPacket const * Write() override
Definition: BattlenetPackets.cpp:55
Definition: WorldPacket.h:26
Definition: MessageBuffer.h:24
uint32 GetServiceHash() const
Definition: BattlenetPackets.h:35