TrinityCore
TaxiPackets.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 "TaxiPackets.h"
19
21{
23}
24
26{
27 _worldPacket << Unit;
28 _worldPacket.WriteBits(Status, 2);
29 _worldPacket.FlushBits();
30
31 return &_worldPacket;
32}
33
35{
36 _worldPacket.WriteBit(WindowInfo.has_value());
37 _worldPacket.FlushBits();
38
39 _worldPacket << uint32(CanLandNodes.size() / 8); // client reads this in uint64 blocks, size is ensured to be divisible by 8 in TaxiMask constructor
40 _worldPacket << uint32(CanUseNodes.size() / 8); // client reads this in uint64 blocks, size is ensured to be divisible by 8 in TaxiMask constructor
41
42 if (WindowInfo.has_value())
43 {
44 _worldPacket << WindowInfo->UnitGUID;
45 _worldPacket << uint32(WindowInfo->CurrentNode);
46 }
47
48 _worldPacket.append(CanLandNodes.data(), CanLandNodes.size());
49 _worldPacket.append(CanUseNodes.data(), CanUseNodes.size());
50
51 return &_worldPacket;
52}
53
55{
56 _worldPacket >> Unit;
57}
58
60{
61 _worldPacket >> Unit;
62}
63
65{
66 _worldPacket >> Vendor;
67 _worldPacket >> Node;
68 _worldPacket >> GroundMountID;
69 _worldPacket >> FlyingMountID;
70}
71
73{
74 _worldPacket.WriteBits(Reply, 4);
75 _worldPacket.FlushBits();
76
77 return &_worldPacket;
78}
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
Definition: Unit.h:627
WorldPacket _worldPacket
Definition: Packet.h:43
WorldPacket const * Write() override
Definition: TaxiPackets.cpp:72
WorldPacket const * Write() override
Definition: TaxiPackets.cpp:34
WorldPacket const * Write() override
Definition: TaxiPackets.cpp:25