Centralize CultMesh authority resolution

This commit is contained in:
Meta Vens 2026-07-13 14:00:26 +01:00
commit fb24e30ab6
6 changed files with 547 additions and 73 deletions

View file

@ -28,6 +28,12 @@ namespace GameCult.Mesh
/// </summary>
public CultMeshAuthorityLeaseCatalog? AuthorityLeases { get; set; }
/// <summary>
/// Gets or sets the sole authority resolver used by the session. When omitted, the
/// session installs a deny-by-default resolver over <see cref="AuthorityLeases"/>.
/// </summary>
public CultMeshAuthorityResolver? AuthorityResolver { get; set; }
/// <summary>
/// Gets or sets simulation consensus options.
/// </summary>
@ -68,6 +74,7 @@ namespace GameCult.Mesh
VerseCatalog = options.VerseCatalog ?? new CultMeshVerseCatalog();
PeerCatalog = options.PeerCatalog ?? new CultMeshPeerCatalog();
AuthorityLeases = options.AuthorityLeases ?? new CultMeshAuthorityLeaseCatalog();
AuthorityResolver = options.AuthorityResolver ?? CultMeshAuthorityResolver.CreateDenyByDefault(AuthorityLeases);
ObservationHub = new CultNetSimulationObservationHub(options.ConsensusOptions);
FactCommitter = new CultMeshSimulationFactCommitter(Node.Database);
@ -117,6 +124,9 @@ namespace GameCult.Mesh
/// </summary>
public CultMeshAuthorityLeaseCatalog AuthorityLeases { get; }
/// <summary>Gets the session authority decision owner.</summary>
public CultMeshAuthorityResolver AuthorityResolver { get; }
/// <summary>
/// Gets the session simulation observation hub.
/// </summary>