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.
- Listed in Global namespace: I to L
- Inherits or implements
MonoBehaviour,INetworkScene,INetworkSceneInternal,IEntityManager - Nested types
InitializeOnAwake
Constructors
| Member | What it is |
|---|---|
LocalNetworkScene() | Unity makes components itself; use AddComponent or spawn a prefab instead of new. |
Fields
2 private and internal fields
| Member | What it is |
|---|---|
private static Logger logger | NLog logger; logs entities that fail to initialize. |
private SpawnArea spawnArea | Spawn area returned as RespawnPoint. |
Properties
| Member | What 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
| Member | What it is |
|---|---|
private SceneSerializer Alta.Networking.INetworkSceneInternal.SceneSerializer { get; } | Always null; a local scene has no serializer. |
Events
| Member | What it is |
|---|---|
event Action ServerStarted | Raised once every entity under the scene has been initialized on Start. |
Methods
| Member | What 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
Used in
Members of other types that take, return or hold a LocalNetworkScene: