跳转到内容

ReplicationClient

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

Defined in: net/replication/client.ts:123

new ReplicationClient(world, options?): ReplicationClient

Defined in: net/replication/client.ts:148

World

ReplicationClientOptions = {}

ReplicationClient

get connected(): boolean

Defined in: net/replication/client.ts:164

boolean


get connectionId(): number

Defined in: net/replication/client.ts:168

number


get netIds(): NetIds

Defined in: net/replication/client.ts:160

NetIds


get predictionEnabled(): boolean

Defined in: net/replication/client.ts:230

boolean


get serverTick(): number

Defined in: net/replication/client.ts:173

The tick stamped on the newest applied state (server time axis).

number


get table(): ReplicationTable

Defined in: net/replication/client.ts:156

ReplicationTable

applyPending(): void

Defined in: net/replication/client.ts:296

Apply everything received since the last fixed step, in the order it arrived — which is the order the authority sent it. Within one server tick that is already spawn → remove → despawn → state, so a frame never precedes the spawn it references and nothing has to be re-sorted here. With prediction enabled, ends by reconciling every owned entity: live state ← authority copy ⊕ replay of unacknowledged inputs.

void


connect(transport): Promise<void>

Defined in: net/replication/client.ts:185

Handshake over the transport; rejects (and detaches) on any mismatch.

ReliableOrderedTransport

Promise<void>


disconnect(): void

Defined in: net/replication/client.ts:251

void


enablePrediction(options): void

Defined in: net/replication/client.ts:241

Enable (or reconfigure) prediction after construction — the path for game code whose connection a HOST made (the editor’s multiplayer preview connects the client realm itself, options-free): call from a fixed-tick system once the session is a client. Owned entities that already spawned get their authority copies seeded from current state.

PredictionOptions

void


ownsEntity(entity): boolean

Defined in: net/replication/client.ts:285

True when this client’s connection owns the entity (Replicated.owner).

number

boolean


sampleInterpolation(deltaTicks): void

Defined in: net/replication/client.ts:596

Present the buffered state at the trailing render clock. Runs each render frame (PostUpdate); deltaTicks = render delta in tick units.

number

void


sendInput(actions): void

Defined in: net/replication/client.ts:271

Send an input command (typically the InputMap’s evaluated action values, once per fixed tick — with prediction enabled that cadence is the contract, since the server consumes one command per tick). The seq stamp makes stale deliveries harmless. With prediction the command also applies to the owned entities immediately.

Record<string, unknown>

void