Scheduled Tasks
On this page
NationCore runs a set of repeating tasks. This page lists all of them, what they do, and how expensive they are.
| Interval | Task | Notes |
|---|---|---|
| 1 minute | Election phase checks | All Republic nations plus the legacy global election |
| 1 minute | Recall petition status | Phase transitions and deadlines |
| 1 minute | Communist party elections, tax phases and free-food distributions | The loop is cheap: each manager knows its own interval and skips when it has not elapsed |
| 1 minute | Monarchy royal tax phases and alms distributions | Same pattern |
| 1 minute | Caliphate Jizya phases and Zakat distributions | Same pattern |
| 1 minute | Executive order expiry | Deactivates and announces expired orders |
| 1 minute | Office decision expiry | Removes expired decision effects |
| 1 minute | Land-permit sweep | Lapses stale applications, prunes settled ones. Runs on the main thread because expiring a request can message the applicant |
| 1 minute | Playtime accumulation | Adds one minute to every online player. A crash-safe fallback in addition to quit-time tracking |
| 1 minute | Tax tick | Escalates invoice statuses, seizes national debt, checks whether a billing cycle is due |
| 5 minutes | Campaign message broadcasts | Only during the Campaign phase |
| 30 seconds | Research tick | Completes any project whose duration has elapsed |
| 1 hour | Politburo salaries | Pays a member once 7 real days have passed since their last stipend |
| 1 hour | High Council salaries | Same |
| 5 minutes | Save all data | Runs asynchronously |
| 10 ticks (~0.5 s) | Border particle rendering | Only for nations with borders toggled on, and only near online players |
| 1 second | Live-map heartbeat | Checks two flags and returns almost immediately when idle |
refresh.interval-seconds |
Live-map scan | Fingerprints nations; only changed nations are re-rendered, and rendering happens off-thread |
| 24 hours | Tax billing cycle | Issues one invoice to every active nation member, then bills NPCs |
Most of these are cheap "is it time yet?" checks that return immediately. The ones worth knowing about:
| Task | Cost | Mitigation |
|---|---|---|
| Tax billing cycle | Scales with player count | Runs once a day; long-offline players are skipped |
| Border rendering | Scales with toggled-on nations near players | Culled by distance, throttled, never touches unloaded chunks |
| Live-map scan | Scales with nation count | Main thread only fingerprints; all heavy work is off-thread, and a new scan never starts while a render runs |
| Data saving | Scales with total data | Runs asynchronously |
| Thread | Tasks |
|---|---|
| Main server thread | Everything that touches world or player state: elections, taxes, orders, decisions, research, permits, border particles, live-map scanning |
| Async | Data saving |
| Live-map worker | Border tracing into polygons, popup HTML building, marker construction |
On enable, in order:
- Configuration and language are loaded.
- Vault is hooked (the plugin disables itself if this fails).
- All managers are constructed.
- Integration bridges are created.
- Data is loaded from disk.
- Commands and listeners are registered.
- Scheduled tasks are started.
- The squaremap integration is enabled β after data loading, so the first render is complete.
- PlaceholderAPI is hooked if present.
- The splash screen is printed.
On disable:
- The squaremap integration is disabled β its layers and icons are removed from the map.
- The border visualiser is stopped.
- All data is saved.
The only interval exposed in configuration is the live map:
integration:
squaremap:
refresh:
interval-seconds: 10 # min 2, max 600
instant-territory-updates: trueEverything else is fixed. See Performance and Tuning for what to do if a task is costing you.