Table of Contents

Class SessionLimits

Namespace
Typhon.Engine
Assembly
Typhon.Engine.dll

The per-session ceilings an application's admission hook hands back with a role. Every value left at zero means "use the operator's SubscriptionsOptions value", so a limit is stated in exactly one place unless a session genuinely needs a different one.

public sealed record SessionLimits : IEquatable<SessionLimits>
Inheritance
SessionLimits
Implements
Inherited Members

Remarks

These bound one connection; SubscriptionsOptions bounds the server. Raising a session's frame size cannot raise the frame pool's budget, and a session that asks for more than the operator allows gets the operator's number. That ordering is what makes admission safe to write against untrusted input: the worst an application hook can do is be generous within rails it does not control.

A record, so an application derives one preset from another with with instead of repeating every field.

Constructors

SessionLimits()

public SessionLimits()

Fields

DefaultMaxObservers

The engine's default observer count: near, far, and two spare. It is the same number ObserversPerSession ships with, and it is what a profile's own ceiling starts at — a session's limit is resolved against the operator's value, never against this.

public const int DefaultMaxObservers = 4

Field Value

int

Properties

AllowDebug

Whether this session may be granted the DEBUG capability — engine-defined diagnostic blocks that expose grid, cluster and migration internals. Off by default because that is server structure, not game state.

public bool AllowDebug { get; init; }

Property Value

bool

BytesPerSecond

The outbound byte budget, in bytes per second. Zero means no per-session budget — the frame ceiling and the enter budget still apply. Within a budget records are deferred by priority and never dropped, so a small number slows a view down rather than corrupting it.

public int BytesPerSecond { get; init; }

Property Value

int

ClientMessageBytes

Largest message this session may send, in bytes. Zero takes ClientMessageBytes.

public int ClientMessageBytes { get; init; }

Property Value

int

Default

Every limit at its operator default, and no debug. What an Accept with no limits means.

public static SessionLimits Default { get; }

Property Value

SessionLimits

FrameBytes

Largest frame this session may be sent, in bytes. Zero takes FrameBytes.

public int FrameBytes { get; init; }

Property Value

int

God

The tooling preset: operator defaults, plus the DEBUG capability. For an inspector, a recorder or a spectator bot the operator runs — anything that is allowed to see how the server is arranged, not only what it simulates.

public static SessionLimits God { get; }

Property Value

SessionLimits

MaxKnownEntities

Known entities this session may hold. Zero takes KnownEntitiesPerSession.

public int MaxKnownEntities { get; init; }

Property Value

int

MaxObservers

How many observers this session may hold at once. Zero takes ObserversPerSession. An observer is a query per tick, so this is the knob that bounds a session's query cost rather than its bandwidth — and, like every other limit here, it is resolved against the operator's value rather than being taken at face value.

public int MaxObservers { get; init; }

Property Value

int

Methods

Equals(object?)

public override bool Equals(object? obj)

Parameters

obj object

Returns

bool

Equals(SessionLimits?)

public bool Equals(SessionLimits? other)

Parameters

other SessionLimits

Returns

bool

GetHashCode()

public override int GetHashCode()

Returns

int

ToString()

public override string ToString()

Returns

string

Operators

operator ==(SessionLimits?, SessionLimits?)

public static bool operator ==(SessionLimits? left, SessionLimits? right)

Parameters

left SessionLimits
right SessionLimits

Returns

bool

operator !=(SessionLimits?, SessionLimits?)

public static bool operator !=(SessionLimits? left, SessionLimits? right)

Parameters

left SessionLimits
right SessionLimits

Returns

bool