45 TC_LOG_DEBUG(
"network",
"WORLD: HandleAuctionHelloOpcode - Unit ({}) not found or you can't interact with him.", hello.
Guid.
ToString());
88 auctionCommandResult.
Guid = ObjectGuid::Create<HighGuid::Player>(auction->
bidder);
91 auctionCommandResult.
Money = auction->
bid;
102 data <<
uint32(auctionId);
106 data <<
uint32(itemEntry);
128 data <<
uint32(auctionId);
129 data <<
uint32(itemEntry);
130 data <<
uint32(randomPropertyId);
138 uint32 itemsCount, etime, bid, buyout;
139 recvData >> auctioneer;
140 recvData >> itemsCount;
144 memset(count, 0,
sizeof(count));
153 for (
uint32 i = 0; i < itemsCount; ++i)
155 recvData >> itemGUIDs[i];
156 recvData >> count[i];
158 if (!itemGUIDs[i] || !count[i] || count[i] > 1000)
182 TC_LOG_DEBUG(
"network",
"WORLD: HandleAuctionSellItem - Unit ({}) not found or you can't interact with him.", auctioneer.
ToString());
187 if (!auctionHouseEntry)
189 TC_LOG_DEBUG(
"network",
"WORLD: HandleAuctionSellItem - Unit ({}) has wrong faction.", auctioneer.
ToString());
213 for (
uint32 i = 0; i < itemsCount; ++i)
235 finalCount += count[i];
245 for (
uint32 i = 0; i < itemsCount - 1; ++i)
247 for (
uint32 j = i + 1; j < itemsCount; ++j)
249 if (itemGUIDs[i] == itemGUIDs[j])
257 for (
uint32 i = 0; i < itemsCount; ++i)
259 Item* item = items[i];
268 Item* item = items[0];
273 uint32 deposit =
sAuctionMgr->GetAuctionDeposit(auctionHouseEntry, etime, item, finalCount);
309 if (itemsCount == 1 && item->
GetCount() == count[0])
313 sLog->OutCommand(
GetAccountId(),
"GM {} (Account: {}) create auction: {} (Entry: {} Count: {})",
332 TC_LOG_INFO(
"network",
"CMSG_AUCTION_SELL_ITEM: {} {} is selling item {} {} to auctioneer {} with count {} with initial bid {} with buyout {} and with time {} (in sec) in auctionhouse {}",
364 TC_LOG_ERROR(
"network",
"CMSG_AUCTION_SELL_ITEM: Could not create clone of item {}", item->
GetEntry());
372 sLog->OutCommand(
GetAccountId(),
"GM {} (Account: {}) create auction: {} (Entry: {} Count: {})",
391 TC_LOG_INFO(
"network",
"CMSG_AUCTION_SELL_ITEM: {} {} is selling item {} {} to auctioneer {} with count {} with initial bid {} with buyout {} and with time {} (in sec) in auctionhouse {}",
404 for (
uint32 j = 0; j < itemsCount; ++j)
406 Item* item2 = items[j];
447 TC_LOG_DEBUG(
"network",
"WORLD: Received CMSG_AUCTION_PLACE_BID");
452 recvData >> auctioneer;
453 recvData >> auctionId >> price;
455 if (!auctionId || !price)
461 TC_LOG_DEBUG(
"network",
"WORLD: HandleAuctionPlaceBid - {} not found or you can't interact with him.", auctioneer.
ToString());
482 ObjectGuid ownerGuid = ObjectGuid::Create<HighGuid::Player>(auction->
owner);
492 if (price <= auction->bid || price < auction->startbid)
496 if ((price < auction->buyout || auction->
buyout == 0) &&
513 if (price < auction->buyout || auction->
buyout == 0)
530 auction->
bid = price;
578 sAuctionMgr->SendAuctionSalePendingMail(auction, trans);
579 sAuctionMgr->SendAuctionSuccessfulMail(auction, trans);
596 TC_LOG_DEBUG(
"network",
"WORLD: Received CMSG_AUCTION_REMOVE_ITEM");
600 recvData >> auctioneer;
601 recvData >> auctionId;
606 TC_LOG_DEBUG(
"network",
"WORLD: HandleAuctionRemoveItem - {} not found or you can't interact with him.", auctioneer.
ToString());
630 sAuctionMgr->SendAuctionCancelledToBidderMail(auction, trans, pItem);
650 TC_LOG_ERROR(
"entities.player.cheat",
"CHEATER : {} tried to cancel auction (id: {}) of another player or auction is NULL", player->
GetGUID().
ToString(), auctionId);
670 TC_LOG_DEBUG(
"network",
"WORLD: Received CMSG_AUCTION_LIST_BIDDER_ITEMS");
677 recvData >> listfrom;
678 recvData >> outbiddedCount;
679 if (recvData.
size() != (16 + outbiddedCount * 4))
681 TC_LOG_ERROR(
"network",
"Client sent bad opcode!!! with count: {} and size : {} (must be: {})", outbiddedCount, (
unsigned long)recvData.
size(), (16 + outbiddedCount * 4));
688 TC_LOG_DEBUG(
"network",
"WORLD: HandleAuctionListBidderItems - {} not found or you can't interact with him.", guid.
ToString());
704 while (outbiddedCount > 0)
707 uint32 outbiddedAuctionId;
708 recvData >> outbiddedAuctionId;
727 TC_LOG_DEBUG(
"network",
"WORLD: Received CMSG_AUCTION_LIST_OWNER_ITEMS");
733 recvData >> listfrom;
738 TC_LOG_DEBUG(
"network",
"WORLD: HandleAuctionListOwnerItems - {} not found or you can't interact with him.", guid.
ToString());
756 data <<
uint32(totalcount);
764 TC_LOG_DEBUG(
"network",
"WORLD: Received CMSG_AUCTION_LIST_ITEMS");
766 std::string searchedname;
767 uint8 levelmin, levelmax, usable, getAll;
768 uint32 listfrom, auctionSlotID, auctionMainCategory, auctionSubCategory, quality;
772 recvData >> listfrom;
773 recvData >> searchedname;
775 recvData >> levelmin >> levelmax;
776 recvData >> auctionSlotID >> auctionMainCategory >> auctionSubCategory;
777 recvData >> quality >> usable;
784 for (
uint8 i = 0; i < unkCnt; i++)
793 TC_LOG_DEBUG(
"network",
"WORLD: HandleAuctionListItems - {} not found or you can't interact with him.", guid.
ToString());
803 TC_LOG_DEBUG(
"auctionHouse",
"Auctionhouse search ({}) list from: {}, searchedname: {}, levelmin: {}, levelmax: {}, auctionSlotID: {}, auctionMainCategory: {}, auctionSubCategory: {}, quality: {}, usable: {}",
804 guid.
ToString(), listfrom, searchedname, levelmin, levelmax, auctionSlotID, auctionMainCategory, auctionSubCategory, quality, usable);
812 std::wstring wsearchedname;
819 wsearchedname, listfrom, levelmin, levelmax, usable,
820 auctionSlotID, auctionMainCategory, auctionSubCategory, quality,
824 data <<
uint32(totalcount);
831 TC_LOG_DEBUG(
"network",
"WORLD: Received CMSG_AUCTION_LIST_PENDING_SALES");
@ AUCTION_ENTRY_FLAG_NONE
@ AUCTION_ENTRY_FLAG_GM_LOG_BUYER
@ ERR_AUCTION_NOT_ENOUGHT_MONEY
@ ERR_AUCTION_ITEM_NOT_FOUND
@ ERR_AUCTION_DATABASE_ERROR
#define MAX_AUCTION_ITEMS
@ CHAR_INS_AUCTION_BIDDERS
@ ACHIEVEMENT_CRITERIA_TYPE_CREATE_AUCTION
@ ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_AUCTION_BID
SQLTransaction< CharacterDatabaseConnection > CharacterDatabaseTransaction
DatabaseWorkerPool< CharacterDatabaseConnection > CharacterDatabase
Accessor to the character database.
#define TC_LOG_DEBUG(filterType__,...)
#define TC_LOG_ERROR(filterType__,...)
#define TC_LOG_INFO(filterType__,...)
@ MAIL_CHECK_MASK_COPIED
This mail was copied. Do not allow making a copy of items in mail.
uint32 const MAX_MONEY_AMOUNT
@ UNIT_NPC_FLAG_AUCTIONEER
void wstrToLower(std::wstring &str)
bool Utf8toWStr(char const *utf8str, size_t csize, wchar_t *wstr, size_t &wsize)
constexpr std::underlying_type< E >::type AsUnderlyingType(E enumValue)
static AuctionHouseEntry const * GetAuctionHouseEntry(uint32 factionTemplateId)
void BuildListBidderItems(WorldPacket &data, Player *player, uint32 &count, uint32 &totalcount)
AuctionEntry * GetAuction(uint32 id) const
void AddAuction(AuctionEntry *auction)
void BuildListAuctionItems(WorldPacket &data, Player *player, std::wstring const &searchedname, uint32 listfrom, uint8 levelmin, uint8 levelmax, uint8 usable, uint32 inventoryType, uint32 itemClass, uint32 itemSubClass, uint32 quality, uint32 &count, uint32 &totalcount, bool getall=false)
void BuildListOwnerItems(WorldPacket &data, Player *player, uint32 &count, uint32 &totalcount)
bool RemoveAuction(AuctionEntry *auction)
void put(std::size_t pos, T value)
ObjectGuid::LowType GetSpawnId() const
std::string const & GetNameForLocaleIdx(LocaleConstant locale) const override
static void DeleteFromInventoryDB(CharacterDatabaseTransaction trans, ObjectGuid::LowType itemGuid)
void SetState(ItemUpdateState state, Player *forplayer=nullptr)
virtual void SaveToDB(CharacterDatabaseTransaction trans)
Item * CloneItem(uint32 count, Player const *player=nullptr) const
bool CanBeTraded(bool mail=false, bool trade=false) const
void SetCount(uint32 value)
ItemTemplate const * GetTemplate() const
bool IsNotEmptyBag() const
uint32 GetMaxStackCount() const
static void DeleteFromDB(CharacterDatabaseTransaction trans, ObjectGuid::LowType itemGuid)
void SendMailTo(CharacterDatabaseTransaction trans, MailReceiver const &receiver, MailSender const &sender, MailCheckMask checked=MAIL_CHECK_MASK_NONE, uint32 deliver_delay=0)
MailDraft & AddItem(Item *item)
LowType GetCounter() const
std::string ToString() const
uint32 GetUInt32Value(uint16 index) const
static ObjectGuid GetGUID(Object const *o)
void SendUpdateToPlayer(Player *player)
void ItemRemovedQuestCheck(uint32 entry, uint32 count)
void SaveInventoryAndGoldToDB(CharacterDatabaseTransaction trans)
void UpdateAchievementCriteria(AchievementCriteriaTypes type, uint32 miscValue1=0, uint32 miscValue2=0, WorldObject *ref=nullptr)
bool ModifyMoney(int32 amount, bool sendError=true)
WorldSession * GetSession() const
bool HasEnoughMoney(uint32 amount) const
void MoveItemFromInventory(uint8 bag, uint8 slot, bool update)
Creature * GetNPCIfCanInteractWith(ObjectGuid const &guid, NPCFlags npcFlags) const
Item * GetItemByGuid(ObjectGuid guid) const
void setUInt32(uint8 index, uint32 value)
void setUInt8(uint8 index, uint8 value)
void RemoveAurasByType(AuraType auraType, std::function< bool(AuraApplication const *)> const &check, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
uint32 GetFaction() const override
std::string const & GetName() const
int32 BagResult
the bid error. Possible values are AuctionError
uint32 Money
the amount of money that the player bid in copper
ObjectGuid Guid
the GUID of the bidder for this auction.
int32 ErrorCode
the error code that was generated when trying to perform the action. Possible values are AuctionError
int32 AuctionID
the id of the auction that triggered this notification
uint32 MinIncrement
the sum of outbid is (1% of current bid) * 5, if the bid is too small, then this value is 1 copper.
WorldPacket const * Write() override
int32 Command
the type of action that triggered this notification. Possible values are AuctionAction
WorldPacket const * Write() override
void HandleAuctionListPendingSales(WorldPacket &recvData)
void HandleAuctionListItems(WorldPacket &recvData)
char const * GetTrinityString(uint32 entry) const
void HandleAuctionListOwnerItems(WorldPacket &recvData)
void SendNotification(char const *format,...) ATTR_PRINTF(2
void SendPacket(WorldPacket const *packet)
Send a packet to the client.
void SendAuctionRemovedNotification(uint32 auctionId, uint32 itemEntry, int32 randomPropertyId)
void HandleAuctionSellItem(WorldPacket &recvData)
void SendAuctionCommandResult(AuctionEntry const *auction, AuctionCommand command, AuctionResult errorCode, InventoryResult bagResult=InventoryResult(0))
Notifies the client of the result of his last auction operation. It is called when the player bids,...
void SendAuctionOwnerNotification(AuctionEntry *auction)
Player * GetPlayer() const
bool HasPermission(uint32 permissionId)
void HandleAuctionListBidderItems(WorldPacket &recvData)
uint32 GetAccountId() const
void SendAuctionHello(ObjectGuid guid, Unit const *unit)
void SendAuctionBidderNotification(uint32 location, uint32 auctionId, ObjectGuid bidder, uint32 bidSum, uint32 diff, uint32 item_template)
void HandleAuctionRemoveItem(WorldPacket &recvData)
void HandleAuctionPlaceBid(WorldPacket &recvData)
std::string const & GetPlayerName() const
void HandleAuctionHelloOpcode(WorldPackets::AuctionHouse::AuctionHelloRequest &packet)
@ SMSG_AUCTION_BIDDER_LIST_RESULT
@ SMSG_AUCTION_BIDDER_NOTIFICATION
@ SMSG_AUCTION_LIST_RESULT
@ SMSG_AUCTION_REMOVED_NOTIFICATION
@ SMSG_AUCTION_OWNER_LIST_RESULT
@ SMSG_AUCTION_LIST_PENDING_SALES
@ SMSG_AUCTION_OWNER_NOTIFICATION
@ CONFIG_AUCTION_GETALL_DELAY
@ CONFIG_AUCTION_LEVEL_REQ
@ CONFIG_AUCTION_SEARCH_DELAY
@ CONFIG_ALLOW_TWO_SIDE_INTERACTION_AUCTION
TC_GAME_API Player * FindPlayer(ObjectGuid const &)
ObjectGuid::LowType bidder
uint32 GetAuctionOutBid() const
the sum of outbid is (1% from current bid)*5, if bid is very small, it is 1c
void DeleteFromDB(CharacterDatabaseTransaction trans) const
AuctionHouseEntry const * auctionHouseEntry
std::unordered_set< ObjectGuid > bidders
void SaveToDB(CharacterDatabaseTransaction trans) const
ObjectGuid::LowType owner
std::string BuildAuctionMailSubject(MailAuctionAnswers response) const
uint32 GetAuctionCut() const
ObjectGuid::LowType itemGUIDLow
bool BuildAuctionInfo(WorldPacket &data, Item *sourceItem=nullptr) const
bool HasFlag(ItemFlags flag) const