Nebula
Gateway

NebulaAdmission

The hook that decides what happens when an interaction domain is full.

generated from the sources
public static class NebulaAdmission

The hook that decides what happens when an interaction domain is full. Nebula measures and reports; whether this player gets in anyway - a party member of somebody inside, a staff account, the last member of a raid group - is the game's business and nothing the mesh can guess.

A static, because there is one answer per process and the decision must not depend on which gateway object a game happened to reach; the same reasoning as ScopeLifecycle.ShouldRetire. Consulted on every join and every prepared transfer into a target whose capacity says at-capacity, and on every one of them when AlwaysConsult is set. A policy that throws is logged and read as AdmissionAction.Reject: the failure mode of a wrong answer here is a collapsed tick for everyone already inside. Design record: docs/capacity-admission.md.

Fields

Decide

public static AdmissionPolicy Decide = RejectWhenAtCapacity;

The policy. Defaults to RejectWhenAtCapacity; setting it to null restores that.

AlwaysConsult

public static bool AlwaysConsult;

Consult Decide for every join and transfer, not only for the ones into a saturated target. Off by default: a hook that is asked about every arrival is a hook on the hot path of every join, and a game that only wants to say "let staff into a full station" should not pay for it.

Properties

PolicyErrors

public static int PolicyErrors { get; }

Exceptions thrown by Decide since this process started. Anything but zero means the game is not deciding what it thinks it is.

Methods

RejectWhenAtCapacity

public static AdmissionDecision RejectWhenAtCapacity(in AdmissionRequest request);

The default: refuse an arrival into a target that is at capacity, and admit everything else.

Ask

public static AdmissionDecision Ask(in AdmissionRequest request, string context = null);

Ask the policy, catching whatever it throws. context names the caller in the log line. Returns the decision; a target that is not at capacity and AlwaysConsult off is admitted without calling anything.

DefaultReason

public static string DefaultReason(in CapacityInfo capacity);

Nebula's own sentence for a refusal, used when the policy gives none.

Reset

public static void Reset();

Restore the defaults. For tests and for a process that reloads game code.

On this page