Table of Contents

Struct AbilityLearnedObserverBroadcast

Namespace
FishMMO.Shared
Assembly
FishMMO.Shared.dll

Tells observers that a character learned an ability, so they can draw its casts.

public struct AbilityLearnedObserverBroadcast : IBroadcast
Implements
IBroadcast
Inherited Members

Remarks

An observer's knowledge of a peer's abilities arrives in the spawn payload and nowhere else. An ability learned after an observer started observing was therefore invisible to it forever: OnAbilityActivatedBroadcast could not resolve the ability id, and every cast of that ability was dropped without drawing anything. The activation message deliberately does not carry the template — casts are frequent and learns are rare, so the bytes belong here, once, rather than on every cast.

Not a grant. The receiving side files this straight into KnownAbilities, the same container the owner uses — a client is required to hold an observed character's real state, because Inspect and faction evaluation read it and not just the renderer. What stops it being a grant is AbilityController.RegisterObservedAbility's owner check: the message only ever describes somebody else, so it refuses outright on our own character, and the dictionary an activation is gated on can never be written by it.

This used to be enforced by filing the ability in a separate observer-only dictionary instead. It is not any more, and two comments went on claiming it was — long enough to be worth spelling out here: the boundary is the owner check, not a container split. Removing that check because "the parallel store is what protects it" reopens the hole.

The event ids travel because they are what makes the reproduction move: an ability's OnTick events carry the trajectory, and an ability rebuilt without them would spawn a projectile that sits still. Sent reliably to observers except the owner, which has its own AbilityAddBroadcast.

Fields

AbilityID

The ability instance id, matching AbilityActivatedBroadcast.AbilityID.

public long AbilityID

Field Value

long

CasterObjectID

NetworkObject id of the character that learned the ability.

public int CasterObjectID

Field Value

int

Events

Crafted event template ids attached to the ability. May be null or empty.

public int[] Events

Field Value

int[]

TemplateID

AbilityTemplate id the ability was built from.

public int TemplateID

Field Value

int