Implement roadmap phases 1 through 8

This commit is contained in:
2026-03-14 02:30:15 -04:00
parent 86b8f4a73f
commit ddca4a16d5
10 changed files with 3862 additions and 198 deletions

View File

@@ -1,3 +1,4 @@
using SpaceGame.Simulation.Api.Contracts;
using SpaceGame.Simulation.Api.Simulation;
using System.Text.Json;
@@ -31,7 +32,24 @@ app.MapGet("/api/world/stream", async (HttpContext httpContext, WorldService wor
var afterSequenceRaw = httpContext.Request.Query["afterSequence"].ToString();
_ = long.TryParse(afterSequenceRaw, out var afterSequence);
var stream = worldService.Subscribe(afterSequence, cancellationToken);
var scopeKind = httpContext.Request.Query["scopeKind"].ToString();
if (string.IsNullOrWhiteSpace(scopeKind))
{
scopeKind = httpContext.Request.Query["scope"].ToString();
}
if (string.IsNullOrWhiteSpace(scopeKind))
{
scopeKind = "universe";
}
var systemId = httpContext.Request.Query["systemId"].ToString();
var bubbleId = httpContext.Request.Query["bubbleId"].ToString();
var scope = new ObserverScope(
scopeKind,
string.IsNullOrWhiteSpace(systemId) ? null : systemId,
string.IsNullOrWhiteSpace(bubbleId) ? null : bubbleId);
var stream = worldService.Subscribe(scope, afterSequence, cancellationToken);
await httpContext.Response.WriteAsync(": connected\n\n", cancellationToken);
await httpContext.Response.Body.FlushAsync(cancellationToken);