aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Handlers/AuctionHouseHandler.cpp
diff options
context:
space:
mode:
authorpete318 <pete318@users.noreply.github.com>2016-02-03 00:45:31 +0000
committerShauren <shauren.trinity@gmail.com>2016-04-10 17:48:29 +0200
commit7d5d79aa015b21969a1f5ca75ca3efe8cb842f25 (patch)
treee21f6f3a63c2a4a3a0891fc4348dee866200dd67 /src/server/game/Handlers/AuctionHouseHandler.cpp
parentb23a6aeaff403266491ea75207558bf9917b9cc4 (diff)
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)
Diffstat (limited to 'src/server/game/Handlers/AuctionHouseHandler.cpp')
-rw-r--r--src/server/game/Handlers/AuctionHouseHandler.cpp24
1 files changed, 18 insertions, 6 deletions
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());
}