From 806f09592e2e7cb825d8b98cbd2cbe77c02f154d Mon Sep 17 00:00:00 2001 From: Robert Paciorek Date: Thu, 13 Feb 2025 21:26:47 +0000 Subject: [PATCH] add GetGameCurrency endpoint, add store 8 (empty) also allowing create empty stores --- src/Controllers/Common/ContentController.cs | 9 ++++++++- src/Resources/store.xml | 5 +++++ src/Services/StoreService.cs | 12 +++++++----- 3 files changed, 20 insertions(+), 6 deletions(-) diff --git a/src/Controllers/Common/ContentController.cs b/src/Controllers/Common/ContentController.cs index cd23c15..4916ab6 100644 --- a/src/Controllers/Common/ContentController.cs +++ b/src/Controllers/Common/ContentController.cs @@ -1679,10 +1679,17 @@ public class ContentController : Controller { [Route("ContentWebService.asmx/GetUserGameCurrency")] [VikingSession] public IActionResult GetUserGameCurrency(Viking viking) { - // TODO: This is a placeholder return Ok(achievementService.GetUserCurrency(viking)); } + [HttpPost] + [Produces("application/xml")] + [Route("ContentWebService.asmx/GetGameCurrency")] + [VikingSession] + public IActionResult GetGameCurrency(Viking viking) { + return Ok(achievementService.GetUserCurrency(viking).GameCurrency); + } + [HttpPost] [Produces("application/xml")] [Route("ContentWebService.asmx/SetGameCurrency")] // used by World Of Jumpstart diff --git a/src/Resources/store.xml b/src/Resources/store.xml index fe12421..47f78e2 100644 --- a/src/Resources/store.xml +++ b/src/Resources/store.xml @@ -1949,6 +1949,11 @@ SoD 3.31 main store section and subsection filtering: 1597 1627 + + 8 + FL Avatar Default + The default avatar parts for Adventure Land -- empty + 9 Main Street_Threadz diff --git a/src/Services/StoreService.cs b/src/Services/StoreService.cs index e3e46a8..ee7d555 100644 --- a/src/Services/StoreService.cs +++ b/src/Services/StoreService.cs @@ -19,11 +19,13 @@ public class StoreService { List itemsList = new(); IEnumerable? memberSales = s.SalesAtStore?.Where(x => x.ForMembers == true); IEnumerable? normalSales = s.SalesAtStore?.Where(x => x.ForMembers == false || x.ForMembers == null); - for (int i = 0; i < s.ItemId.Length; ++i) { - ItemData item = itemService.GetItem(s.ItemId[i]); - if (item is null) continue; // skip removed items - itemsList.Add(item); - UpdateItemSaleModifier(item, memberSales, normalSales); + if (s.ItemId != null) { + for (int i = 0; i < s.ItemId.Length; ++i) { + ItemData item = itemService.GetItem(s.ItemId[i]); + if (item is null) continue; // skip removed items + itemsList.Add(item); + UpdateItemSaleModifier(item, memberSales, normalSales); + } } foreach (int itemID in moddingService.GetStoreItem(s.Id)) { ItemData item = itemService.GetItem(itemID);