Table of Contents

Class AbilityAddBroadcastSerializer

Namespace
FishMMO.Shared
Assembly
FishMMO.Shared.dll

Wire format for AbilityAddBroadcast.

public static class AbilityAddBroadcastSerializer
Inheritance
AbilityAddBroadcastSerializer
Inherited Members

Remarks

Hand written because every id in it but one is a template id. TemplateID and EVERY element of Events is a deterministic 32-bit hash (CachedScriptableObject.AddToCache), full-range by construction, and FishNet's signed-packed form spends FIVE bytes on each where unpacked spends exactly four — a crafted ability carries several events, and the login sync ships the whole ability set in one AbilityAddMultipleBroadcast. ID stays packed: it is a database sequence value and small, and unpacking a long would COST six or seven bytes. The event array's length prefix stays packed too — a count of a handful is one byte.

Fields

MAX_EVENTS

Hard cap on the crafted event ids carried by one AbilityAddBroadcast.

public const int MAX_EVENTS = 64

Field Value

int

Remarks

The same bound, for the same reason, as MAX_LEARNED_EVENTS on the observer form of this message: an ability's event count is its template's baked events plus its AdditionalEventSlots, which is a handful. The cap exists so a malformed or hostile message cannot make the reader allocate an arbitrarily large array before the stream runs out — the count is read straight off the wire and is otherwise unbounded.

Methods

ReadAbilityAddBroadcast(Reader)

Reads an AbilityAddBroadcast. An empty event array reads back as an empty array, never null.

public static AbilityAddBroadcast ReadAbilityAddBroadcast(this Reader reader)

Parameters

reader Reader

Returns

AbilityAddBroadcast

WriteAbilityAddBroadcast(Writer, AbilityAddBroadcast)

Writes an AbilityAddBroadcast. A null event array travels as length 0.

public static void WriteAbilityAddBroadcast(this Writer writer, AbilityAddBroadcast value)

Parameters

writer Writer
value AbilityAddBroadcast