mirror of
https://github.com/PHIDIAS0303/ExpCluster.git
synced 2026-11-17 14:25:27 +09:00
Save controller plugin data on the save hook (#513)
exp_groups and exp_roles only saved their datastores on shutdown, and exp_scenario saved the player store but not the feature store on the save hook. The controller runs the save hook on its autosave interval, so a crash or kill lost every change since the controller started. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
82abc2c332
commit
20ca539af3
5 files changed
+33
-5
No files matched your search
@@ -80,11 +80,12 @@ export class ControllerPlugin {
|
||||
controller.handle(messages.RoleMappingGetRequest, plugin.handleRoleMappingGetRequest.bind(plugin));
|
||||
controller.handle(messages.RoleMappingListRequest, plugin.handleRoleMappingListRequest.bind(plugin));
|
||||
|
||||
controller.hooks.shutdown.attach(plugin.name, plugin.onShutdown.bind(plugin));
|
||||
controller.hooks.save.attach(plugin.name, plugin.onSave.bind(plugin));
|
||||
controller.hooks.shutdown.attach(plugin.name, plugin.onSave.bind(plugin));
|
||||
return plugin;
|
||||
}
|
||||
|
||||
async onShutdown() {
|
||||
async onSave() {
|
||||
await Promise.all([
|
||||
this.groups.save(),
|
||||
this.manualAssignments.save(),
|
||||
|
||||
Reference in new issue
Block a user