Class PlotFoundation.Registry
Every foundation currently alive, grouped by the loaded scene it belongs to.
public static class PlotFoundation.Registry
- Inheritance
-
PlotFoundation.Registry
- Inherited Members
Remarks
Keyed by the scene manager's handle, which identifies one loaded copy of a scene inside this process. Scene name alone will not do: a scene server may host scenes for several world servers at once, and each world's copy is its own land with its own owners. The handle is what the housing system resolves back to a world server.
The handle is a process-local identifier and is never persisted or sent anywhere —
see ISceneInstanceDetails.Handle. It is used here only to group objects that are
alive in this process right now.
Properties
Scenes
Every loaded scene that currently has at least one foundation.
public static IReadOnlyCollection<int> Scenes { get; }
Property Value
Methods
ForPlot(long)
Every live copy of one plot, across every loaded channel.
public static List<PlotFoundation> ForPlot(long plotID)
Parameters
plotIDlong
Returns
Remarks
Deliberately plural. Channels are several loaded copies of the same scene, and a plot is one row shared between all of them — so a grant, a revocation or a change of state arrives naming a plot and has to reach every copy. Applying it to the first match would leave the same house locked in one channel and open in the next.
A linear walk, because the count is small: this is the foundations authored into the scenes one server happens to be hosting, not the world's land. Indexing them by plot ID would mean an index that has to be maintained through resolution, re-resolution and scene unload for a lookup that runs when somebody changes a permission.
ForScene(int)
The foundations in one loaded scene, or an empty list when there are none.
public static IReadOnlyList<PlotFoundation> ForScene(int sceneHandle)
Parameters
sceneHandleint
Returns
Register(PlotFoundation)
Adds a foundation to its scene's set.
public static void Register(PlotFoundation foundation)
Parameters
foundationPlotFoundation
RequestClaim(IPlayerCharacter, IPlotFoundation)
Raises OnClaimRequested.
public static void RequestClaim(IPlayerCharacter player, IPlotFoundation foundation)
Parameters
playerIPlayerCharacterfoundationIPlotFoundation
Unregister(PlotFoundation)
Removes a foundation, and forgets the scene once its last one is gone.
public static void Unregister(PlotFoundation foundation)
Parameters
foundationPlotFoundation
Events
OnClaimRequested
Raised when a player asks to claim a foundation.
public static event Action<IPlayerCharacter, IPlotFoundation> OnClaimRequested
Event Type
Remarks
An event rather than a direct call because claiming needs the database, and the database lives behind a server behaviour that shared code cannot reference. The housing system subscribes; when it is absent — a client, or a server with housing off — nothing is listening and the request is simply dropped.
OnSceneGainedFoundations
Raised when a foundation joins a loaded scene that had none, so the housing system knows there is land here that may not have been registered with the database yet.
public static event Action<int> OnSceneGainedFoundations