Core/AuctionHouse: Add separate auction house throttle period for requests from auction house addons tainting default ui

Port From (https://github.com/TrinityCore/TrinityCore/commit/fb0a29131d30e15d8d323271490069860580817d)
This commit is contained in:
hondacrx
2020-04-29 14:24:17 -04:00
parent dc0867ca8b
commit e31ca45d54
6 changed files with 41 additions and 27 deletions
+4 -5
View File
@@ -34,7 +34,6 @@ namespace Game
{
public class AuctionManager : Singleton<AuctionManager>
{
const int AH_MINIMUM_DEPOSIT = 100;
const int MIN_AUCTION_TIME = 12 * Time.Hour;
AuctionHouseObject mHordeAuctions;
@@ -367,7 +366,7 @@ namespace Game
player.ModifyMoney(-(long)totaldeposit);
}
void UpdatePendingAuctions()
public void UpdatePendingAuctions()
{
foreach (var pair in _pendingAuctionsByPlayer)
{
@@ -429,7 +428,7 @@ namespace Game
return ++_replicateIdGenerator;
}
public AuctionThrottleResult CheckThrottle(Player player, AuctionCommand command = AuctionCommand.SellItem)
public AuctionThrottleResult CheckThrottle(Player player, bool addonTainted, AuctionCommand command = AuctionCommand.SellItem)
{
DateTime now = GameTime.GetGameTimeSteadyPoint();
@@ -452,7 +451,7 @@ namespace Game
if ((--throttleObject.QueriesRemaining) == 0)
return new AuctionThrottleResult(throttleObject.PeriodEnd - now, false);
else
return new AuctionThrottleResult(TimeSpan.FromMilliseconds(WorldConfig.GetIntValue(WorldCfg.AuctionSearchDelay)), false);
return new AuctionThrottleResult(TimeSpan.FromMilliseconds(WorldConfig.GetIntValue(addonTainted ? WorldCfg.AuctionTaintedSearchDelay : WorldCfg.AuctionSearchDelay)), false);
}
public AuctionHouseRecord GetAuctionHouseEntry(uint factionTemplateId)
@@ -1073,7 +1072,7 @@ namespace Game
if (throttleData == null)
{
throttleData = new PlayerReplicateThrottleData();
throttleData.NextAllowedReplication = curTime + TimeSpan.FromSeconds(WorldConfig.GetIntValue(WorldCfg.AuctionGetallDelay));
throttleData.NextAllowedReplication = curTime + TimeSpan.FromSeconds(WorldConfig.GetIntValue(WorldCfg.AuctionReplicateDelay));
throttleData.Global = Global.AuctionHouseMgr.GenerateReplicationId();
}
else