Hi!
GlobalStockService is basically a utility module that manages weighted random “stocks” of items that refresh on an interval
Think of it as a way to simulate a “market” of items/events where:
- You define items with a chance/weight
- The service “restocks” after a given amount of time
- Other scripts can check what’s currently in stock, or listen for changes when the stock updates
In the context of the WeatherHandler, I’m using it so that the weather changes globally and consistently across all servers, without needing an external centralized server, Instead of each server rolling its own random weather, GlobalStockService keeps everything in sync automatically, though there might be a latency between servers before they all update