Fixed cancelled/expired player offer items not being returned #400

We were missing player offer processing when handling stale offers
This commit is contained in:
Chomp
2025-06-16 12:59:32 +01:00
parent 056de770a8
commit 40ace1712d
2 changed files with 16 additions and 2 deletions
@@ -151,11 +151,16 @@ public class RagfairOfferService(
}
/// <summary>
/// Process stored offer ids and remove expired
/// Process cached expired offer ids
/// </summary>
public void RemoveExpiredOffers()
{
ragfairOfferHolder.RemoveExpiredOffers();
// Gather all stale offers
var staleOffersIds = ragfairOfferHolder.GetStaleOfferIds();
foreach (var offerId in staleOffersIds)
{
ProcessStaleOffer(offerId);
}
// Clear out expired offer ids now we've regenerated them
ragfairOfferHolder.ResetExpiredOfferIds();
@@ -36,6 +36,15 @@ public class RagfairOfferHolder(
return _offersById.GetValueOrDefault(id);
}
/// <summary>
/// Get a ragfair offer by its id
/// </summary>
/// <returns>RagfairOffer</returns>
public HashSet<string> GetStaleOfferIds()
{
return _expiredOfferIds;
}
/// <summary>
/// Get ragfair offers that match the passed in tpl
/// </summary>