Shard Worldreset
Overview
This component manages the synchronization of the world reset countdown timer between the master shard and secondary shards in a multiplayer DST world, using a networked variable to propagate countdown updates and trigger local event-driven sync actions.
Dependencies & Tags
- Requires:
TheWorld.ismastersim(asserted at instantiation; component only exists on the simulation master). - Uses Network Variable:
net_bytenamed"shard_worldreset._countdown"with sync trigger"countdowndirty". - No explicit component additions or tag modifications are performed by this script.
Properties
No public properties are initialized in the constructor. The component exclusively uses local module-scope and networked variables.
| Property | Type | Default Value | Description |
|---|---|---|---|
self.inst | Entity | inst (constructor argument) | Reference to the entity the component is attached to (used as a sync anchor, not directly managed). |
Main Functions
No public methods are defined. All logic resides in event handlers and closure-based callbacks initialized at construction.
Events & Listeners
- Listens for
"master_worldresetupdate"event (on master shard only): TriggersOnCountdownUpdate, which updates the networked_countdownvariable with the provided countdown value. - Listens for
"countdowndirty"event (on secondary shards only): TriggersOnCountdownDirty, which pushes a"secondary_worldresetupdate"event toTheWorldwith the current countdown value fetched from the networked variable.