diff --git a/Server/Program.cs b/Server/Program.cs index 8c72a28..212fc75 100644 --- a/Server/Program.cs +++ b/Server/Program.cs @@ -2,6 +2,7 @@ using System.Net; using System.Reflection; +using System.Text.Json; using MassTransit; using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.Configuration; @@ -16,6 +17,7 @@ using OpenTelemetry.Resources; using OpenTelemetry.Trace; using Server.DB; using Server.Services; +using Wonderking.Game.Mapping; var builder = Host.CreateApplicationBuilder(); #if DEBUG @@ -94,6 +96,10 @@ builder.Services.AddDbContextPool(o => .EnableSensitiveDataLogging().UseLazyLoadingProxies().UseLoggerFactory(loggerFactory); }); +builder.Services.AddSingleton( + JsonSerializer.Deserialize( + File.ReadAllText("config/character-stats.mapping.json")) ?? throw new InvalidOperationException()); + builder.Services.AddSingleton(loggerFactory); builder.Services.AddSingleton(); builder.Services.AddSingleton();