跳转到内容

NetSession

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

Defined in: net/replication/ReplicationPlugin.ts:22

new NetSession(app_): NetSession

Defined in: net/replication/ReplicationPlugin.ts:27

App

NetSession

get client(): ReplicationClient | null

Defined in: net/replication/ReplicationPlugin.ts:37

ReplicationClient | null


get role(): NetRoleKind

Defined in: net/replication/ReplicationPlugin.ts:29

NetRoleKind


get server(): ReplicationServer | null

Defined in: net/replication/ReplicationPlugin.ts:33

ReplicationServer | null

connect(transport, options?): Promise<ReplicationClient>

Defined in: net/replication/ReplicationPlugin.ts:56

Become a replica: handshake over the given transport. The role commits SYNCHRONOUSLY — from this call on, the session never simulates as the authority, even while the handshake is still in flight. (A role that only flipped on completion let authority-gated systems run for the first few ticks of a client realm and spawn local state that then lingered beside the replicated ghosts.) A failed handshake reverts to offline.

NetTransport

ReplicationClientOptions

Promise<ReplicationClient>


startServer(): ReplicationServer

Defined in: net/replication/ReplicationPlugin.ts:42

Become the authority. Attach one transport per accepted client.

ReplicationServer


stop(): void

Defined in: net/replication/ReplicationPlugin.ts:71

void