remove guid, reduce latency (gets stuck sometimes tho)

This commit is contained in:
Vinzenz Schroeter 2024-04-28 12:53:18 +02:00
parent 6bc6a039bd
commit 7044ffda79
19 changed files with 291 additions and 251 deletions

View file

@ -19,10 +19,11 @@ public static class Program
var app = Configure(args);
var clientFileProvider = new PhysicalFileProvider(Path.Combine(app.Environment.ContentRootPath, "client"));
app.UseDefaultFiles(new DefaultFilesOptions { FileProvider = clientFileProvider });
app.UseStaticFiles(new StaticFileOptions { FileProvider = clientFileProvider });
Endpoints.MapEndpoints(app);
app.Services.GetRequiredService<Endpoints>().Map(app);
await app.RunAsync();
}
@ -63,6 +64,7 @@ public static class Program
builder.Services.AddSingleton<PlayerServer>();
builder.Services.AddSingleton<ClientScreenServer>();
builder.Services.AddSingleton<TankSpawnQueue>();
builder.Services.AddSingleton<Endpoints>();
builder.Services.AddHostedService<GameTickWorker>();
builder.Services.AddHostedService(sp => sp.GetRequiredService<ControlsServer>());