NetworkEntityLink
A class in Root.Township, Alta.Networking.
One slot in the entity manager's fixed table of 100,000 entity identifiers. On the server, slots are also chained into linked lists of empty, full and serialized slots so free identifiers and synced entities can be walked quickly.
- Listed in Networking and servers
Constructors
| Member | What it is |
|---|---|
NetworkEntityLink(uint index) | Creates a NetworkEntityLink from index, previous and next. |
NetworkEntityLink(uint index, NetworkEntityLink previous) | Creates a NetworkEntityLink from index, previous and next. |
NetworkEntityLink(uint index, NetworkEntityLink previous, NetworkEntityLink next) | Creates a NetworkEntityLink from index, previous and next. |
Fields
| Member | What it is |
|---|---|
uint Index | The entity identifier this slot stands for. |
bool IsEmpty | True if no entity holds this slot. |
bool IsFake | True for the placeholder slots set up every 50 entries, probably so list walks never run long. |
bool IsSerialized | True if the entity in the slot has a serializer and is in the serialized list. |
static int LinksWithEntities | Count of slots that hold an entity, across all tables. |
NetworkEntity NetworkEntity | The entity in the slot, or null. |
NetworkEntityLink NextEmpty | Next empty slot (server). |
NetworkEntityLink NextFull | Next full slot (server). |
NetworkEntityLink NextSerialized | Next serialized slot (server). |
NetworkEntityLink PreviousEmpty | Previous empty slot (server). |
NetworkEntityLink PreviousFull | Previous full slot (server). |
NetworkEntityLink PreviousSerialized | Previous serialized slot (server). |
EntitySerializer Serializer | The entity's serializer, once marked serialized. |
Methods
| Member | What it is |
|---|---|
void Empty(bool isServer, NetworkEntityLink[] links) | Clears the slot. On the server it also unlinks it from the full and serialized lists and adds it to the empty list. |
bool Fill(bool isServer, NetworkEntity entity, NetworkEntityLink[] links) | Puts an entity in the slot. On the server it moves the slot from the empty list to the full list; refuses if already full. |
void MakeFake(bool isEmpty, NetworkEntityLink[] links) | Turns the slot into a placeholder, empty or full. |
void MarkFirstFakeAsSerialized() | Marks slot 0 as the head of the serialized list. Only valid on a fake slot. |
void MarkSerialized(bool isServer, EntitySerializer serializer) | Records the entity's serializer. On the server it also links the slot into the serialized list. |
2 private and internal methods
| Member | What it is |
|---|---|
private static void DeregisterEntity(NetworkEntity entity) | Decrements LinksWithEntities when a link is emptied of a real entity. |
private static void RegisterEntity(NetworkEntity entity) | Increments LinksWithEntities when a link is filled with a real entity. |
Used in
Members of other types that take, return or hold a NetworkEntityLink:
ClientSerializedEnumerable.ClientSerializedEnumerable, ClientSerializedEnumerable.pairEnumerator, ClientSerializedEnumerable.pairs, EntityManager.clientSerialized, EntityManager.Empty, EntityManager.entities, EntityManager.Fill, EntityManager.GetLink, EntityManager.GetNextLink, EntityManager.nextSpawn, EntityManager.preparedLinks, ILinkProvider.Empty, ILinkProvider.Fill, ILinkProvider.GetLink, ILinkProvider.GetNextLink, SerializedEnumerable.current, SerializedEnumerable.links, SerializedEnumerable.next, SerializedEnumerable.SerializedEnumerable, SpawnManager.SpawnExisting, SpawnManager.SpawnLocal, LocalLinkProvider.Empty, LocalLinkProvider.Fill, LocalLinkProvider.GetLink, LocalLinkProvider.GetNextLink.