Skip to main content

LocalNetworkScene

A class in Root.Township, the global namespace.

An offline stand-in network scene for the main menu: it pretends to be the server, starts a dummy local server and a fake socket, and initializes every entity under it locally. Most networking members throw NotImplementedException.

Constructors​

MemberWhat it is
LocalNetworkScene()Unity makes components itself; use AddComponent or spawn a prefab instead of new.

Fields​

2 private and internal fields
MemberWhat it is
private static Logger loggerNLog logger; logs entities that fail to initialize.
private SpawnArea spawnAreaSpawn area returned as RespawnPoint.

Properties​

MemberWhat it is
ConnectionChannel ChunkSyncChannel { get; }Always null.
HashSet<Connection> Connections { get; }Always null; there are no connections.
float DecayMultiplier { get; }Always 1.
List<NetworkEntity> Embedded { get; }List of embedded entities; not filled by this class.
Chunk GlobalChunk { get; }Always null.
bool HasSaveFiles { get; }Always false.
bool IsCustomizationEnabled { get; }Always false.
bool IsServer { get; }Always true.
bool IsSimpleServer { get; set; }Settable flag.
int LoadingCount { get; set; }Count of things still loading.
Transform PlayerFolder { get; }Always null.
SpawnArea RespawnPoint { get; }The spawn area set in the inspector.
SpawnManager Spawner { get; private set; }A LocalSpawnManager, created on Awake.
Transform SpawnPoint { get; }Always null.
float SpawnRateMultiplier { get; }Always 1.
Chunk VoidChunk { get; }Always null.
1 private and internal property
MemberWhat it is
private SceneSerializer Alta.Networking.INetworkSceneInternal.SceneSerializer { get; }Always null; a local scene has no serializer.

Events​

MemberWhat it is
event Action ServerStartedRaised once every entity under the scene has been initialized on Start.

Methods​

MemberWhat it is
void AddConnection(Connection connection)Not supported; throws.
void DestroyAllEntities()Destroys every network entity under the scene through the spawner.
uint ForceRegisterEntity(NetworkEntity entity)Returns 0 without registering; the overload with an identifier throws.
void ForceRegisterEntity(NetworkEntity entity, uint identifier)Returns 0 without registering; the overload with an identifier throws.
NetworkEntity GetEntity(uint identifier)Not supported; throws.
void HandleSync(uint embeddedIndex, uint identifier, uint[] embedded)Not supported; throws.
Task Initialize(ISocket socket, Action<string> statusCallback)Not supported; throws.
void InitializeEntity(NetworkEntity entity, bool isSettingOwned)Initializes an entity and its children as server, or waits until its object is active.
void InitialSyncEntities(Player target)Not supported; throws.
void MarkSerialized(NetworkEntity entity, EntitySerializer serializer)Does nothing.
void PrepareSerializeEntities()Not supported; throws.
void SendSerialized(ISocket socket)Not supported; throws.
void Serialize(Stream stream, Player player, ref int startIndex)Not supported; throws.
void SerializeAsClient(NetworkEntity entity)The one-argument version does nothing; the two-argument one throws.
void SerializeAsClient(NetworkEntity entity, bool isAdding = true)The one-argument version does nothing; the two-argument one throws.
void SerializeEntity(EntitySerializer entitySerializer, Stream stream, bool isSendingAll)Not supported; throws.
4 private and internal methods
MemberWhat it is
private void Awake()Makes this the current scene, marks it as server, starts a dummy local server and sets a fake socket.
private void OnDestroy()Stops the dummy local server.
private void SetAllItemsToNotNetwork()Turns networking off on every child interactable, initializes every child entity as owned, then raises ServerStarted.
private void Start()Calls SetAllItemsToNotNetwork.

Used in​

Members of other types that take, return or hold a LocalNetworkScene: