OptionalisInternalConstructor: booleanGets the active scene.
Sets the connection approval callback.
Gets the active context.
Returns the port the host is listening on (0 if not hosting).
Returns true if this node is the authority (host or dedicated).
Returns true if the session is active (hosting or connected).
Returns the local connection ID.
Gets the mode of the session.
Returns the number of connected peers.
The peer count (0 if not hosting).
Returns the connected peers.
The currently connected peers.
Returns the current server time estimate (epoch ms).
Returns the session ID.
Returns information about a specific peer.
Connection ID of the peer.
Peer info if found, or empty if not found.
Initiates a scene transition for all connected peers (host only).
The scene resource to load and instance.
Optionalseamless: booleanIf true, preserve non-scene objects during transition.
Joins an existing session as a client.
Join request with session details.
Address of the host to connect to.
True if connection attempt started.
Notifies the server that scene loading is complete. Client only.
The scene instance that was loaded.
Optionalsuccess: booleanTrue if scene loaded successfully.
OptionalerrorMessage: stringError message if loading failed.
Sends a Multicast RPC to specified clients (host only).
The name of the RPC to invoke.
The network object ID of the target instance.
Serialized argument payload.
The target client connection IDs.
async operation
Sends a Client RPC to a specific connection (host only).
The name of the RPC to invoke.
The network object ID of the target instance.
Serialized argument payload.
The target client connection ID.
async operation
Sends a Server RPC to the host (client only).
The name of the RPC to invoke.
The network object ID of the target instance.
Serialized argument payload.
async operation
Sends a Client RPC to the owner of a network object (host only).
The name of the RPC to invoke.
The network object ID to find the owner for.
Serialized argument payload.
async operation
Starts hosting a session on the default port.
Project identifier.
Session identifier.
Build hash for version validation.
True if hosting started successfully.
Starts hosting a session on a specific port.
Project identifier.
Session identifier.
Build hash for version validation.
TCP port to listen on.
True if hosting started successfully.
ReadonlyonEvent triggered when a new peer connects. Host only.
ReadonlyonEvent triggered when a peer disconnects. Host only.
ReadonlyonEvent triggered when the session starts successfully. Both host and client.
For the host, this event is triggered once the session is ready to accept connections. For the client, this event is triggered once the client has successfully joined the session.
ReadonlyonEvent triggered when the session is stopped or disconnected. Both host and client.
For the host, this event is triggered when hosting stops and all clients are disconnected. For the client, this event is triggered when the client is disconnected from the host.
ReadonlyonEvent triggered when joining a session fails. Client only.
This event is triggered if the client fails to join the session, a reason is provided but the session is not connected.
ReadonlyonEvent triggered when the server requests a scene load. Client only.
ReadonlyonEvent triggered when the scene should activate. Client only.
This event is triggered once the client has loaded the scene and the server switches to active game play.
ReadonlyonEvent triggered when the GameState was replicated. Client only.
ReadonlyonEvent triggered when the PlayerState of the current client was replicated. Client only.
ReadonlyonEvent triggered when an object was replicated. Client only.
ReadonlyonEvent triggered when all clients have loaded the scene. Host only.
ReadonlyonEvent triggered when a peer completes scene loading.
This event should be used to track when clients are ready. The server will send a scene activate message to the client in an active scene, or wait until all clients are ready to activate the scene for everyone. If the scene is already active, the server will immediately send the activate message to the client upon receiving this event.
ReadonlyonEvent triggered when a peer is activated in the scene upon completion of loading.
The event is after the host completes the scene transition internally, but before the OnSceneTransitionComplete event is
sent.
If the scene is already active, the event is triggered immediately after the client completes loading and is activated.
It's important to distinguish this from OnPeerSceneLoadComplete, which is triggered as soon as the client finishes loading the scene,
This event can also be triggered on a stale client that did not finish loading the scene in time, but the server decided to transition to active state.
Manages a networked session with multiple peer connections.
Usage: - Call StartHost() to begin accepting connections. - Call JoinSession() to connect to an existing host. - Call Update() every frame to process network events. - Subscribe to events to handle connections and disconnections.
Note
NetSessionManager is the main entry point for networking. It handles hosting/joining sessions, managing connected peers, and routing messages between them.