using System; using System.Linq; using System.Threading.Tasks; using GameCult.Mesh; using R3; #nullable enable namespace GameCult.Aetheria.State.Verse { public sealed class AetheriaClientState { private readonly CultMeshDocumentCatalog _documents; internal AetheriaClientState( CultMeshDocumentHandle providerAdvertisement, CultMeshDocumentHandle health, CultMeshDocumentHandle commandBoundary, CultMeshDocumentHandle authorityPolicy, CultMeshDocumentHandle latestFrame, CultMeshDocumentHandle latestSoaView, CultMeshDocumentHandle gameSurface, CultMeshDocumentHandle gameTuiSurface, CultMeshDocumentHandle editorSurface, CultMeshDocumentHandle editorTuiSurface, CultMeshDocumentHandle catalog, CultMeshDocumentHandle loadoutTemplates, CultMeshDocumentHandle playerSettings, CultMeshDocumentHandle verseHostSettings, CultMeshDocumentHandle currentZone, CultMeshDocumentHandle currentEntity, CultMeshDocumentHandle currentDocking, CultMeshDocumentHandle zoneContacts, CultMeshDocumentHandle stationRefit, CultMeshDocumentHandle sectorMap, CultMeshDocumentHandle zoneRender, Func> mapViewport, Func> objectsViewport, Func> gravityViewport, Func> renderSplatsViewport, Func> zoneDetails, Func> selectedObject, Func> inventory, CultMeshDocumentHandle starbridgeScenario, CultMeshDocumentHandle starbridgeSession, CultMeshDocumentHandle starbridgeSummary, Func> starbridgePlayerSeat) { Daemon = new AetheriaClientDaemonState( providerAdvertisement, health, commandBoundary, authorityPolicy, latestFrame, latestSoaView, gameSurface, gameTuiSurface, editorSurface, editorTuiSurface); LatestFrame = latestFrame ?? throw new ArgumentNullException(nameof(latestFrame)); LatestSoaView = latestSoaView ?? throw new ArgumentNullException(nameof(latestSoaView)); Catalog = catalog ?? throw new ArgumentNullException(nameof(catalog)); LoadoutTemplates = loadoutTemplates ?? throw new ArgumentNullException(nameof(loadoutTemplates)); Settings = new AetheriaClientSettingsState(playerSettings, verseHostSettings); Current = new AetheriaClientCurrentState(currentZone, currentEntity, currentDocking); ZoneContacts = zoneContacts ?? throw new ArgumentNullException(nameof(zoneContacts)); StationRefit = stationRefit ?? throw new ArgumentNullException(nameof(stationRefit)); SectorMap = sectorMap ?? throw new ArgumentNullException(nameof(sectorMap)); ZoneRender = zoneRender ?? throw new ArgumentNullException(nameof(zoneRender)); Viewports = new AetheriaClientViewportState( mapViewport, objectsViewport, gravityViewport, renderSplatsViewport); Details = new AetheriaClientDetailState( zoneDetails, selectedObject, inventory); DockingState = new AetheriaClientDockingState(Current.Entity, Current.Docking, StationRefit); Starbridge = new AetheriaClientStarbridgeState( starbridgeScenario, starbridgeSession, starbridgeSummary, starbridgePlayerSeat); _documents = CultMesh.Documents( Daemon.ProviderAdvertisement, Daemon.Health, Daemon.CommandBoundary, Daemon.AuthorityPolicy, Daemon.GameSurface, Daemon.GameTuiSurface, Daemon.EditorSurface, Daemon.EditorTuiSurface, LatestFrame, LatestSoaView, Catalog, LoadoutTemplates, Settings.Player, Settings.VerseHost, Current.Zone, Current.Entity, Current.Docking, ZoneContacts, StationRefit, SectorMap, ZoneRender, Starbridge.Scenario, Starbridge.Session); } public AetheriaClientDaemonState Daemon { get; } public CultMeshDocumentHandle LatestFrame { get; } public CultMeshDocumentHandle LatestSoaView { get; } public CultMeshDocumentHandle Catalog { get; } public CultMeshDocumentHandle LoadoutTemplates { get; } public AetheriaClientSettingsState Settings { get; } public AetheriaClientCurrentState Current { get; } public AetheriaClientDockingState DockingState { get; } public AetheriaClientViewportState Viewports { get; } public AetheriaClientDetailState Details { get; } public AetheriaClientStarbridgeState Starbridge { get; } public CultMeshDocumentHandle ZoneContacts { get; } public CultMeshDocumentHandle StationRefit { get; } public CultMeshDocumentHandle SectorMap { get; } public CultMeshDocumentHandle ZoneRender { get; } public bool TryGetDocumentBySchema( string schemaVersion, out ICultMeshDocumentHandle document) { return _documents.TryGetDocumentBySchema(schemaVersion, out document); } public ICultMeshDocumentHandle DocumentBySchema(string schemaVersion) { if (TryGetDocumentBySchema(schemaVersion, out var document)) return document; throw new NotSupportedException( $"Aetheria typed state does not expose a projected document for schema '{schemaVersion}'."); } public bool TryGetDocument( out CultMeshDocumentHandle document) where TDocument : class { return _documents.TryGetDocument(out document); } public CultMeshDocumentHandle Document() where TDocument : class { if (TryGetDocument(out var document)) return document; throw new NotSupportedException( $"Aetheria typed state does not expose a projected document for {typeof(TDocument).FullName}."); } public Task LatestAsync() where TDocument : class { return Document().LatestAsync(); } public TDocument Latest() where TDocument : class { return Document().LatestAsync().ConfigureAwait(false).GetAwaiter().GetResult(); } public AetheriaRuntimeCatalogSnapshot LatestCatalog() { return Latest(); } public Task LatestDaemonFrameAsync() { return LatestFrame.LatestAsync(); } public AetheriaRuntimeDaemonFrameDocument LatestDaemonFrame() { return LatestDaemonFrameAsync().ConfigureAwait(false).GetAwaiter().GetResult(); } public Task LatestDaemonSoaViewAsync() { return LatestSoaView.LatestAsync(); } public AetheriaRuntimeDaemonSoaViewDocument LatestDaemonSoaView() { return LatestDaemonSoaViewAsync().ConfigureAwait(false).GetAwaiter().GetResult(); } public Task LatestLoadoutTemplatesAsync() { return LoadoutTemplates.LatestAsync(); } public AetheriaRuntimeLoadoutTemplatesDocument LatestLoadoutTemplates() { return LatestLoadoutTemplatesAsync().ConfigureAwait(false).GetAwaiter().GetResult(); } public Task LatestSectorMapAsync() { return SectorMap.LatestAsync(); } public AetheriaRuntimeSectorMapDocument LatestSectorMap() { return LatestSectorMapAsync().ConfigureAwait(false).GetAwaiter().GetResult(); } public Task LatestZoneContactsAsync() { return ZoneContacts.LatestAsync(); } public AetheriaRuntimeZoneContactsDocument LatestZoneContacts() { return LatestZoneContactsAsync().ConfigureAwait(false).GetAwaiter().GetResult(); } public Task LatestStationRefitAsync() { return StationRefit.LatestAsync(); } public AetheriaRuntimeStationRefitDocument LatestStationRefit() { return LatestStationRefitAsync().ConfigureAwait(false).GetAwaiter().GetResult(); } public Task LatestZoneRenderAsync() { return ZoneRender.LatestAsync(); } public AetheriaRuntimeZoneRenderDocument LatestZoneRender() { return LatestZoneRenderAsync().ConfigureAwait(false).GetAwaiter().GetResult(); } public Observable Watch() where TDocument : class { return Document().Watch(); } public IDisposable Watch(Action onNext) where TDocument : class { if (onNext == null) throw new ArgumentNullException(nameof(onNext)); return Document().Watch(onNext); } public Task> ReactiveAsync( CultMeshReactiveDocumentOptions? options = null) where TDocument : class { return Document().ReactiveAsync(options); } public CultMeshReactiveDocument Reactive( CultMeshReactiveDocumentOptions? options = null) where TDocument : class { return Document().Reactive(options); } public Func CreateEveSurfaceStateRefResolver() { return CreateEveSurfaceCultMeshStateRefResolver().AsFunc(); } public CultMeshStateRefResolver CreateEveSurfaceCultMeshStateRefResolver() { return CreateEveSurfaceCultMeshStateRefResolverAsync().ConfigureAwait(false).GetAwaiter().GetResult(); } public async Task CreateEveSurfaceCultMeshStateRefResolverAsync() { var frameTask = Daemon.LatestFrameDocumentAsync(); var healthTask = Daemon.LatestHealthAsync(); var commandBoundaryTask = Daemon.LatestCommandBoundaryAsync(); await Task.WhenAll(frameTask, healthTask, commandBoundaryTask).ConfigureAwait(false); return AetheriaRuntimeStateRefResolver.CreateEveSurfaceCultMeshStateRefResolver( frameTask.Result, healthTask.Result, commandBoundaryTask.Result, LatestCatalog); } } public sealed class AetheriaClientDaemonState { internal AetheriaClientDaemonState( CultMeshDocumentHandle providerAdvertisement, CultMeshDocumentHandle health, CultMeshDocumentHandle commandBoundary, CultMeshDocumentHandle authorityPolicy, CultMeshDocumentHandle latestFrame, CultMeshDocumentHandle latestSoaView, CultMeshDocumentHandle gameSurface, CultMeshDocumentHandle gameTuiSurface, CultMeshDocumentHandle editorSurface, CultMeshDocumentHandle editorTuiSurface) { ProviderAdvertisement = providerAdvertisement ?? throw new ArgumentNullException(nameof(providerAdvertisement)); Health = health ?? throw new ArgumentNullException(nameof(health)); CommandBoundary = commandBoundary ?? throw new ArgumentNullException(nameof(commandBoundary)); AuthorityPolicy = authorityPolicy ?? throw new ArgumentNullException(nameof(authorityPolicy)); LatestFrame = latestFrame ?? throw new ArgumentNullException(nameof(latestFrame)); LatestSoaView = latestSoaView ?? throw new ArgumentNullException(nameof(latestSoaView)); GameSurface = gameSurface ?? throw new ArgumentNullException(nameof(gameSurface)); GameTuiSurface = gameTuiSurface ?? throw new ArgumentNullException(nameof(gameTuiSurface)); EditorSurface = editorSurface ?? throw new ArgumentNullException(nameof(editorSurface)); EditorTuiSurface = editorTuiSurface ?? throw new ArgumentNullException(nameof(editorTuiSurface)); } public CultMeshDocumentHandle ProviderAdvertisement { get; } public CultMeshDocumentHandle Health { get; } public CultMeshDocumentHandle CommandBoundary { get; } public CultMeshDocumentHandle AuthorityPolicy { get; } public CultMeshDocumentHandle LatestFrame { get; } public CultMeshDocumentHandle LatestSoaView { get; } public CultMeshDocumentHandle GameSurface { get; } public CultMeshDocumentHandle GameTuiSurface { get; } public CultMeshDocumentHandle EditorSurface { get; } public CultMeshDocumentHandle EditorTuiSurface { get; } public Task LatestProviderAdvertisementAsync() { return ProviderAdvertisement.LatestAsync(); } public AetheriaRuntimeDaemonProviderAdvertisementDocument LatestProviderAdvertisement() { return LatestProviderAdvertisementAsync().ConfigureAwait(false).GetAwaiter().GetResult(); } public Task LatestHealthAsync() { return Health.LatestAsync(); } public AetheriaRuntimeDaemonHealthDocument LatestHealth() { return LatestHealthAsync().ConfigureAwait(false).GetAwaiter().GetResult(); } public Task LatestCommandBoundaryAsync() { return CommandBoundary.LatestAsync(); } public AetheriaRuntimeDaemonCommandBoundaryDocument LatestCommandBoundary() { return LatestCommandBoundaryAsync().ConfigureAwait(false).GetAwaiter().GetResult(); } public Task LatestAuthorityPolicyAsync() { return AuthorityPolicy.LatestAsync(); } public AetheriaRuntimeVerseAuthorityPolicyDocument LatestAuthorityPolicy() { return LatestAuthorityPolicyAsync().ConfigureAwait(false).GetAwaiter().GetResult(); } public Task LatestFrameDocumentAsync() { return LatestFrame.LatestAsync(); } public AetheriaRuntimeDaemonFrameDocument LatestFrameDocument() { return LatestFrameDocumentAsync().ConfigureAwait(false).GetAwaiter().GetResult(); } public Task LatestSoaViewDocumentAsync() { return LatestSoaView.LatestAsync(); } public AetheriaRuntimeDaemonSoaViewDocument LatestSoaViewDocument() { return LatestSoaViewDocumentAsync().ConfigureAwait(false).GetAwaiter().GetResult(); } public Task LatestGameSurfaceAsync() { return GameSurface.LatestAsync(); } public global::Aetheria.State.Documents.EveSurfaceState LatestGameSurface() { return LatestGameSurfaceAsync().ConfigureAwait(false).GetAwaiter().GetResult(); } public Task LatestGameTuiSurfaceAsync() { return GameTuiSurface.LatestAsync(); } public global::Aetheria.State.Documents.EveSurfaceState LatestGameTuiSurface() { return LatestGameTuiSurfaceAsync().ConfigureAwait(false).GetAwaiter().GetResult(); } public Task LatestEditorSurfaceAsync() { return EditorSurface.LatestAsync(); } public global::Aetheria.State.Documents.EveSurfaceState LatestEditorSurface() { return LatestEditorSurfaceAsync().ConfigureAwait(false).GetAwaiter().GetResult(); } public Task LatestEditorTuiSurfaceAsync() { return EditorTuiSurface.LatestAsync(); } public global::Aetheria.State.Documents.EveSurfaceState LatestEditorTuiSurface() { return LatestEditorTuiSurfaceAsync().ConfigureAwait(false).GetAwaiter().GetResult(); } } public sealed class AetheriaClientCurrentState { internal AetheriaClientCurrentState( CultMeshDocumentHandle zone, CultMeshDocumentHandle entity, CultMeshDocumentHandle docking) { Zone = zone ?? throw new ArgumentNullException(nameof(zone)); Entity = entity ?? throw new ArgumentNullException(nameof(entity)); Docking = docking ?? throw new ArgumentNullException(nameof(docking)); } public CultMeshDocumentHandle Zone { get; } public CultMeshDocumentHandle Entity { get; } public CultMeshDocumentHandle Docking { get; } public Task LatestZoneAsync() { return Zone.LatestAsync(); } public AetheriaRuntimeCurrentZoneDocument LatestZone() { return LatestZoneAsync().ConfigureAwait(false).GetAwaiter().GetResult(); } public Task LatestEntityAsync() { return Entity.LatestAsync(); } public AetheriaRuntimeCurrentEntityDocument LatestEntity() { return LatestEntityAsync().ConfigureAwait(false).GetAwaiter().GetResult(); } } public sealed class AetheriaClientSettingsState { internal AetheriaClientSettingsState( CultMeshDocumentHandle player, CultMeshDocumentHandle verseHost) { Player = player ?? throw new ArgumentNullException(nameof(player)); VerseHost = verseHost ?? throw new ArgumentNullException(nameof(verseHost)); } public CultMeshDocumentHandle Player { get; } public CultMeshDocumentHandle VerseHost { get; } public Task LatestPlayerAsync() { return Player.LatestAsync(); } public AetheriaRuntimePlayerSettingsDocument LatestPlayer() { return LatestPlayerAsync().ConfigureAwait(false).GetAwaiter().GetResult(); } public Task LatestVerseHostAsync() { return VerseHost.LatestAsync(); } public AetheriaRuntimeVerseHostSettingsDocument LatestVerseHost() { return LatestVerseHostAsync().ConfigureAwait(false).GetAwaiter().GetResult(); } } public sealed class AetheriaClientDockingState { private readonly CultMeshDocumentHandle _currentEntity; private readonly CultMeshDocumentHandle _currentDocking; private readonly CultMeshDocumentHandle _stationRefit; internal AetheriaClientDockingState( CultMeshDocumentHandle currentEntity, CultMeshDocumentHandle currentDocking, CultMeshDocumentHandle stationRefit) { _currentEntity = currentEntity ?? throw new ArgumentNullException(nameof(currentEntity)); _currentDocking = currentDocking ?? throw new ArgumentNullException(nameof(currentDocking)); _stationRefit = stationRefit ?? throw new ArgumentNullException(nameof(stationRefit)); } public Task LatestAsync() { return CultMesh.LatestAsync( _currentEntity, _currentDocking, _stationRefit, CreateSnapshot); } public AetheriaClientDockingSnapshot Latest() { return LatestAsync().ConfigureAwait(false).GetAwaiter().GetResult(); } public bool TryLatest(out AetheriaClientDockingSnapshot? snapshot) { snapshot = null; try { snapshot = Latest(); return snapshot != null; } catch { return false; } } private static AetheriaClientDockingSnapshot CreateSnapshot( AetheriaRuntimeCurrentEntityDocument? entity, AetheriaRuntimeCurrentDockingDocument? docking, AetheriaRuntimeStationRefitDocument? refit) { var dockingBay = refit?.IsDocked == true && refit.DockingBayIndex >= 0 ? (refit.DockingBays ?? Array.Empty()) .FirstOrDefault(row => row != null && row.DockingBayIndex == refit.DockingBayIndex) : null; return new AetheriaClientDockingSnapshot(entity, docking, refit, dockingBay); } } public sealed class AetheriaClientDockingSnapshot { internal AetheriaClientDockingSnapshot( AetheriaRuntimeCurrentEntityDocument? currentEntity, AetheriaRuntimeCurrentDockingDocument? currentDocking, AetheriaRuntimeStationRefitDocument? stationRefit, AetheriaRuntimeStationDockingBayRow? currentDockingBay) { CurrentEntity = currentEntity; CurrentDocking = currentDocking; StationRefit = stationRefit; CurrentDockingBay = currentDockingBay; } public AetheriaRuntimeCurrentEntityDocument? CurrentEntity { get; } public AetheriaRuntimeCurrentDockingDocument? CurrentDocking { get; } public AetheriaRuntimeStationRefitDocument? StationRefit { get; } public AetheriaRuntimeStationDockingBayRow? CurrentDockingBay { get; } public string CurrentEntityKey => CurrentEntity?.EntityKey ?? CurrentDocking?.CurrentEntityKey ?? ""; public string DockParentEntityKey => StationRefit?.DockParentEntityKey ?? CurrentDocking?.DockParentEntityKey ?? ""; public int DockingBayIndex => CurrentDockingBay?.DockingBayIndex ?? StationRefit?.DockingBayIndex ?? CurrentDocking?.DockingBayIndex ?? -1; public bool IsDocked => StationRefit?.IsDocked == true && CurrentDockingBay != null; } public sealed class AetheriaClientViewportState { private readonly Func> _map; private readonly Func> _objects; private readonly Func> _gravity; private readonly Func> _renderSplats; internal AetheriaClientViewportState( Func> map, Func> objects, Func> gravity, Func> renderSplats) { _map = map ?? throw new ArgumentNullException(nameof(map)); _objects = objects ?? throw new ArgumentNullException(nameof(objects)); _gravity = gravity ?? throw new ArgumentNullException(nameof(gravity)); _renderSplats = renderSplats ?? throw new ArgumentNullException(nameof(renderSplats)); } public CultMeshDocumentHandle Map(AetheriaRuntimeRtsViewportBounds viewport) { return _map(viewport ?? new AetheriaRuntimeRtsViewportBounds()); } public Task LatestMapAsync(AetheriaRuntimeRtsViewportBounds viewport) { return Map(viewport).LatestAsync(); } public AetheriaRuntimeRtsViewportDocument LatestMap(AetheriaRuntimeRtsViewportBounds viewport) { return LatestMapAsync(viewport).ConfigureAwait(false).GetAwaiter().GetResult(); } public CultMeshDocumentHandle Objects(AetheriaRuntimeRtsViewportBounds viewport) { return _objects(viewport ?? new AetheriaRuntimeRtsViewportBounds()); } public Task LatestObjectsAsync(AetheriaRuntimeRtsViewportBounds viewport) { return Objects(viewport).LatestAsync(); } public AetheriaRuntimeObjectsViewportDocument LatestObjects(AetheriaRuntimeRtsViewportBounds viewport) { return LatestObjectsAsync(viewport).ConfigureAwait(false).GetAwaiter().GetResult(); } public CultMeshDocumentHandle Gravity(AetheriaRuntimeRtsViewportBounds viewport) { return _gravity(viewport ?? new AetheriaRuntimeRtsViewportBounds()); } public Task LatestGravityAsync(AetheriaRuntimeRtsViewportBounds viewport) { return Gravity(viewport).LatestAsync(); } public AetheriaRuntimeGravityViewportDocument LatestGravity(AetheriaRuntimeRtsViewportBounds viewport) { return LatestGravityAsync(viewport).ConfigureAwait(false).GetAwaiter().GetResult(); } public CultMeshDocumentHandle RenderSplats(AetheriaRuntimeRtsViewportBounds viewport) { return _renderSplats(viewport ?? new AetheriaRuntimeRtsViewportBounds()); } public Task LatestRenderSplatsAsync(AetheriaRuntimeRtsViewportBounds viewport) { return RenderSplats(viewport).LatestAsync(); } public AetheriaRuntimeRenderSplatsViewportDocument LatestRenderSplats(AetheriaRuntimeRtsViewportBounds viewport) { return LatestRenderSplatsAsync(viewport).ConfigureAwait(false).GetAwaiter().GetResult(); } } public sealed class AetheriaClientDetailState { private readonly Func> _zoneDetails; private readonly Func> _selectedObject; private readonly Func> _inventory; internal AetheriaClientDetailState( Func> zoneDetails, Func> selectedObject, Func> inventory) { _zoneDetails = zoneDetails ?? throw new ArgumentNullException(nameof(zoneDetails)); _selectedObject = selectedObject ?? throw new ArgumentNullException(nameof(selectedObject)); _inventory = inventory ?? throw new ArgumentNullException(nameof(inventory)); } public CultMeshDocumentHandle Zone(int zoneIndex) { return _zoneDetails(zoneIndex); } public Task LatestZoneAsync(int zoneIndex) { return Zone(zoneIndex).LatestAsync(); } public AetheriaRuntimeZoneDetailsDocument LatestZone(int zoneIndex) { return LatestZoneAsync(zoneIndex).ConfigureAwait(false).GetAwaiter().GetResult(); } public CultMeshDocumentHandle SelectedObject(int entityIndex) { return _selectedObject(entityIndex); } public Task LatestSelectedObjectAsync(int entityIndex) { return SelectedObject(entityIndex).LatestAsync(); } public AetheriaRuntimeSelectedObjectDocument LatestSelectedObject(int entityIndex) { return LatestSelectedObjectAsync(entityIndex).ConfigureAwait(false).GetAwaiter().GetResult(); } public CultMeshDocumentHandle Inventory(int entityIndex) { return _inventory(entityIndex); } public Task LatestInventoryAsync(int entityIndex) { return Inventory(entityIndex).LatestAsync(); } public AetheriaRuntimeInventoryDocument LatestInventory(int entityIndex) { return LatestInventoryAsync(entityIndex).ConfigureAwait(false).GetAwaiter().GetResult(); } } public sealed class AetheriaClientStarbridgeState { private readonly Func> _playerSeat; internal AetheriaClientStarbridgeState( CultMeshDocumentHandle scenario, CultMeshDocumentHandle session, CultMeshDocumentHandle summary, Func> playerSeat) { Scenario = scenario ?? throw new ArgumentNullException(nameof(scenario)); Session = session ?? throw new ArgumentNullException(nameof(session)); Summary = summary ?? throw new ArgumentNullException(nameof(summary)); _playerSeat = playerSeat ?? throw new ArgumentNullException(nameof(playerSeat)); } public CultMeshDocumentHandle Scenario { get; } public CultMeshDocumentHandle Session { get; } public CultMeshDocumentHandle Summary { get; } public CultMeshDocumentHandle PlayerSeat(string seatId) { if (string.IsNullOrWhiteSpace(seatId)) throw new ArgumentException("Seat id must be non-empty.", nameof(seatId)); return _playerSeat(seatId); } public Task LatestScenarioAsync() { return Scenario.LatestAsync(); } public AetheriaRuntimeStarbridgeScenarioDocument LatestScenario() { return LatestScenarioAsync().ConfigureAwait(false).GetAwaiter().GetResult(); } public Task LatestSessionAsync() { return Session.LatestAsync(); } public AetheriaRuntimeStarbridgeSessionDocument LatestSession() { return LatestSessionAsync().ConfigureAwait(false).GetAwaiter().GetResult(); } public Task LatestSummaryAsync() { return Summary.LatestAsync(); } public AetheriaRuntimeStarbridgeSessionSummaryDocument LatestSummary() { return LatestSummaryAsync().ConfigureAwait(false).GetAwaiter().GetResult(); } public Task LatestPlayerSeatAsync(string seatId) { return PlayerSeat(seatId).LatestAsync(); } public AetheriaRuntimeStarbridgePlayerSeatDocument LatestPlayerSeat(string seatId) { return LatestPlayerSeatAsync(seatId).ConfigureAwait(false).GetAwaiter().GetResult(); } } }