ReplicationClient
此内容尚不支持你的语言。
Defined in: net/replication/client.ts:114
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new ReplicationClient(
world,options?):ReplicationClient
Defined in: net/replication/client.ts:137
Parameters
Section titled “Parameters”options?
Section titled “options?”ReplicationClientOptions = {}
Returns
Section titled “Returns”ReplicationClient
Accessors
Section titled “Accessors”connected
Section titled “connected”Get Signature
Section titled “Get Signature”get connected():
boolean
Defined in: net/replication/client.ts:153
Returns
Section titled “Returns”boolean
connectionId
Section titled “connectionId”Get Signature
Section titled “Get Signature”get connectionId():
number
Defined in: net/replication/client.ts:157
Returns
Section titled “Returns”number
netIds
Section titled “netIds”Get Signature
Section titled “Get Signature”get netIds():
NetIds
Defined in: net/replication/client.ts:149
Returns
Section titled “Returns”NetIds
predictionEnabled
Section titled “predictionEnabled”Get Signature
Section titled “Get Signature”get predictionEnabled():
boolean
Defined in: net/replication/client.ts:218
Returns
Section titled “Returns”boolean
serverTick
Section titled “serverTick”Get Signature
Section titled “Get Signature”get serverTick():
number
Defined in: net/replication/client.ts:162
The tick stamped on the newest applied state (server time axis).
Returns
Section titled “Returns”number
Get Signature
Section titled “Get Signature”get table():
ReplicationTable
Defined in: net/replication/client.ts:145
Returns
Section titled “Returns”ReplicationTable
Methods
Section titled “Methods”applyPending()
Section titled “applyPending()”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.
Returns
Section titled “Returns”void
connect()
Section titled “connect()”connect(
transport):Promise<void>
Defined in: net/replication/client.ts:174
Handshake over the transport; rejects (and detaches) on any mismatch.
Parameters
Section titled “Parameters”transport
Section titled “transport”Returns
Section titled “Returns”Promise<void>
disconnect()
Section titled “disconnect()”disconnect():
void
Defined in: net/replication/client.ts:239
Returns
Section titled “Returns”void
enablePrediction()
Section titled “enablePrediction()”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.
Parameters
Section titled “Parameters”options
Section titled “options”Returns
Section titled “Returns”void
ownsEntity()
Section titled “ownsEntity()”ownsEntity(
entity):boolean
Defined in: net/replication/client.ts:275
True when this client’s connection owns the entity (Replicated.owner).
Parameters
Section titled “Parameters”entity
Section titled “entity”number
Returns
Section titled “Returns”boolean
sampleInterpolation()
Section titled “sampleInterpolation()”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.
Parameters
Section titled “Parameters”deltaTicks
Section titled “deltaTicks”number
Returns
Section titled “Returns”void
sendInput()
Section titled “sendInput()”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.
Parameters
Section titled “Parameters”actions
Section titled “actions”Record<string, unknown>
Returns
Section titled “Returns”void