Stream bounded reactive gameplay state
This commit is contained in:
parent
bd89cb4c85
commit
68b91b2196
7 changed files with 105 additions and 22 deletions
|
|
@ -1609,7 +1609,9 @@ static async Task PublishDaemonApiDocumentsAsync(
|
|||
? AetheriaRuntimeMainMenuCommands.RootSurfaceId
|
||||
: mainMenuState.ActiveSurfaceId;
|
||||
var reactiveGameSurface = AetheriaRuntimeSurfaceDocuments.ToPortableSurface(
|
||||
AetheriaRuntimeDaemonGameSurfaceBuilder.BuildReactiveGameplay(result.Frame));
|
||||
AetheriaRuntimeDaemonGameSurfaceBuilder.BuildReactiveGameplay(
|
||||
result.Frame,
|
||||
reactiveSurfaceState?.LastPublishedFrame ?? -1));
|
||||
if (reactiveSurfaceState?.Matches(reactiveGameSurface.Version) != true)
|
||||
{
|
||||
await node.MutableDocument<EveSurfaceDocument>(AetheriaRuntimeVerseRecordKeys.DaemonGameReactiveSurface)
|
||||
|
|
@ -3169,6 +3171,8 @@ internal sealed class AetheriaReactiveSurfacePublicationState
|
|||
{
|
||||
private long? _version;
|
||||
|
||||
public long LastPublishedFrame => _version ?? -1;
|
||||
|
||||
public bool Matches(long version) => _version == version;
|
||||
|
||||
public void Set(long version) => _version = version;
|
||||
|
|
|
|||
Loading…
Reference in a new issue