Further cleanup after removal of persistPurchaseDataInProfile

This commit is contained in:
Dev 2024-03-30 13:34:54 +00:00
parent f365f979c4
commit 467927afeb

View File

@ -168,9 +168,6 @@ export class TradeHelper
traderId: buyRequestData.tid, traderId: buyRequestData.tid,
}; };
this.traderHelper.addTraderPurchasesToPlayerProfile(sessionID, itemPurchaseDat, itemPurchased); this.traderHelper.addTraderPurchasesToPlayerProfile(sessionID, itemPurchaseDat, itemPurchased);
// Increment non-fence trader item buy count
this.incrementAssortBuyCount(itemPurchased, buyCount);
} }
}; };
@ -277,22 +274,6 @@ export class TradeHelper
this.paymentService.giveProfileMoney(profileToReceiveMoney, sellRequest.price, sellRequest, output, sessionID); this.paymentService.giveProfileMoney(profileToReceiveMoney, sellRequest.price, sellRequest, output, sessionID);
} }
/**
* Increment the assorts buy count by number of items purchased
* Show error on screen if player attempts to buy more than what the buy max allows
* @param assortBeingPurchased assort being bought
* @param itemsPurchasedCount number of items being bought
*/
protected incrementAssortBuyCount(assortBeingPurchased: Item, itemsPurchasedCount: number): void
{
assortBeingPurchased.upd.BuyRestrictionCurrent += itemsPurchasedCount;
if (assortBeingPurchased.upd.BuyRestrictionCurrent > assortBeingPurchased.upd.BuyRestrictionMax)
{
throw new Error("Unable to purchase item, Purchase limit reached");
}
}
/** /**
* Traders allow a limited number of purchases per refresh cycle (default 60 mins) * Traders allow a limited number of purchases per refresh cycle (default 60 mins)
* @param sessionId Session id * @param sessionId Session id