NetSession
此内容尚不支持你的语言。
Defined in: net/replication/ReplicationPlugin.ts:22
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new NetSession(
app_):NetSession
Defined in: net/replication/ReplicationPlugin.ts:27
Parameters
Section titled “Parameters”Returns
Section titled “Returns”NetSession
Accessors
Section titled “Accessors”client
Section titled “client”Get Signature
Section titled “Get Signature”get client():
ReplicationClient|null
Defined in: net/replication/ReplicationPlugin.ts:37
Returns
Section titled “Returns”ReplicationClient | null
Get Signature
Section titled “Get Signature”get role():
NetRoleKind
Defined in: net/replication/ReplicationPlugin.ts:29
Returns
Section titled “Returns”server
Section titled “server”Get Signature
Section titled “Get Signature”get server():
ReplicationServer|null
Defined in: net/replication/ReplicationPlugin.ts:33
Returns
Section titled “Returns”ReplicationServer | null
Methods
Section titled “Methods”connect()
Section titled “connect()”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.
Parameters
Section titled “Parameters”transport
Section titled “transport”options?
Section titled “options?”ReplicationClientOptions
Returns
Section titled “Returns”Promise<ReplicationClient>
startServer()
Section titled “startServer()”startServer():
ReplicationServer
Defined in: net/replication/ReplicationPlugin.ts:42
Become the authority. Attach one transport per accepted client.
Returns
Section titled “Returns”stop()
Section titled “stop()”stop():
void
Defined in: net/replication/ReplicationPlugin.ts:71
Returns
Section titled “Returns”void