Build & Deploy / build (push) Successful in 42s
Bundle a compact id -> {name,rarity,category} lookup (Data/gameref.json, 1177 entries,
built from community-datamined TCF-Wiki data) and a GameRefService. The admin back-office
now shows readable names + coloured rarity for inventory items instead of raw ids, and a
new /admin/catalog page browses the known game catalog (searchable, by category).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
86 lines
2.7 KiB
C#
86 lines
2.7 KiB
C#
using Prospect.Server.Api.Config;
|
|
using Prospect.Server.Api.Converters;
|
|
using Prospect.Server.Api.Hubs;
|
|
using Prospect.Server.Api.Middleware;
|
|
using Prospect.Server.Api.Services.Auth;
|
|
using Prospect.Server.Api.Services.CloudScript;
|
|
using Prospect.Server.Api.Services.Database;
|
|
using Prospect.Server.Api.Services.Qos;
|
|
using Prospect.Server.Api.Services.UserData;
|
|
using Serilog;
|
|
|
|
namespace Prospect.Server.Api;
|
|
|
|
public class Startup
|
|
{
|
|
public Startup(IConfiguration configuration)
|
|
{
|
|
Configuration = configuration;
|
|
}
|
|
|
|
private IConfiguration Configuration { get; }
|
|
|
|
public void ConfigureServices(IServiceCollection services)
|
|
{
|
|
services.Configure<AuthTokenSettings>(Configuration.GetSection(nameof(AuthTokenSettings)));
|
|
services.Configure<DatabaseSettings>(Configuration.GetSection(nameof(DatabaseSettings)));
|
|
services.Configure<PlayFabSettings>(Configuration.GetSection(nameof(PlayFabSettings)));
|
|
|
|
services.AddSingleton<AuthTokenService>();
|
|
services.AddSingleton<UserDataService>();
|
|
services.AddSingleton<TitleDataService>();
|
|
|
|
services.AddSingleton<Prospect.Server.Api.Services.Steam.SteamWebApiService>();
|
|
services.AddSingleton<Prospect.Server.Api.Services.GameRef.GameRefService>();
|
|
|
|
services.AddSingleton<DbUserService>();
|
|
services.AddSingleton<DbEntityService>();
|
|
|
|
services.AddSingleton<DbUserDataService>();
|
|
|
|
services.AddSingleton<Prospect.Server.Api.Services.Squad.SquadService>();
|
|
services.AddSingleton<Prospect.Server.Api.Hubs.SignalRConnectionRegistry>();
|
|
|
|
services.AddHostedService<QosService>();
|
|
services.AddSingleton<QosServer>();
|
|
|
|
services.AddScoped<CloudScriptService>();
|
|
services.AddSingleton<CloudScriptFunctionLoader>();
|
|
|
|
services.AddAuthentication(_ =>
|
|
{
|
|
|
|
})
|
|
.AddUserAuthentication(_ => {})
|
|
.AddEntityAuthentication(_ => {});
|
|
|
|
services.AddHttpContextAccessor();
|
|
|
|
services.AddSignalR();
|
|
|
|
services.AddControllers().AddJsonOptions(options =>
|
|
{
|
|
options.JsonSerializerOptions.Converters.Add(new DateTimeConverter());
|
|
});
|
|
}
|
|
|
|
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
|
|
{
|
|
if (env.IsDevelopment())
|
|
{
|
|
app.UseDeveloperExceptionPage();
|
|
}
|
|
|
|
// app.UseHttpsRedirection();
|
|
app.UseSerilogRequestLogging();
|
|
app.UseMiddleware<RequestLoggerMiddleware>();
|
|
app.UseRouting();
|
|
app.UseAuthentication();
|
|
app.UseAuthorization();
|
|
app.UseEndpoints(endpoints =>
|
|
{
|
|
endpoints.MapControllers();
|
|
endpoints.MapHub<CycleHub>("/signalr");
|
|
});
|
|
}
|
|
} |