Struct ExposureReconcileEntry
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
TemplateID
The WeatherExposureTemplate's cached ID.
public int TemplateID
Field Value
Methods
Dequantise(ushort)
The wire's sixteen bits back to 0..1.
public static float Dequantise(ushort level)
Parameters
levelushort
Returns
Equals(ExposureReconcileEntry)
public bool Equals(ExposureReconcileEntry other)
Parameters
otherExposureReconcileEntry
Returns
Equals(object)
public override bool Equals(object obj)
Parameters
objobject
Returns
GetHashCode()
public override int GetHashCode()
Returns
Quantise(float)
0..1 to the wire's sixteen bits.
public static ushort Quantise(float level)
Parameters
levelfloat
Returns
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
readerReaderprevExposureReconcileEntry[]
Returns
ReadFrom(Reader)
public static ExposureReconcileEntry ReadFrom(Reader reader)
Parameters
readerReader
Returns
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
writerWriterprevExposureReconcileEntry[]nextExposureReconcileEntry[]optionDeltaSerializerOption
Returns
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
writerWriter