Core
SyncStateCodec
Envelope shared by the per-tick sync stream (EntityState/GhostSyncState messages) and the spawn snapshot: [count]{[behaviourIndex][flags][len:ushort][chunk]}.
generated from the sources
Static class in namespace
Nebula · Packages/com.1by3.nebula/Runtime/Core/SyncState.cspublic static class SyncStateCodecEnvelope shared by the per-tick sync stream (EntityState/GhostSyncState messages) and the spawn snapshot: [count]{[behaviourIndex][flags][len:ushort][chunk]}. Each chunk is bounded so a behaviour that reads too much or too little cannot corrupt its neighbours. Kept free of NetworkIdentity so the gateway can cache keyframes without instantiating anything.
Methods
BeginEnvelope
public static int BeginEnvelope(NetworkWriter w);EndEnvelope
public static void EndEnvelope(NetworkWriter w, int countAt, byte count);WriteChunk
public static void WriteChunk(NetworkWriter w, byte behaviourIndex, ChunkFlags flags, NetworkBehaviour b, bool full);WriteRawChunk
public static void WriteRawChunk(NetworkWriter w, byte behaviourIndex, ChunkFlags flags, ArraySegment<byte> chunk);ReadEnvelope
public static void ReadEnvelope(NetworkReader r, ChunkVisitor visit);Nested types
ChunkFlags
[Flags]
public enum ChunkFlags : byteMembers
| Name | Value | Description |
|---|---|---|
None | 0 | |
Full | 1 | The chunk is a keyframe: everything the behaviour replicates, not just what changed. |
ChunkVisitor
public delegate void ChunkVisitor(byte behaviourIndex, ChunkFlags flags, ArraySegment<byte> chunk);