Server-Side Town Supplies
The server-side code for managing town supplies is responsible for interacting with the database, fetching town data, and handling requests from clients. This allows town supplies to be adjusted, updated, and broadcasted to all connected clients. Below is the full breakdown, examples, and guidelines for developers using the server-side functionality.
๐ Correct Usage for Developers
To use the server-side functionality correctly, follow these key steps:
Triggering Events:
Ensure you are calling the correct event for fetching town supplies:
You can fetch town supplies via the event
codex-studios-supplies:city_supplies_refetch
to refresh the data at any point:
Removing Supplies:
To remove supplies from a town (e.g., after an event like a raid):
Resupplying a Town:
Use the resupply event when a town needs to be resupplied:
๐ซ Incorrect Usage Examples
Missing Town Parameter:
If you fail to provide the
town
parameter, the function will return an error:
Using Incorrect Event Names:
Calling events with wrong names will fail:
Last updated
Was this helpful?