Refresh fix, Dungeon Builder v2

This commit is contained in:
dingo
2026-01-04 21:35:42 -05:00
parent 89e6684288
commit 7de9bd2761
8 changed files with 1559 additions and 67 deletions
+9 -2
View File
@@ -41,7 +41,14 @@ public class LootService
public async Task InitializeAsync()
{
if (_initialized) return;
await RefreshCacheAsync();
}
/// <summary>
/// Refresh all loot-related caches (can be called on-demand from admin)
/// </summary>
public async Task RefreshCacheAsync()
{
using var scope = _scopeFactory.CreateScope();
var db = scope.ServiceProvider.GetRequiredService<GameDbContext>();
@@ -95,7 +102,7 @@ public class LootService
_itemDefinitions = items.ToDictionary(i => i.Id);
_initialized = true;
_log.LogInformation("LootService initialized: {Tables} tables, {Items} items, {Mappings} mob mappings",
_log.LogInformation("LootService cache refreshed: {Tables} tables, {Items} items, {Mappings} mob mappings",
_lootTables.Count, _itemDefinitions.Count, mappings.Count);
}