Skip to content

Commit

Permalink
chore: check the item id when uploading data to universalis
Browse files Browse the repository at this point in the history
now it mainly blocking market history uploading (since we still does not fix the item id issue when uploading history)
  • Loading branch information
sandtechnology committed Oct 28, 2024
1 parent 5cc9588 commit de015fa
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion Cafe.Matcha/Network/Universalis/PacketProcessor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ void LogStartObserved(MarketBoardItemRequest request)
.And(OnMarketBoardSalesBatch(startObservable))
.And(OnMarketBoardListingsBatch(startObservable))
.Then((request, sales, listings) => (request, sales, listings)))
.Where(ShouldUpload)
.Where(ShouldUpload)
.SubscribeOn(ThreadPoolScheduler.Instance)
.Subscribe(
data =>
Expand All @@ -225,6 +225,12 @@ private void UploadMarketBoardData(
ICollection<MarketBoardCurrentOfferings.MarketBoardItemListing> listings)
{
var catalogId = listings.FirstOrDefault()?.CatalogId ?? 0;
if (catalogId == 0)
{
Log?.Invoke(this, $"Wrong catalogId of Market Board listings received for request: item#{catalogId}");
return;
}

if (listings.Count != request.AmountToArrive)
{
Log?.Invoke(this, $"Wrong number of Market Board listings received for request: {listings.Count} != {request.AmountToArrive} item#{catalogId}");
Expand Down

0 comments on commit de015fa

Please sign in to comment.