Table of Contents

Class CharacterReconcileDataDeltaSerializer

Namespace
FishMMO.Shared
Assembly
FishMMO.Shared.dll

Custom delta serializers for CharacterReconcileData.

Delta serializer: Writes a 2-byte bitmask (13 bits for 13 fields) followed by delta-encoded values for only the changed fields. The nested KinematicCharacterController.KinematicCharacterMotorState and CharacterAttributeResourceState use their own delta serializers, so savings compound. Cooldowns, buffs, and non-resource attributes use index-delta compression via CooldownReconcileEntry, BuffReconcileEntry, and AttributeReconcileEntry.

Who owns what (FishNet delta prediction, FISHNET_DELTA_PREDICTION). FishNet writes every reconcile behind a one-byte header (a full flag plus a 7-bit id of the full reconcile a delta was written against). A FULL reconcile — the first one, one per observer added, and one every min(TickRate, 60) ticks — goes through the REGULAR serializer, WriteCharacterReconcileData(Writer, CharacterReconcileData). Every other reconcile goes through WriteDelta(Writer, CharacterReconcileData, CharacterReconcileData, DeltaSerializerOption) with RootSerialize, as a delta against the last FULL reconcile as readers decoded it, not against the previous reconcile. The reader only uses a delta when it holds the full reconcile that delta names, and otherwise decodes it to stay aligned and discards it. Loss detection and late-joiner bootstrap are therefore FishNet's, which is why this serializer no longer carries the mode byte and chain sequence it needed when the fork chained each delta onto the previous one.

The contract this serializer keeps for FishNet: write bytes if and only if it returns true; always write something at RootSerialize; consume the same number of bytes whatever baseline the reader holds (a rejected delta is still decoded); never modify the baseline instance, which is reused for every delta until the next full reconcile — the array readers copy before they patch.

public static class CharacterReconcileDataDeltaSerializer
Inheritance
CharacterReconcileDataDeltaSerializer
Inherited Members

Methods

ReadCharacterReconcileData(Reader)

Custom full deserializer: reads all fields of CharacterReconcileData. Must read in the same order as WriteCharacterReconcileData(Writer, CharacterReconcileData).

public static CharacterReconcileData ReadCharacterReconcileData(this Reader reader)

Parameters

reader Reader

Returns

CharacterReconcileData

WriteCharacterReconcileData(Writer, CharacterReconcileData)

Custom full serializer: writes all fields of CharacterReconcileData. Nested types use their full serializers. Arrays write count + entries.

public static void WriteCharacterReconcileData(this Writer writer, CharacterReconcileData value)

Parameters

writer Writer
value CharacterReconcileData

Remarks

Framed by a byte count, the same shape the four WritePayload implementations use and for the same reason. FishNet packs every predicted behaviour's reconcile into one StateUpdate reader, so a reader that stops early does not merely lose its own state — every behaviour after it decodes from the wrong offset.

ReadCharacterReconcileData(Reader) has four defensive aborts for array counts that cannot be trusted, and no way to drain past them: the per-entry sizes it would need to skip are derived from the count it just rejected. The length recorded here is what lets it resynchronise instead. Four bytes, and only on the absolute form — which FishNet emits once per second per owner, not on the per-tick deltas.