Table of Contents

Struct ExposureReconcileEntry

Namespace
FishMMO.Shared
Assembly
FishMMO.Shared.dll

One exposure state's level, as it rides the unified reconcile.

public struct ExposureReconcileEntry : IEquatable<ExposureReconcileEntry>
Implements
Inherited Members

Remarks

The level is quantised to sixteen bits rather than sent as a float. Two reasons, and the second is the important one. It is smaller on the wire; and because Quantise(float) is applied on BOTH sides — the server quantises what it sends, the owner quantises what it restores — the two hold bit-identical levels immediately after every reconcile, instead of differing by the rounding and re-diverging from there. A state at 1/65535 resolution is far finer than any buff threshold cares about.

Producers MUST emit entries sorted by TemplateID ascending, like every other array in CharacterReconcileData: the index-delta serializer compares position by position, so an unstable order would send every entry every tick.

Fields

Level

The level, 0..65535 for 0..1. See the remarks on quantisation.

public ushort Level

Field Value

ushort

TemplateID

The WeatherExposureTemplate's cached ID.

public int TemplateID

Field Value

int

Methods

Dequantise(ushort)

The wire's sixteen bits back to 0..1.

public static float Dequantise(ushort level)

Parameters

level ushort

Returns

float

Equals(ExposureReconcileEntry)

public bool Equals(ExposureReconcileEntry other)

Parameters

other ExposureReconcileEntry

Returns

bool

Equals(object)

public override bool Equals(object obj)

Parameters

obj object

Returns

bool

GetHashCode()

public override int GetHashCode()

Returns

int

Quantise(float)

0..1 to the wire's sixteen bits.

public static ushort Quantise(float level)

Parameters

level float

Returns

ushort

ReadArrayDelta(Reader, ExposureReconcileEntry[])

Reads an exposure array from the delta stream. High header bit = index-delta over prev, otherwise a full array.

public static ExposureReconcileEntry[] ReadArrayDelta(Reader reader, ExposureReconcileEntry[] prev)

Parameters

reader Reader
prev ExposureReconcileEntry[]

Returns

ExposureReconcileEntry[]

ReadFrom(Reader)

public static ExposureReconcileEntry ReadFrom(Reader reader)

Parameters

reader Reader

Returns

ExposureReconcileEntry

WriteArrayDelta(Writer, ExposureReconcileEntry[], ExposureReconcileEntry[], DeltaSerializerOption)

Compares and writes exposure arrays using index-delta compression. The wire header is a packed 16-bit value: high bit = delta mode, low 15 bits = entry count.

public static bool WriteArrayDelta(Writer writer, ExposureReconcileEntry[] prev, ExposureReconcileEntry[] next, DeltaSerializerOption option)

Parameters

writer Writer
prev ExposureReconcileEntry[]
next ExposureReconcileEntry[]
option DeltaSerializerOption

Returns

bool

Remarks

Null / empty equivalence: both null and empty arrays serialize as count == 0, and ReadArrayDelta(Reader, ExposureReconcileEntry[]) returns null for both.

Stable ordering required: producers MUST sort by TemplateID.

WriteTo(Writer)

public void WriteTo(Writer writer)

Parameters

writer Writer