TrinityCore
BlackMarketPackets.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 "BlackMarketPackets.h"
19
21{
23}
24
26{
27 _worldPacket >> Guid;
28 _worldPacket >> LastUpdateID;
29}
30
32{
33 data << int32(blackMarketItem.MarketID);
34 data << int32(blackMarketItem.SellerNPC);
35 data << int32(blackMarketItem.Quantity);
36 data << uint64(blackMarketItem.MinBid);
37 data << uint64(blackMarketItem.MinIncrement);
38 data << uint64(blackMarketItem.CurrentBid);
39 data << int32(blackMarketItem.SecondsRemaining);
40 data << int32(blackMarketItem.NumBids);
41 data << blackMarketItem.Item;
42 data.WriteBit(blackMarketItem.HighBid);
43 data.FlushBits();
44
45 return data;
46}
47
49{
50 data >> blackMarketItem.MarketID;
51 data >> blackMarketItem.SellerNPC;
52 data >> blackMarketItem.Item;
53 data >> blackMarketItem.Quantity;
54 data >> blackMarketItem.MinBid;
55 data >> blackMarketItem.MinIncrement;
56 data >> blackMarketItem.CurrentBid;
57 data >> blackMarketItem.SecondsRemaining;
58 data >> blackMarketItem.NumBids;
59 blackMarketItem.HighBid = data.ReadBit();
60
61 return data;
62}
63
65{
66 _worldPacket << LastUpdateID;
67 _worldPacket << uint32(Items.size());
68
69 for (BlackMarketItem const& item : Items)
70 _worldPacket << item;
71
72 return &_worldPacket;
73}
74
76{
77 _worldPacket >> Guid;
78 _worldPacket >> MarketID;
79 _worldPacket >> BidAmount;
80 _worldPacket >> Item;
81}
82
84{
85 _worldPacket << int32(MarketID);
86 _worldPacket << int32(Result);
87 _worldPacket << Item;
88
89 return &_worldPacket;
90}
91
93{
94 _worldPacket << int32(MarketID);
95 _worldPacket << int32(RandomPropertiesID);
96 _worldPacket << Item;
97
98 return &_worldPacket;
99}
100
102{
103 _worldPacket << int32(MarketID);
104 _worldPacket << int32(RandomPropertiesID);
105 _worldPacket << Item;
106
107 return &_worldPacket;
108}
ByteBuffer & operator>>(ByteBuffer &data, WorldPackets::BlackMarket::BlackMarketItem &blackMarketItem)
int32_t int32
Definition: Define.h:138
uint64_t uint64
Definition: Define.h:141
uint32_t uint32
Definition: Define.h:142
bool WriteBit(bool bit)
Definition: ByteBuffer.h:175
void FlushBits()
Definition: ByteBuffer.h:155
bool ReadBit()
Definition: ByteBuffer.h:191
Definition: Item.h:170
WorldPacket _worldPacket
Definition: Packet.h:43
ByteBuffer & operator<<(ByteBuffer &data, Movement::MonsterSplineFilterKey const &monsterSplineFilterKey)