Table of Contents

Struct TargetSelectionBroadcast

Namespace
FishMMO.Shared
Assembly
FishMMO.Shared.dll

Tells the server which character the player's targeting frame currently shows.

public struct TargetSelectionBroadcast : IBroadcast
Implements
IBroadcast
Inherited Members

Remarks

Client → server, advisory, and verified on receipt. The server's own TargetController.Current is cast-scoped — written only when an ability acquisition resolves, cleared by any miss — so the "current target" pin in ObserverStreamingRegistry did not exist for a target the player was looking at but had not yet landed a cast on: in an over-budget crowd, the intended opponent could be evicted at the exact moment the player engaged. This message closes that gap by telling the server what the player's frame shows, at most a few times a second, only on change. When the player has PINNED a character to the frame, that character is what is reported, whatever the pointer is resting on: the pin is the clearest statement of engagement the client can make, and the pointer sweeps across everyone else during the fight.

Keyed on NetworkObject.ObjectId, not the character id. The ObjectId is already replicated to every peer by FishNet (no payload work), it is what the streaming pin compares, and targeting is always same-scene so the character id's cross-scene stability buys nothing here. The server treats the value as a CLAIM: it must resolve to a live character in the sender's own scene or it is stored as no-target, and the pin that reads it is additionally bounded by the engagement range ceiling at use — a forged id can therefore pin nothing the sender could not legitimately be looking at.

Nothing gameplay-authoritative reads this. Ability target acquisition stays a server-side lag-compensated raycast from the replicated aim; this value feeds interest management (and any future UI mirroring), never combat resolution.

Fields

TargetObjectID

NetworkObject id of the targeted character, or 0 for no target.

public int TargetObjectID

Field Value

int