TrinityCore
DuelPackets.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 DuelPackets_h__
19#define DuelPackets_h__
20
21#include "Packet.h"
22#include "ObjectGuid.h"
23
24namespace WorldPackets
25{
26 namespace Duel
27 {
28 class CanDuel final : public ClientPacket
29 {
30 public:
31 CanDuel(WorldPacket&& packet) : ClientPacket(CMSG_CAN_DUEL, std::move(packet)) { }
32
33 void Read() override;
34
36 bool ToTheDeath = false;
37 };
38
39 class CanDuelResult final : public ServerPacket
40 {
41 public:
43
44 WorldPacket const* Write() override;
45
47 bool Result = false;
48 };
49
50 class DuelComplete final : public ServerPacket
51 {
52 public:
54
55 WorldPacket const* Write() override;
56
57 bool Started = false;
58 };
59
60 class DuelCountdown final : public ServerPacket
61 {
62 public:
64
65 WorldPacket const* Write() override;
66
68 };
69
70 class DuelInBounds final : public ServerPacket
71 {
72 public:
74
75 WorldPacket const* Write() override { return &_worldPacket; }
76 };
77
78 class DuelOutOfBounds final : public ServerPacket
79 {
80 public:
82
83 WorldPacket const* Write() override { return &_worldPacket; }
84 };
85
86 class DuelRequested final : public ServerPacket
87 {
88 public:
90
91 WorldPacket const* Write() override;
92
96 bool ToTheDeath = false;
97 };
98
100 {
101 public:
103
104 void Read() override;
105
107 bool Accepted = false;
108 bool Forfeited = false;
109 };
110
111 class DuelWinner final : public ServerPacket
112 {
113 public:
115
116 WorldPacket const* Write() override;
117
118 std::string BeatenName;
119 std::string WinnerName;
122 bool Fled = false;
123 };
124 }
125}
126
127#endif // DuelPackets_h__
uint32_t uint32
Definition: Define.h:142
WorldPacket const * Write() override
Definition: DuelPackets.cpp:26
CanDuel(WorldPacket &&packet)
Definition: DuelPackets.h:31
WorldPacket const * Write() override
Definition: DuelPackets.cpp:35
WorldPacket const * Write() override
Definition: DuelPackets.cpp:43
DuelCountdown(uint32 countdown)
Definition: DuelPackets.h:63
WorldPacket const * Write() override
Definition: DuelPackets.h:75
WorldPacket const * Write() override
Definition: DuelPackets.h:83
WorldPacket const * Write() override
Definition: DuelPackets.cpp:50
DuelResponse(WorldPacket &&packet)
Definition: DuelPackets.h:102
WorldPacket const * Write() override
Definition: DuelPackets.cpp:68
WorldPacket _worldPacket
Definition: Packet.h:43
@ CMSG_DUEL_RESPONSE
Definition: Opcodes.h:331
@ CMSG_CAN_DUEL
Definition: Opcodes.h:181
@ SMSG_DUEL_OUT_OF_BOUNDS
Definition: Opcodes.h:1219
@ SMSG_DUEL_WINNER
Definition: Opcodes.h:1221
@ SMSG_CAN_DUEL_RESULT
Definition: Opcodes.h:1079
@ SMSG_DUEL_IN_BOUNDS
Definition: Opcodes.h:1218
@ SMSG_DUEL_COUNTDOWN
Definition: Opcodes.h:1217
@ SMSG_DUEL_COMPLETE
Definition: Opcodes.h:1216
@ SMSG_DUEL_REQUESTED
Definition: Opcodes.h:1220
STL namespace.