Table of Contents

Class SubscriptionsSessions

Namespace
Typhon.Engine
Assembly
Typhon.Engine.dll

Session kinds, admission and the tick-visible session lifecycle.

public sealed class SubscriptionsSessions
Inheritance
SubscriptionsSessions
Inherited Members

Remarks

A kind is a name the engine never interprets. It arrives in HELLO, is checked against this list before anything else runs, and is handed to the application's admission hook. Declaring the set is what lets an unknown kind be refused before a single application delegate is called.

Properties

Admit

The application's admission hook, run once per connecting client on the transport thread that decoded its HELLO.

public AdmitHandler Admit { get; set; }

Property Value

AdmitHandler

Remarks

An undeclared kind never reaches it. The kind is checked against DeclaredKinds first and refused with AuthenticationRejected, so a hook only ever sees names the application itself declared and does not have to defend against arbitrary strings from the network.

Leaving it unset admits everyone as a Spectator, with the operator's limits. That is the least a session can do, so a server that forgets to write a hook is permissive about who connects and restrictive about what they may do — the opposite default would let a forgotten line of configuration hand world-changing commands to anyone who found the port.

Unlike a declaration, it stays settable after Start. The registry freezes because its declarations are compiled once into a catalog clients negotiate against; this is read fresh on every connection and compiles into nothing, so swapping it — a maintenance mode that refuses new players, a hot-reloaded policy — is correct rather than a late declaration that would silently not apply.

Published, because that swap is the documented use. It is written on whatever thread decides to change policy and read on every transport thread that decodes a HELLO. A plain auto-property would let a reader keep the old delegate indefinitely on arm64 — where a store is not ordered against another core's loads without a release — so a maintenance mode could go on admitting players after it was switched on. The pair of accessors below is the release/acquire that makes the swap take effect for the next connection.

DeclaredKinds

The declared session kinds, in declaration order. They are exported in the catalog.

public IReadOnlyList<string> DeclaredKinds { get; }

Property Value

IReadOnlyList<string>

IsFrozen

Whether the runtime has started and this surface is closed to further declaration.

public bool IsFrozen { get; }

Property Value

bool

SessionEvents

This tick's session lifecycle, read by application systems in Engine-Pre.

public SessionEvents SessionEvents { get; }

Property Value

SessionEvents

Remarks

Sessions open and close on transport threads, at moments that have nothing to do with the tick. This is where that becomes something an application can act on with an ordinary transaction: the events are collected as they happen and handed to the tick as one immutable batch, so possessing an avatar on Opened and releasing it on Closed is normal system code rather than a callback on somebody else's thread.

Methods

Kinds(params string[])

Declares the session kinds clients may present.

public SubscriptionsSessions Kinds(params string[] kinds)

Parameters

kinds string[]

The kind names.

Returns

SubscriptionsSessions

This surface.