Vixen
c7401864
csharp
public sealed class SocialBridge

Doc 28's social rules against doc 27's IGuildGrain: answered in the frame, written down afterwards, and never awaited.

Read the guide page for this →

Remarks

LedgerBridge's and LockoutBridge's shape — ISocialStore is synchronous because a guild-chat line and a party invite both ask it mid-frame, and ADR-016 forbids awaiting the grain that owns the answer. So it is answered from a view and the change is posted.

⚠ The roster this realm holds is only the members it can name, and a 500-member guild has maybe thirty of them online. A gameplay PlayerId is a session id widened (see From), so somebody who is not connected to this realm has no gameplay id at all and cannot be seated. That is not a defect to engineer around — it is the same partial view LedgerBridge already keeps of a balance — but it makes one thing lethal: a partial roster must never be written back as the whole truth, or the write deletes everybody who was offline.

⚠ So a guild is written as operations, and there is no state-shaped save. SaveGuild is implemented and counted rather than obeyed — see the remarks on it — because a diff of two rosters has thrown away who did it, and every IGuildGrain method needs an actor since every guild rule is about authority. Invite, Kick, Promote and Rename are the path that keeps the actor.

⚠ GuildOf has LockoutBridge's cold-read problem. Returning None for somebody whose guild was never loaded reads as "in no guild", which admits them to a rival's guild chat and drops the tag their hall's permissions hang off. The interface cannot say "I do not know", so IsWarm is what a caller checks and a cold read is counted and raised.

⚠ The local checks are optimism and the grain re-checks everything. A cap of 500 measured against thirty seated members will say yes when the guild is full. That is LedgerBridge's trade exactly: the frame is answered, the grain is the authority, and the disagreement is counted in Divergences.

Fields and properties (8)

  • public int Guilds

    How many guilds the view holds.

  • public int Warm

    How many players have had their guild resolved.

  • public int Pending

    How many guild edits are waiting.

  • public int PendingGraphs

    How many graph writes are waiting.

  • public int ColdReads

    How many times somebody's guild or graph was asked about who had never been loaded. Never anything but zero.

  • public int Divergences

    How many queued edits the grain refused after the view had allowed them.

  • public int StateWrites

    How many times a guild was saved by state rather than by operation.

  • public SocialGraphs Graphs

    Every graph this realm holds, which is what makes a block mean anything.

Events (2)

  • public Action<PlayerId>? Cold

    Raised when a guild or a graph is read for somebody who was never loaded.

  • public Action<GuildEdit>? Refused

    Raised when the grain refused an edit the view had already applied.

Methods (20)

Used by (6)

  • MmoRealmMmo.Realm
  • RealmTestsMmo.Realm.Tests
  • ShardMmo.Soak
  • SoakMmo.Soak
  • HousekeepingTestsVixen.Live.Gameplay.Tests
  • SocialBridgeTestsVixen.Live.Gameplay.Tests