Table of Contents

Class CharacterAttributeResourceStateSerializer

Namespace
FishMMO.Shared
Assembly
FishMMO.Shared.dll

Custom serializers for CharacterAttributeResourceState.

Regular serializer (Write/Read extension methods): Used by FishNet's codegen for RPCs, SyncVars, broadcasts, and any non-prediction serialization context. Writes all 7 fields using FishNet's built-in packed encoding (varint for ints, full precision for floats).

Delta serializer (registered via FishNet.Serializing.GenericDeltaWriter<T>/FishNet.Serializing.GenericDeltaReader<T>): Used during prediction replicate/reconcile ticks. Writes a 1-byte bitmask (7 bits for 7 fields) followed by delta-encoded values for only the changed fields. On a typical tick where only health regens, this sends ~3-4 bytes instead of 28.

The delta serializer must use SetWrite(Func<Writer, T, T, DeltaSerializerOption, bool>) because FishNet's [DefaultDeltaWriter] attribute only supports single-value signatures, not the (prev, next, option) signature needed for per-field delta compression.

public static class CharacterAttributeResourceStateSerializer
Inheritance
CharacterAttributeResourceStateSerializer
Inherited Members

Methods

ReadCharacterAttributeResourceState(Reader)

public static CharacterAttributeResourceState ReadCharacterAttributeResourceState(this Reader reader)

Parameters

reader Reader

Returns

CharacterAttributeResourceState

WriteCharacterAttributeResourceState(Writer, CharacterAttributeResourceState)

Writes all fields of CharacterAttributeResourceState. FishNet's codegen discovers this method by naming convention and registers it via FishNet.Serializing.GenericWriter<T>. Combined with [UseGlobalCustomSerializer] on the struct, this serializer is used across all assemblies.

public static void WriteCharacterAttributeResourceState(this Writer writer, CharacterAttributeResourceState value)

Parameters

writer Writer
value CharacterAttributeResourceState