TrinityCore
Loading...
Searching...
No Matches
ReputationPackets.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 "ReputationPackets.h"
19#include "PacketOperators.h"
20
22{
23ByteBuffer& operator<<(ByteBuffer& data, FactionData const& factionData)
24{
25 data << int32(factionData.FactionID);
26 data << uint16(factionData.Flags);
27 data << int32(factionData.Standing);
28
29 return data;
30}
31
32ByteBuffer& operator<<(ByteBuffer& data, FactionBonusData const& factionBonusData)
33{
34 data << int32(factionBonusData.FactionID);
35 data << Bits<1>(factionBonusData.FactionHasBonus);
36 data.FlushBits();
37
38 return data;
39}
40}
41
43{
44 _worldPacket << Size<uint32>(Factions);
45 _worldPacket << Size<uint32>(Bonuses);
46
47 for (FactionData const& faction : Factions)
48 _worldPacket << faction;
49
50 for (FactionBonusData const& bonus : Bonuses)
51 _worldPacket << bonus;
52
53 return &_worldPacket;
54}
55
57{
58 data << int32(factionStanding.Index);
59 data << int32(factionStanding.Standing);
60 data << int32(factionStanding.FactionID);
61
62 return data;
63}
64
66{
67 _worldPacket << float(BonusFromAchievementSystem);
68 _worldPacket << Size<uint32>(Faction);
69 for (FactionStandingData const& factionStanding : Faction)
70 _worldPacket << factionStanding;
71
72 _worldPacket << Bits<1>(ShowVisual);
73 _worldPacket.FlushBits();
74
75 return &_worldPacket;
76}
int32_t int32
Definition Define.h:150
uint16_t uint16
Definition Define.h:155
void FlushBits()
Definition ByteBuffer.h:141
WorldPacket _worldPacket
Definition Packet.h:43
std::vector< FactionBonusData > Bonuses
ByteBuffer & operator<<(ByteBuffer &data, FactionData const &factionData)