跳转到内容

ReplicationServer

此内容尚不支持你的语言。

Defined in: net/replication/server.ts:82

new ReplicationServer(world): ReplicationServer

Defined in: net/replication/server.ts:98

World

ReplicationServer

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.

number[]


get connectionCount(): number

Defined in: net/replication/server.ts:115

number


get netIds(): NetIds

Defined in: net/replication/server.ts:111

NetIds


get table(): ReplicationTable

Defined in: net/replication/server.ts:107

Lazily built so components defined after plugin install still count.

ReplicationTable

attachConnection(transport): number

Defined in: net/replication/server.ts:150

Accept a transport (server-side end of one client link).

NetTransport

number


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.

number

void


detachConnection(id): void

Defined in: net/replication/server.ts:188

number

void


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.

number

ReplInputMsg | null


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.

number

void


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.

InterestPolicy | null

void


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.

number

ReplInputMsg | null