public sealed class RealmHostA shard, as the process carrying it sees itself.
Remarks
A realm is a normal Vixen application ([doc 17](../../docs/plan/17-app-heads-and-shipping.md) Model B) built with BuildVariant.Server: headless host, Vixen.Graphics.Null, server content profile. What this adds is everything doc 27 § The realm lists — the spec it booted from, the door, the map's lifetime, the heartbeat, and the one place a control plane is ever called.
⚠ Update is the realm's PreUpdate and runs before the game's own step. The order inside it is load-bearing: answers from the control plane are applied first, so a frame sees a consistent view of decisions taken since the last one; signals are read next, because a drain that arrived should stop admitting before the session is polled; and health is sampled last, over a tick that has actually happened.
⚠ It does not own the game. Replication, RPC, interest and the world belong to the realm's own Session and its systems. This class knows about players only insofar as admission and drain readiness need it to.
Fields and properties (10)
public RealmSpec SpecWhat this shard was told to be.
public ShardState StateWhere it is in its life.
public NetworkSession SessionThe session players connect to.
public PlayerAdmission AdmissionThe door.
public MapLifetime MapThe map.
public RealmDirectory DirectoryThe one place a control plane is called.
public RealmHeartbeat HeartbeatThe health sampler.
public RealmTransfers TransfersEvery transfer this realm is part of, leaving and arriving.
public int PopulationHow many players are on this shard.
public Func<RealmPlayer, TransferReadiness> ReadinessDecides whether a player can be moved right now. Doc 27 § Drain.
Events (5)
public Action<RealmHealth>? SampledRaised every time health is sampled.
public Action<ShardState>? StateChangedRaised when the shard moves through ShardState.
public Action<RealmPlayer>? PlayerAdmittedRaised when a ticketed player finishes joining.
public Action<RealmPlayer>? PlayerReleasedRaised when a player leaves, for any reason.
public Action<SourceTransfer>? FinishedA transfer ended, committed or aborted.
Methods (8)
public RealmHost(RealmSpec spec, Func<PlayerAdmission, NetworkSession> session, TransferTicketSigner? signer = null, RealmHostOptions? options = null)Stands a realm up.
public void Start()Starts listening. The shard is Starting until its map is up.
public void Signal(string line)Hands the realm a line from its launcher.
public int Update(TimeSpan elapsed, SceneManager? scenes = null, ISessionMessageHandler? messages = null)One realm update, before the game's own.
public void Drain()Stops taking arrivals and starts moving people out.
public void Stop()Ends the shard.
public void Dispose()Releases what the realm owns.
public static TransferTicketSigner DevelopmentSigner(RealmSpec spec)A cluster key derived from the shard's own spec, for a realm nobody handed one to.
Used by (8)
- RealmVixen.Live.Realm
- RealmVixen.Live.Realm.Tests
- RealmAppVixen.Live.Realm
- RealmClusterVixen.Live.Realm.Cluster
- RealmClusterTestsVixen.Live.Realm.Cluster.Tests
- RealmFixtureVixen.Live.Realm.Tests
- RealmHostTestsVixen.Live.Realm.Tests
- TransferFleetVixen.Live.Realm.Tests