Skip to main content

StreamerHelper

A static class in Root.Township, Alta.Chunks.

Helpers for writing and reading prefabs in chunk saves (hash, position, rotation, scale, then the prefab's own data), with guards for broken positions.

Fields​

MemberWhat it is
const int CapPositionYHeight (-15000) below which a saved object counts as fallen out of the world.
1 private and internal field
MemberWhat it is
private static Logger loggerNLog logger for this class.

Methods​

MemberWhat it is
static IEnumerator DelayDestroy(NetworkEntity entity) (iterator)At end of frame, sends the entity to its last holder's postbox if a player held it, otherwise destroys it.
static void LoadSetupRecursive(NetworkEntity entity)Runs LoadSetup on every ISavableFull component of the entity and its children, children first.
static void SerializeEmpty(Stream stream, ChunkVersioning chunkVersioning)Writes an empty prefab entry (hash 0).
static void SerializePrefab(INetworkScene scene, ChunkVersioning chunkVersioning, NetworkEntity parent, NetworkPrefab prefab, Stream stream)Saves or loads one prefab. On save, a NaN or below CapPositionY object is dropped from the save and destroyed or posted.
static void WritePositionlessPrefab(INetworkScene scene, ChunkVersioning chunkVersioning, NetworkEntity parent, NetworkPrefab prefab, Stream stream)Writes a prefab with a zero position, identity rotation and scale 1.
1 private and internal method
MemberWhat it is
private static async void PostToPlayer(NetworkEntity entity, int playerId)Pushes the entity into a player's postbox and logs a warning.