1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
|
/*
* This file is part of the TrinityCore Project. See AUTHORS file for Copyright information
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation; either version 2 of the License, or (at your
* option) any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License along
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef TRINITYCORE_AUCTION_HOUSE_PACKETS_H
#define TRINITYCORE_AUCTION_HOUSE_PACKETS_H
#include "Packet.h"
#include "AddonPackets.h"
#include "DBCEnums.h"
#include "ItemPacketsCommon.h"
#include "ObjectGuid.h"
struct AuctionsBucketKey;
struct AuctionPosting;
enum class AuctionHouseBrowseMode : uint8;
enum class AuctionHouseFilterMask : uint32;
enum class AuctionHouseListType : uint8;
enum class AuctionHouseSortOrder : uint8;
namespace WorldPackets
{
namespace AuctionHouse
{
struct AuctionBucketKey
{
AuctionBucketKey() : ItemID(0), ItemLevel(0) { }
AuctionBucketKey(AuctionsBucketKey const& key) { *this = key; }
AuctionBucketKey& operator=(AuctionsBucketKey const& key);
uint32 ItemID = 0;
uint16 ItemLevel = 0;
Optional<uint16> BattlePetSpeciesID;
Optional<uint16> ItemSuffix;
};
struct AuctionListFilterSubClass
{
int32 ItemSubclass = 0;
uint64 InvTypeMask = 0;
};
struct AuctionListFilterClass
{
int32 ItemClass = 0;
Array<AuctionListFilterSubClass, 31> SubClassFilters;
};
struct AuctionSortDef
{
AuctionHouseSortOrder SortOrder = AuctionHouseSortOrder(0);
bool ReverseSort = false;
};
struct AuctionItemForSale
{
ObjectGuid Guid;
uint32 UseCount = 0;
};
struct AuctionFavoriteInfo
{
uint32 Order = 0;
uint32 ItemID = 0;
uint32 ItemLevel = 0;
uint32 BattlePetSpeciesID = 0;
uint32 SuffixItemNameDescriptionID = 0;
};
struct AuctionOwnerNotification
{
void Initialize(::AuctionPosting const* auction);
int32 AuctionID = 0;
uint64 BidAmount = 0;
Item::ItemInstance Item;
};
struct BucketInfo
{
AuctionBucketKey Key;
int32 TotalQuantity = 0;
int32 RequiredLevel = 0;
uint64 MinPrice = 0;
std::vector<int32> ItemModifiedAppearanceIDs;
Optional<uint8> MaxBattlePetQuality;
Optional<uint8> MaxBattlePetLevel;
Optional<uint8> BattlePetBreedID;
Optional<uint32> BattlePetLevelMask;
bool ContainsOwnerItem = false;
bool ContainsOnlyCollectedAppearances = false;
};
struct AuctionItem
{
Optional<Item::ItemInstance> Item;
int32 Count = 0;
int32 Charges = 0;
std::vector<Item::ItemEnchantData> Enchantments;
int32 Flags = 0;
int32 AuctionID = 0;
ObjectGuid Owner;
Optional<uint64> MinBid;
Optional<uint64> MinIncrement;
Optional<uint64> BuyoutPrice;
Optional<uint64> UnitPrice;
int32 DurationLeft = 0;
uint8 DeleteReason = 0;
bool CensorServerSideInfo = false;
bool CensorBidInfo = false;
ObjectGuid ItemGuid;
ObjectGuid OwnerAccountID;
uint32 EndTime = 0;
uint32 Unused1110 = 0;
Optional<ObjectGuid> Bidder;
Optional<uint64> BidAmount;
std::vector<Item::ItemGemData> Gems;
Optional<WorldPackets::AuctionHouse::AuctionBucketKey> AuctionBucketKey;
Optional<ObjectGuid> Creator;
};
struct AuctionBidderNotification
{
void Initialize(int32 auctionHouseId, ::AuctionPosting const* auction, ::Item const* item);
int32 AuctionHouseID = 0;
int32 AuctionID = 0;
ObjectGuid Bidder;
Item::ItemInstance Item;
};
class AuctionBrowseQuery final : public ClientPacket
{
public:
explicit AuctionBrowseQuery(WorldPacket&& packet) : ClientPacket(CMSG_AUCTION_BROWSE_QUERY, std::move(packet)) { }
void Read() override;
ObjectGuid Auctioneer;
uint32 Offset = 0;
uint8 MinLevel = 1;
uint8 MaxLevel = MAX_LEVEL;
uint8 Unused1007_1 = 0;
uint8 Unused1007_2 = 0;
AuctionHouseFilterMask Filters = AuctionHouseFilterMask(0);
std::vector<uint8> KnownPets; // size checked separately in Read()
int8 MaxPetLevel = 0;
uint32 Unused1026 = 0;
Optional<Addon::AddOnInfo> TaintedBy;
std::string Name;
Array<AuctionListFilterClass, 7> ItemClassFilters;
Array<AuctionSortDef, 2> Sorts;
};
class AuctionCancelCommoditiesPurchase final : public ClientPacket
{
public:
explicit AuctionCancelCommoditiesPurchase(WorldPacket&& packet) : ClientPacket(CMSG_AUCTION_CANCEL_COMMODITIES_PURCHASE, std::move(packet)) { }
void Read() override;
ObjectGuid Auctioneer;
Optional<Addon::AddOnInfo> TaintedBy;
};
class AuctionConfirmCommoditiesPurchase final : public ClientPacket
{
public:
explicit AuctionConfirmCommoditiesPurchase(WorldPacket&& packet) : ClientPacket(CMSG_AUCTION_CONFIRM_COMMODITIES_PURCHASE, std::move(packet)) { }
void Read() override;
ObjectGuid Auctioneer;
int32 ItemID = 0;
uint32 Quantity = 0;
Optional<Addon::AddOnInfo> TaintedBy;
};
class AuctionHelloRequest final : public ClientPacket
{
public:
explicit AuctionHelloRequest(WorldPacket&& packet) : ClientPacket(CMSG_AUCTION_HELLO_REQUEST, std::move(packet)) { }
void Read() override;
ObjectGuid Guid;
};
class AuctionListBiddedItems final : public ClientPacket
{
public:
explicit AuctionListBiddedItems(WorldPacket&& packet) : ClientPacket(CMSG_AUCTION_LIST_BIDDED_ITEMS, std::move(packet)) { }
void Read() override;
ObjectGuid Auctioneer;
uint32 Offset = 0;
Array<uint32, 100> AuctionIDs;
Array<AuctionSortDef, 2> Sorts;
Optional<Addon::AddOnInfo> TaintedBy;
};
class AuctionListBucketsByBucketKeys final : public ClientPacket
{
public:
explicit AuctionListBucketsByBucketKeys(WorldPacket&& packet) : ClientPacket(CMSG_AUCTION_LIST_BUCKETS_BY_BUCKET_KEYS, std::move(packet)) { }
void Read() override;
ObjectGuid Auctioneer;
Optional<Addon::AddOnInfo> TaintedBy;
Array<AuctionBucketKey, 100> BucketKeys;
Array<AuctionSortDef, 2> Sorts;
};
class AuctionListItemsByBucketKey final : public ClientPacket
{
public:
explicit AuctionListItemsByBucketKey(WorldPacket&& packet) : ClientPacket(CMSG_AUCTION_LIST_ITEMS_BY_BUCKET_KEY, std::move(packet)) { }
void Read() override;
ObjectGuid Auctioneer;
uint32 Offset = 0;
int8 Unknown830 = 0;
Optional<Addon::AddOnInfo> TaintedBy;
Array<AuctionSortDef, 2> Sorts;
AuctionBucketKey BucketKey;
};
class AuctionListItemsByItemID final : public ClientPacket
{
public:
explicit AuctionListItemsByItemID(WorldPacket&& packet) : ClientPacket(CMSG_AUCTION_LIST_ITEMS_BY_ITEM_ID, std::move(packet)) { }
void Read() override;
ObjectGuid Auctioneer;
int32 ItemID = 0;
int32 SuffixItemNameDescriptionID = 0;
uint32 Offset = 0;
Optional<Addon::AddOnInfo> TaintedBy;
Array<AuctionSortDef, 2> Sorts;
};
class AuctionListOwnedItems final : public ClientPacket
{
public:
explicit AuctionListOwnedItems(WorldPacket&& packet) : ClientPacket(CMSG_AUCTION_LIST_OWNED_ITEMS, std::move(packet)) { }
void Read() override;
ObjectGuid Auctioneer;
uint32 Offset = 0;
Optional<Addon::AddOnInfo> TaintedBy;
Array<AuctionSortDef, 2> Sorts;
};
class AuctionPlaceBid final : public ClientPacket
{
public:
explicit AuctionPlaceBid(WorldPacket&& packet) : ClientPacket(CMSG_AUCTION_PLACE_BID, std::move(packet)) { }
void Read() override;
ObjectGuid Auctioneer;
uint64 BidAmount = 0;
int32 AuctionID = 0;
Optional<Addon::AddOnInfo> TaintedBy;
};
class AuctionRemoveItem final : public ClientPacket
{
public:
explicit AuctionRemoveItem(WorldPacket&& packet) : ClientPacket(CMSG_AUCTION_REMOVE_ITEM, std::move(packet)) { }
void Read() override;
ObjectGuid Auctioneer;
int32 AuctionID = 0;
int32 ItemID = 0;
Optional<Addon::AddOnInfo> TaintedBy;
};
class AuctionReplicateItems final : public ClientPacket
{
public:
explicit AuctionReplicateItems(WorldPacket&& packet) : ClientPacket(CMSG_AUCTION_REPLICATE_ITEMS, std::move(packet)) { }
void Read() override;
ObjectGuid Auctioneer;
uint32 ChangeNumberGlobal = 0;
uint32 ChangeNumberCursor = 0;
uint32 ChangeNumberTombstone = 0;
uint32 Count = 0;
Optional<Addon::AddOnInfo> TaintedBy;
};
class AuctionSellCommodity final : public ClientPacket
{
public:
explicit AuctionSellCommodity(WorldPacket&& packet) : ClientPacket(CMSG_AUCTION_SELL_COMMODITY, std::move(packet)) { }
void Read() override;
ObjectGuid Auctioneer;
uint64 UnitPrice = 0;
uint32 RunTime = 0;
Optional<Addon::AddOnInfo> TaintedBy;
Array<AuctionItemForSale, 64> Items;
};
class AuctionSellItem final : public ClientPacket
{
public:
explicit AuctionSellItem(WorldPacket&& packet) : ClientPacket(CMSG_AUCTION_SELL_ITEM, std::move(packet)) { }
void Read() override;
uint64 BuyoutPrice = 0;
ObjectGuid Auctioneer;
uint64 MinBid = 0;
uint32 RunTime = 0;
Optional<Addon::AddOnInfo> TaintedBy;
Array<AuctionItemForSale, 1> Items;
};
class AuctionSetFavoriteItem final : public ClientPacket
{
public:
explicit AuctionSetFavoriteItem(WorldPacket&& packet) : ClientPacket(CMSG_AUCTION_SET_FAVORITE_ITEM, std::move(packet)) { }
void Read() override;
AuctionFavoriteInfo Item;
bool IsNotFavorite = true;
};
class AuctionGetCommodityQuote final : public ClientPacket
{
public:
explicit AuctionGetCommodityQuote(WorldPacket&& packet) : ClientPacket(CMSG_AUCTION_GET_COMMODITY_QUOTE, std::move(packet)) { }
void Read() override;
ObjectGuid Auctioneer;
int32 ItemID = 0;
uint32 Quantity = 0;
Optional<Addon::AddOnInfo> TaintedBy;
};
class AuctionClosedNotification final : public ServerPacket
{
public:
explicit AuctionClosedNotification() : ServerPacket(SMSG_AUCTION_CLOSED_NOTIFICATION, 45) { }
WorldPacket const* Write() override;
AuctionOwnerNotification Info;
float ProceedsMailDelay = 0.0f;
bool Sold = true;
};
class AuctionCommandResult final : public ServerPacket
{
public:
explicit AuctionCommandResult() : ServerPacket(SMSG_AUCTION_COMMAND_RESULT, 4 + 4 + 4 + 8 + 4 + 8 + 8 + 8) { }
WorldPacket const* Write() override;
int32 AuctionID = 0; ///< the id of the auction that triggered this notification
int32 Command = 0; ///< the type of action that triggered this notification. Possible values are @ref AuctionAction
int32 ErrorCode = 0; ///< the error code that was generated when trying to perform the action. Possible values are @ref AuctionError
int32 BagResult = 0; ///< the bid error. Possible values are @ref AuctionError
ObjectGuid Guid; ///< the GUID of the bidder for this auction.
uint64 MinIncrement = 0; ///< the sum of outbid is (1% of current bid) * 5, if the bid is too small, then this value is 1 copper.
uint64 Money = 0; ///< the amount of money that the player bid in copper
uint32 DesiredDelay = 0;
};
class AuctionGetCommodityQuoteResult final : public ServerPacket
{
public:
explicit AuctionGetCommodityQuoteResult() : ServerPacket(SMSG_AUCTION_GET_COMMODITY_QUOTE_RESULT, 1 + 8 + 4 + 4 + 4 + 4) { }
WorldPacket const* Write() override;
Optional<uint64> TotalPrice;
Optional<uint32> Quantity;
Optional<Duration<Milliseconds>> QuoteDuration;
int32 ItemID = 0;
uint32 DesiredDelay = 0;
};
class AuctionHelloResponse final : public ServerPacket
{
public:
explicit AuctionHelloResponse() : ServerPacket(SMSG_AUCTION_HELLO_RESPONSE, 1 + 16) { }
WorldPacket const* Write() override;
ObjectGuid Auctioneer;
uint32 PurchaseDeliveryDelay = 0;
uint32 CancelDeliveryDelay = 0;
int32 AuctionHouseID = 0;
bool OpenForBusiness = true;
};
class AuctionListBiddedItemsResult final : public ServerPacket
{
public:
explicit AuctionListBiddedItemsResult() : ServerPacket(SMSG_AUCTION_LIST_BIDDED_ITEMS_RESULT, 149) { }
WorldPacket const* Write() override;
std::vector<AuctionItem> Items;
uint32 DesiredDelay = 0;
bool HasMoreResults = false;
};
class AuctionListBucketsResult final : public ServerPacket
{
public:
explicit AuctionListBucketsResult() : ServerPacket(SMSG_AUCTION_LIST_BUCKETS_RESULT) { }
WorldPacket const* Write() override;
std::vector<BucketInfo> Buckets;
uint32 DesiredDelay = 0;
int32 Unknown830_0 = 0;
int32 Unknown830_1 = 0;
AuctionHouseBrowseMode BrowseMode = AuctionHouseBrowseMode(0);
bool HasMoreResults = false;
};
class AuctionFavoriteList final : public ServerPacket
{
public:
explicit AuctionFavoriteList() : ServerPacket(SMSG_AUCTION_FAVORITE_LIST, 4 + 4 + 20 * 100) { }
WorldPacket const* Write() override;
uint32 DesiredDelay = 0;
std::vector<AuctionFavoriteInfo> Items;
};
class AuctionListItemsResult final : public ServerPacket
{
public:
explicit AuctionListItemsResult() : ServerPacket(SMSG_AUCTION_LIST_ITEMS_RESULT, 150) { }
WorldPacket const* Write() override;
std::vector<AuctionItem> Items;
uint32 Unknown830 = 0;
uint32 TotalCount = 0;
uint32 DesiredDelay = 0;
AuctionHouseListType ListType = AuctionHouseListType(0);
bool HasMoreResults = false;
AuctionBucketKey BucketKey;
};
class AuctionListOwnedItemsResult final : public ServerPacket
{
public:
explicit AuctionListOwnedItemsResult() : ServerPacket(SMSG_AUCTION_LIST_OWNED_ITEMS_RESULT, 149) { }
WorldPacket const* Write() override;
std::vector<AuctionItem> Items;
std::vector<AuctionItem> SoldItems;
uint32 DesiredDelay = 0;
bool HasMoreResults = false;
};
class AuctionOutbidNotification final : public ServerPacket
{
public:
explicit AuctionOutbidNotification() : ServerPacket(SMSG_AUCTION_OUTBID_NOTIFICATION, 62) { }
WorldPacket const* Write() override;
AuctionBidderNotification Info;
uint64 BidAmount = 0;
uint64 MinIncrement = 0;
};
class AuctionOwnerBidNotification final : public ServerPacket
{
public:
explicit AuctionOwnerBidNotification() : ServerPacket(SMSG_AUCTION_OWNER_BID_NOTIFICATION, 62) { }
WorldPacket const* Write() override;
AuctionOwnerNotification Info;
ObjectGuid Bidder;
uint64 MinIncrement = 0;
};
class AuctionReplicateResponse final : public ServerPacket
{
public:
explicit AuctionReplicateResponse() : ServerPacket(SMSG_AUCTION_REPLICATE_RESPONSE, 165) { }
WorldPacket const* Write() override;
uint32 ChangeNumberCursor = 0;
uint32 ChangeNumberGlobal = 0;
uint32 DesiredDelay = 0;
uint32 ChangeNumberTombstone = 0;
uint32 Result = 0;
std::vector<AuctionItem> Items;
};
class AuctionWonNotification final : public ServerPacket
{
public:
explicit AuctionWonNotification() : ServerPacket(SMSG_AUCTION_WON_NOTIFICATION, 46) { }
WorldPacket const* Write() override;
AuctionBidderNotification Info;
};
}
}
#endif // TRINITYCORE_AUCTION_HOUSE_PACKETS_H
|