Additional tools for Admin portal, and huge NameSpace Revamp
This commit is contained in:
+11
-11
@@ -1,8 +1,8 @@
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Server.Data;
|
||||
using Server.Data.Entities;
|
||||
using DataServer.Data;
|
||||
using DataServer.Data.Entities;
|
||||
|
||||
namespace Server.Game.Dungeon;
|
||||
|
||||
@@ -89,7 +89,7 @@ public class LootService
|
||||
// Seed default items if empty
|
||||
if (items.Count == 0)
|
||||
{
|
||||
items = await SeedDefaultItemsAsync(db);
|
||||
_log.LogCritical("Database Items EMPTY!");
|
||||
}
|
||||
|
||||
_itemDefinitions = items.ToDictionary(i => i.Id);
|
||||
@@ -412,12 +412,12 @@ public class LootService
|
||||
};
|
||||
}
|
||||
|
||||
private async Task<List<DungeonItemDefinition>> SeedDefaultItemsAsync(GameDbContext db)
|
||||
{
|
||||
var items = DefaultDungeonItems.GetDefaultItems();
|
||||
db.Set<DungeonItemDefinition>().AddRange(items);
|
||||
await db.SaveChangesAsync();
|
||||
_log.LogInformation("Seeded {Count} default item definitions", items.Count);
|
||||
return items;
|
||||
}
|
||||
//private async Task<List<DungeonItemDefinition>> SeedDefaultItemsAsync(GameDbContext db)
|
||||
//{
|
||||
// var items = DefaultDungeonItems.GetDefaultItems();
|
||||
// db.Set<DungeonItemDefinition>().AddRange(items);
|
||||
// await db.SaveChangesAsync();
|
||||
// _log.LogInformation("Seeded {Count} default item definitions", items.Count);
|
||||
// return items;
|
||||
//}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user