timed_economy 
Vars | |
| buckets | Flag to ensure catalog is loaded only once. The core scheduler structure. An array where each index represents a future time slot. buckets[i] contains a list of /datum/subscription objects due to be processed in that slot. |
|---|---|
| current_bucket | For resumed Temporary working list used during resumed processing. Holds the copy of the current bucket to allow safe modification (Cut) without affecting the original until completion. |
| current_bucket_index | Index of the bucket currently being processed (1 to BUCKET_COUNT). |
Procs | |
| add_economy_process | Schedules a subscription for future processing. Calculates the target bucket based on the subscription's interval and the current index. |
| fire | Main entry point for the subsystem tick. Called every [BASE_FREQUENCY_SUBSYSTEM] by the Master Controller. |
| fire_buckets | Processes the subscriptions in the current bucket. Implements resume logic to prevent server overrun (lag). |
| init_buckets | Initializes the bucket array with empty lists. Called once during subsystem initialization. |
| initialize_catalog | This process is one of the basic ones; if you don’t add your subscription as a test one, it won’t be displayed! |
Var Details
buckets 
Flag to ensure catalog is loaded only once. The core scheduler structure. An array where each index represents a future time slot. buckets[i] contains a list of /datum/subscription objects due to be processed in that slot.
current_bucket 
For resumed Temporary working list used during resumed processing. Holds the copy of the current bucket to allow safe modification (Cut) without affecting the original until completion.
current_bucket_index 
Index of the bucket currently being processed (1 to BUCKET_COUNT).
Proc Details
add_economy_process
Schedules a subscription for future processing. Calculates the target bucket based on the subscription's interval and the current index.
MATH: target_bucket = ((current_index - 1 + ticks_to_wait) % BUCKET_COUNT) + 1 This formula ensures correct wrap-around behavior within the circular buffer.
fire
Main entry point for the subsystem tick. Called every [BASE_FREQUENCY_SUBSYSTEM] by the Master Controller.
fire_buckets
Processes the subscriptions in the current bucket. Implements resume logic to prevent server overrun (lag).
init_buckets
Initializes the bucket array with empty lists. Called once during subsystem initialization.
initialize_catalog
This process is one of the basic ones; if you don’t add your subscription as a test one, it won’t be displayed!