mirror of
https://github.com/PHIDIAS0303/ExpCluster.git
synced 2026-11-20 15:33:12 +09:00
Merge branch 'explosivegaming:main' into aperx
This commit is contained in:
19 files changed
+932
-51
No files matched your search
@@ -239,6 +239,7 @@ export default async function (context: ControllerPluginContext) {
|
||||
});
|
||||
|
||||
controller.hooks.save.attach(plugin.name, async () => {
|
||||
await featureStore.save();
|
||||
await playerStore.save();
|
||||
});
|
||||
|
||||
|
||||
@@ -216,6 +216,17 @@ t.test("controller plugin", t2 => {
|
||||
);
|
||||
});
|
||||
|
||||
t2.test("features are saved on the save hook", async t3 => {
|
||||
const databaseDirectory = t3.testdir();
|
||||
const { updateFeature, save } = await startPlugin(t3, { withPlugins: false, databaseDirectory });
|
||||
await updateFeature(new messages.FeatureUpdateRequest("afk_kick", false, { afk_minutes: 5 }));
|
||||
await save();
|
||||
|
||||
const { listFeatures } = await startPlugin(t3, { withPlugins: false, databaseDirectory });
|
||||
const record = await getFeature(listFeatures, "afk_kick");
|
||||
t3.strictSame([record.enabled, record.values], [false, { afk_minutes: 5 }], "the saved record is loaded");
|
||||
});
|
||||
|
||||
t2.test("stored features are kept across restarts", async t3 => {
|
||||
const databaseDirectory = t3.testdir();
|
||||
const { updateFeature, shutdown } = await startPlugin(t3, { withPlugins: false, databaseDirectory });
|
||||
|
||||
Reference in new issue
Block a user