Skip to main content

NetworkSceneManager

A static class in Root.Township, the global namespace.

Static entry point to the running network scene and to which side this process is (server, client or local test).

Fields​

MemberWhat it is
static TaskCompletionSource<bool> SceneLoadWaitCompletes when the network scene has finished starting. The server handler awaits it; it is replaced when the scene shuts down.

Properties​

MemberWhat it is
static INetworkScene Current { get; set; }The running network scene.
static INetworkSceneInternal CurrentInternal { get; set; }Internal interface to the running scene, used by networking code.
static bool IsLocalTest { get; set; }True in local test mode, where the server and a player run in one process.
static bool IsRemoteServer { get; }True on a real server: IsServer and not a local test.
static bool IsServer { get; set; }True on the server, including local test.

Events​

MemberWhat it is
static event Action FinishedEmbeddedSyncRaised on a client once the last embedded scene entity has synced.

Methods​

MemberWhat it is
static void OnSceneSyncFinished()Raises FinishedEmbeddedSync. Called by the scene when embedded sync ends.
static void ServerSendOnly(Stream stream)Stream extension that stops a dedicated server from reading, so the value only flows from server to clients.