From 7d5d79aa015b21969a1f5ca75ca3efe8cb842f25 Mon Sep 17 00:00:00 2001 From: pete318 Date: Wed, 3 Feb 2016 00:45:31 +0000 Subject: Implement AuctionHouse features: GetAll scan and search throttling Implements two standard features of the Auction House. * GetAll scan, retrieves all auctions and sends them in a single packet. There's a limitation on how often a player can do this (Max 55000 items) * Search throttling. For normal searches, the server can send a time in milliseconds to the client, the client will wait that long between searches. Delay set in config Closes #16469 (cherry picked from commit 3aaeb574050668e5a240078f6e40337c3975d110) --- src/server/game/Handlers/AuctionHouseHandler.cpp | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) (limited to 'src/server/game/Handlers/AuctionHouseHandler.cpp') diff --git a/src/server/game/Handlers/AuctionHouseHandler.cpp b/src/server/game/Handlers/AuctionHouseHandler.cpp index 347ae3d0b03..f0e2d8693b0 100644 --- a/src/server/game/Handlers/AuctionHouseHandler.cpp +++ b/src/server/game/Handlers/AuctionHouseHandler.cpp @@ -631,7 +631,7 @@ void WorldSession::HandleAuctionListItems(WorldPackets::AuctionHouse::AuctionLis wsearchedname, packet.Offset, packet.MinLevel, packet.MaxLevel, packet.OnlyUsable, packet.InvType, packet.ItemClass, packet.ItemSubclass, packet.Quality, result.TotalCount); - result.DesiredDelay = 300; + result.DesiredDelay = sWorld->getIntConfig(CONFIG_AUCTION_SEARCH_DELAY); result.OnlyUsable = packet.OnlyUsable; SendPacket(result.Write()); } @@ -645,12 +645,24 @@ void WorldSession::HandleAuctionListPendingSales(WorldPackets::AuctionHouse::Auc void WorldSession::HandleReplicateItems(WorldPackets::AuctionHouse::AuctionReplicateItems& packet) { - //@todo implement this properly + Creature* creature = GetPlayer()->GetNPCIfCanInteractWith(packet.Auctioneer, UNIT_NPC_FLAG_AUCTIONEER); + if (!creature) + { + TC_LOG_DEBUG("network", "WORLD: HandleReplicateItems - %s not found or you can't interact with him.", packet.Auctioneer.ToString().c_str()); + return; + } + + // remove fake death + if (GetPlayer()->HasUnitState(UNIT_STATE_DIED)) + GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH); + + AuctionHouseObject* auctionHouse = sAuctionMgr->GetAuctionsMap(creature->getFaction()); + WorldPackets::AuctionHouse::AuctionReplicateResponse response; - response.ChangeNumberCursor = packet.ChangeNumberCursor; - response.ChangeNumberGlobal = packet.ChangeNumberGlobal; - response.ChangeNumberTombstone = packet.ChangeNumberTombstone; - response.DesiredDelay = 300; + + auctionHouse->BuildReplicate(response, GetPlayer(), packet.ChangeNumberGlobal, packet.ChangeNumberCursor, packet.ChangeNumberTombstone, packet.Count); + + response.DesiredDelay = sWorld->getIntConfig(CONFIG_AUCTION_SEARCH_DELAY) * 5; response.Result = 0; SendPacket(response.Write()); } -- cgit v1.2.3