Shard Wagbossinfo
Overview
This component maintains and synchronizes the defeat status of the Wagboss (a boss entity in the game) across the master shard and client shards in multiplayer. It acts as a lightweight synchronization bridge by exposing a boolean flag (_isdefeated) that reflects whether the Wagboss has been defeated, ensuring consistency between server-authoritative state and client-side queries.
Dependencies & Tags
- Component Dependencies: Relies on
TheWorld.components.wagboss_trackerbeing present (used during initialization on the master shard). - Tags: None identified.
- Network Dependencies: Uses
net_boolto synchronize state via the"shard_wagbossinfo._isdefeated"network variable, requiring themaster_wagbossinfoupdateevent to be dispatched bywagboss_tracker.
Properties
| Property | Type | Default Value | Description |
|---|---|---|---|
inst | Entity | (passed to constructor) | Reference to the entity the component is attached to (typically TheWorld or a world shard instance). |
_isdefeated | net_bool | false | Networked boolean tracking whether the Wagboss is defeated; synchronized from master shard to clients. |
Main Functions
IsWagbossDefeated()
- Description: Returns the current defeat status of the Wagboss as a boolean value.
- Parameters: None.
Events & Listeners
- Listens for:
"master_wagbossinfoupdate"event (on master shard only) — triggersOnWagbossInfoUpdateto update_isdefeatedfrom incomingdata.isdefeated. - Triggers: None directly (the
net_boolvariable is implicitly synchronized; updating_isdefeatedvia:set()propagates changes to other shards).