TrinityCore
DuelPackets.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 "DuelPackets.h"
19
21{
24}
25
27{
28 _worldPacket << TargetGUID;
29 _worldPacket.WriteBit(Result);
30 _worldPacket.FlushBits();
31
32 return &_worldPacket;
33}
34
36{
37 _worldPacket.WriteBit(Started);
38 _worldPacket.FlushBits();
39
40 return &_worldPacket;
41}
42
44{
45 _worldPacket << uint32(Countdown);
46
47 return &_worldPacket;
48}
49
51{
52 _worldPacket << ArbiterGUID;
53 _worldPacket << RequestedByGUID;
54 _worldPacket << RequestedByWowAccount;
55 _worldPacket.WriteBit(ToTheDeath);
56 _worldPacket.FlushBits();
57
58 return &_worldPacket;
59}
60
62{
63 _worldPacket >> ArbiterGUID;
64 Accepted = _worldPacket.ReadBit();
65 Forfeited = _worldPacket.ReadBit();
66}
67
69{
70 _worldPacket.WriteBits(BeatenName.size(), 6);
71 _worldPacket.WriteBits(WinnerName.size(), 6);
72 _worldPacket.WriteBit(Fled);
73 _worldPacket << uint32(BeatenVirtualRealmAddress);
74 _worldPacket << uint32(WinnerVirtualRealmAddress);
75 _worldPacket.WriteString(BeatenName);
76 _worldPacket.WriteString(WinnerName);
77
78 return &_worldPacket;
79}
uint32_t uint32
Definition: Define.h:142
bool WriteBit(bool bit)
Definition: ByteBuffer.h:175
void WriteBits(std::size_t value, int32 bits)
Definition: ByteBuffer.h:203
bool ReadBit()
Definition: ByteBuffer.h:191
WorldPacket const * Write() override
Definition: DuelPackets.cpp:26
WorldPacket const * Write() override
Definition: DuelPackets.cpp:35
WorldPacket const * Write() override
Definition: DuelPackets.cpp:43
WorldPacket const * Write() override
Definition: DuelPackets.cpp:50
WorldPacket const * Write() override
Definition: DuelPackets.cpp:68
WorldPacket _worldPacket
Definition: Packet.h:43