mirror of
https://github.com/PHIDIAS0303/ExpCluster.git
synced 2026-11-12 07:54:52 +09:00
The toolbar order, favourites, and open panels were saved into exp_legacy's PlayerData, which was never synced, and the file doing so was no longer loaded. When a player leaves, the lua side now sends Gui.toolbar.get_state as json compressed with helpers.encode_string, and the controller stores the string on the player record. When the player joins again the instance plugin sends the stored string over rcon to exp_scenario.player_settings.receive_toolbar, which decodes it and calls Gui.toolbar.set_state. exp_gui builds the toolbar in on_player_joined_game, so it exists by the time the rcon arrives. A string which does not decode, or a state naming buttons which no longer exist, is logged and ignored rather than raising in the game. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
12 lines
510 B
JavaScript
12 lines
510 B
JavaScript
import path from "node:path";
|
|
import t from "tap";
|
|
import { reportLuaTests } from "../../test/lua/runner.js";
|
|
|
|
const envFile = path.join(import.meta.dirname, "module", "env.lua");
|
|
|
|
// Each file runs in its own lua state, and each test in a fresh environment
|
|
t.test("features.lua", t2 => reportLuaTests(t2, envFile, path.join(import.meta.dirname, "module", "features.lua")));
|
|
t.test("player_settings.lua", t2 => reportLuaTests(
|
|
t2, envFile, path.join(import.meta.dirname, "module", "player_settings.lua"),
|
|
));
|