SpawnIndex
A class in Root.Township, Alta.Networking.
Per-entity counter that orders spawns and despawns, so clients drop destroy messages that are older than the entity's latest spawn.
- Listed in Networking and servers
Constructors
| Member | What it is |
|---|---|
SpawnIndex() | Creates a SpawnIndex with default values. |
Fields
2 private and internal fields
Properties
| Member | What it is |
|---|---|
uint DespawningIndex { get; } | Returns the current index and marks that a despawn happened, so the next spawn gets a higher index. |
uint Index { get; set; } | The current spawn index. DestroyMessage ignores a destroy whose index is lower than this. |
uint SpawningIndex { get; } | Returns the index for a new spawn, adding one if there was a despawn. The despawn flag is never cleared, so every read after one adds one. |
Methods
| Member | What it is |
|---|---|
static void SerializeIndex(Stream stream, ref uint index) | Reads or writes an index on the stream in a compact form. |
Used in
Members of other types that take, return or hold a SpawnIndex: