跳转到内容

ReplicationClient

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

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

new ReplicationClient(world, options?): ReplicationClient

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

World

ReplicationClientOptions = {}

ReplicationClient

get connected(): boolean

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

boolean


get connectionId(): number

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

number


get netIds(): NetIds

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

NetIds


get predictionEnabled(): boolean

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

boolean


get serverTick(): number

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

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

number


get table(): ReplicationTable

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

ReplicationTable

applyPending(): void

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

Apply everything received since the last fixed step. Spawns before state (a frame may reference an entity spawned in the same flush). 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:174

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

NetTransport

Promise<void>


disconnect(): void

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

void


enablePrediction(options): void

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

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:275

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

number

boolean


sampleInterpolation(deltaTicks): void

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

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:261

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