ReplicationServer
Defined in: net/replication/server.ts:82
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new ReplicationServer(
world):ReplicationServer
Defined in: net/replication/server.ts:98
Parameters
Section titled “Parameters”Returns
Section titled “Returns”ReplicationServer
Accessors
Section titled “Accessors”clientIds
Section titled “clientIds”Get Signature
Section titled “Get Signature”get clientIds():
number[]
Defined in: net/replication/server.ts:121
Ready (handshaken) connection ids. Gameplay polls this each fixed tick to provision/retire per-player entities — no callback wiring needed.
Returns
Section titled “Returns”number[]
connectionCount
Section titled “connectionCount”Get Signature
Section titled “Get Signature”get connectionCount():
number
Defined in: net/replication/server.ts:115
Returns
Section titled “Returns”number
netIds
Section titled “netIds”Get Signature
Section titled “Get Signature”get netIds():
NetIds
Defined in: net/replication/server.ts:111
Returns
Section titled “Returns”NetIds
Get Signature
Section titled “Get Signature”get table():
ReplicationTable
Defined in: net/replication/server.ts:107
Lazily built so components defined after plugin install still count.
Returns
Section titled “Returns”ReplicationTable
Methods
Section titled “Methods”attachConnection()
Section titled “attachConnection()”attachConnection(
transport):number
Defined in: net/replication/server.ts:150
Accept a transport (server-side end of one client link).
Parameters
Section titled “Parameters”transport
Section titled “transport”Returns
Section titled “Returns”number
beginTick()
Section titled “beginTick()”beginTick(
fixedDelta):void
Defined in: net/replication/server.ts:220
Start a fixed tick: dequeue each connection’s next input command (the
plugin calls this in FixedPreUpdate, before gameplay). fixedDelta is
remembered for the handshake so clients replay with the server’s dt.
Parameters
Section titled “Parameters”fixedDelta
Section titled “fixedDelta”number
Returns
Section titled “Returns”void
detachConnection()
Section titled “detachConnection()”detachConnection(
id):void
Defined in: net/replication/server.ts:188
Parameters
Section titled “Parameters”number
Returns
Section titled “Returns”void
inputOf()
Section titled “inputOf()”inputOf(
connectionId):ReplInputMsg|null
Defined in: net/replication/server.ts:199
The latest input command a connection sent (null before the first). Gameplay reads this in FixedUpdate and applies it to the entities the connection owns (Replicated.owner). Latest-persists: a held command applies every tick until replaced.
Parameters
Section titled “Parameters”connectionId
Section titled “connectionId”number
Returns
Section titled “Returns”ReplInputMsg | null
sample()
Section titled “sample()”sample(
tick):void
Defined in: net/replication/server.ts:231
One replication tick: spawns/despawns on the control plane, dirty fields as binary delta frames (one shared broadcast without a policy, one filtered frame per connection with one). Runs in FixedPostUpdate.
Parameters
Section titled “Parameters”number
Returns
Section titled “Returns”void
setInterestPolicy()
Section titled “setInterestPolicy()”setInterestPolicy(
policy):void
Defined in: net/replication/server.ts:145
Install (or replace / remove) the interest policy. With a policy, each ready connection only receives the entities the policy deems relevant to it; an entity entering a connection’s interest arrives as a full spawn, one leaving despawns its client ghost. Entities a connection owns are always relevant to it regardless of the policy. Safe to change mid-session: the next sample tick reconciles every connection’s ghost set against the new policy.
Parameters
Section titled “Parameters”policy
Section titled “policy”InterestPolicy | null
Returns
Section titled “Returns”void
tickInputOf()
Section titled “tickInputOf()”tickInputOf(
connectionId):ReplInputMsg|null
Defined in: net/replication/server.ts:211
The input command dequeued for THIS fixed tick — each command is consumed exactly once, in order, one per tick (beginTick); when the queue runs dry the last command repeats (network jitter must not stall a held input). This is the accessor prediction-grade gameplay applies in FixedUpdate: the server acknowledges the consumed seq, and the client replays exactly the unacknowledged commands, one tick each.
Parameters
Section titled “Parameters”connectionId
Section titled “connectionId”number
Returns
Section titled “Returns”ReplInputMsg | null