Table of Contents

Class AchievementUpdateBroadcastSerializer

Namespace
FishMMO.Shared
Assembly
FishMMO.Shared.dll

Wire format for AchievementUpdateBroadcast.

public static class AchievementUpdateBroadcastSerializer
Inheritance
AchievementUpdateBroadcastSerializer
Inherited Members

Remarks

Hand written for one field. TemplateID is a deterministic 32-bit hash (CachedScriptableObject.AddToCache), so it spans the whole signed range and FishNet's signed-packed form spends FIVE bytes where unpacked spends exactly four. The login sync ships every achievement the character has progress on in one AchievementUpdateMultipleBroadcast, and progress messages then arrive throughout play. Value stays packed — it is an unsigned progress count and small, and unsigned packing has no zigzag to defeat it — and Tier is already a single byte.

Fields

MaxAchievements

Upper bound accepted for an achievement array length, against a corrupt stream.

public const int MaxAchievements = 4096

Field Value

int

Remarks

Registry-bounded. One entry is the progress on one AchievementTemplate, and a character holds at most one Achievement per template — IAchievementController keys them by template — so the largest legitimate array, the whole set sent at login in one AchievementUpdateMultipleBroadcast, cannot exceed the number of achievement templates authored in the project. That is currently a handful of assets under Assets/Templates/Entity/Achievements.

No constant caps the template count, so there is nothing exact to reference and this is a deliberately generous ceiling rather than a derived limit. Achievements are also the category most likely to be added to in bulk — they tend to arrive a hundred at a time with a content patch — which is precisely why the number is three orders of magnitude above today's content instead of snug against it. Truncating this array would show a player their achievement list with entries missing and their progress apparently reset, which is worse than the allocation being prevented.

Server → client, so the honest threat is a mangled or truncated stream — a reader that has lost alignment reading some other field as a length prefix — not a hostile client, which cannot send this message to itself.

Methods

ReadAchievementUpdateBroadcast(Reader)

public static AchievementUpdateBroadcast ReadAchievementUpdateBroadcast(this Reader reader)

Parameters

reader Reader

Returns

AchievementUpdateBroadcast

ReadAchievementUpdateBroadcastArray(Reader)

Reads an array of AchievementUpdateBroadcast.

public static AchievementUpdateBroadcast[] ReadAchievementUpdateBroadcastArray(this Reader reader)

Parameters

reader Reader

Returns

AchievementUpdateBroadcast[]

Remarks

A length past MaxAchievements 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 no progress is applied. Only the sender's own -1, which is not a length at all, means null.

WriteAchievementUpdateBroadcast(Writer, AchievementUpdateBroadcast)

public static void WriteAchievementUpdateBroadcast(this Writer writer, AchievementUpdateBroadcast value)

Parameters

writer Writer
value AchievementUpdateBroadcast

WriteAchievementUpdateBroadcastArray(Writer, AchievementUpdateBroadcast[])

Writes an array of AchievementUpdateBroadcast.

public static void WriteAchievementUpdateBroadcastArray(this Writer writer, AchievementUpdateBroadcast[] value)

Parameters

writer Writer
value AchievementUpdateBroadcast[]

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 AchievementUpdateBroadcast[]", 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.