Class KnownAbilityEventAddBroadcastSerializer
Wire format for KnownAbilityEventAddBroadcast.
public static class KnownAbilityEventAddBroadcastSerializer
- Inheritance
-
KnownAbilityEventAddBroadcastSerializer
- Inherited Members
Remarks
The same single-field case as KnownAbilityAddBroadcast: an ability event's
TemplateID is a full-range deterministic hash, costing five packed bytes against four
unpacked, and the login sync ships every known event in one
KnownAbilityEventAddMultipleBroadcast.
Fields
MaxKnownAbilityEvents
Upper bound accepted for a known-ability-event array length, against a corrupt stream.
public const int MaxKnownAbilityEvents = 8192
Field Value
Remarks
Registry-bounded, exactly as MaxKnownAbilities
is: one entry is one learned ability event template, so the largest legitimate array —
the whole known event set at login, in one
KnownAbilityEventAddMultipleBroadcast — cannot exceed the number of event
templates authored under Assets/Templates/Entity/Abilities/Events. No constant
caps that count, so there is no exact bound to reference and this is a deliberately
generous ceiling rather than a derived one.
Held at the same value as the base-ability bound on purpose. The two arrive together in the same login sync and grow together as abilities are authored, so one number moving without the other would be the kind of asymmetry that makes a future reader guess. Event templates typically outnumber base abilities — several per ability — which is the other reason not to set this one tighter.
Note this is a distinct concern from MAX_EVENTS,
which bounds the events baked into ONE crafted ability. That is genuinely a handful and
bounded by AdditionalEventSlots; this is the player's whole learned catalogue.
Server → client, so the honest threat is a mangled or truncated stream rather than a hostile client.
Methods
ReadKnownAbilityEventAddBroadcast(Reader)
Reads a KnownAbilityEventAddBroadcast.
public static KnownAbilityEventAddBroadcast ReadKnownAbilityEventAddBroadcast(this Reader reader)
Parameters
readerReader
Returns
ReadKnownAbilityEventAddBroadcastArray(Reader)
Reads an array of KnownAbilityEventAddBroadcast.
public static KnownAbilityEventAddBroadcast[] ReadKnownAbilityEventAddBroadcastArray(this Reader reader)
Parameters
readerReader
Returns
Remarks
A length past MaxKnownAbilityEvents cannot be allocated and cannot be resynchronised past either — the entries behind it are only locatable by trusting the count just rejected — so the array comes back empty and nothing is learned. Only the sender's own -1, which is not a length at all, means null.
WriteKnownAbilityEventAddBroadcast(Writer, KnownAbilityEventAddBroadcast)
Writes a KnownAbilityEventAddBroadcast.
public static void WriteKnownAbilityEventAddBroadcast(this Writer writer, KnownAbilityEventAddBroadcast value)
Parameters
writerWritervalueKnownAbilityEventAddBroadcast
WriteKnownAbilityEventAddBroadcastArray(Writer, KnownAbilityEventAddBroadcast[])
Writes an array of KnownAbilityEventAddBroadcast.
public static void WriteKnownAbilityEventAddBroadcastArray(this Writer writer, KnownAbilityEventAddBroadcast[] value)
Parameters
writerWritervalueKnownAbilityEventAddBroadcast[]
Remarks
Explicit because the element carries [UseGlobalCustomSerializer]. That attribute
tells FishNet the element has a hand-written serializer, and codegen then declines to
synthesise one for the ARRAY as well — it emits nothing and says nothing at build time.
The gap only appears when a broadcast carrying the array is actually sent, as
"Write method not found for KnownAbilityEventAddBroadcast[]", by which point the send has already failed.
A null array is written as length -1 so it round-trips as null rather than as empty.