System Architecture and Lifecycle - AshleyThew/Bank GitHub Wiki
System Architecture and Lifecycle
Overview
This page explains how Bank systems start, run, and stop. It is written for admins planning safe reloads, restarts, and migrations.
How It Works
BankPlugin is the Bukkit entry point and delegates lifecycle control to BankCoreHandler.
Runtime flow:
onLoad: update check, upgrade check, first-install check, config/database/command/inventory load.onEnable: listener registration, optional save-type conversion or upgrade conversion, first-install integration checks, implementation enable, autosave enable, loader thread start.onDisable: implementation disable, autosave disable, converter disable, player manager disable, loader thread stop.
Lifecycle subsystems
- Config subsystem: loads YAML and command/permission/inventory definitions.
- Storage subsystem: selects backend and prepares lock/history tables.
- Integration subsystem: enables optional hooks (placeholder, citizens, etc).
- Player loader subsystem: loads and unlocks account data for online players.
- Autosave subsystem: periodic persistence of loaded account state.
Configuration
Key lifecycle-sensitive keys in config.yml:
Bank.Save.TypeBank.Save.Lock.TimeBank.Save.Auto.EnabledBank.Save.Auto.TimerBank.Convert.Confirm(inconvert.yml)Upgrade.*(inupgrade.yml)
Operational guidance:
- Use restart for conversion, upgrade, and backend switches.
- Use
/bank admin reloadfor routine config refresh when no migration flags are active.
Commands
/bank admin reloadreloads plugin systems through disable/load/enable ordering./bank admin saveforces save operations.
Permissions
bank.admin.reloadbank.admin.save
Data and Storage
Lifecycle controls when player info is loaded, locked, and released against the active storage backend.
Examples
- Safe reload: ensure no conversion is pending, run
/bank admin save, then/bank admin reload.
Safe restart for backend change:
- Run
/bank admin save. - Confirm conversion and upgrade flags are intentional.
- Restart server.
- Verify backend and player load logs.
Troubleshooting
- If plugin loads but does not enable, check Core dependency and upgrade/convert flags.
- If players are kicked on login with conversion messaging, finish conversion and restart.