mirror of
https://github.com/PHIDIAS0303/ExpCluster.git
synced 2026-11-18 06:43:13 +09:00
Features can now be enabled, disabled, and configured from the web UI while the game is running, without editing Lua files. The first five features covered are AFK Kick, Chat Auto Reply, Death Markers, Mine Depletion, and Station Auto Name. Lua side: module/features.lua holds each feature's defaults, keeps the overrides from the controller in storage, and patches them onto the config table in place. Features.guard skips a feature's handlers while it is disabled. The five config files move from exp_legacy into exp_scenario/module/config and their control files now read config at runtime instead of deciding at load which handlers to register. AFK Kick times are now in minutes. Controller side: features.ts lists the editable settings and their defaults. Overrides that differ from the default are stored in exp_scenario/features.json and guarded by the existing exp_scenario.config.view/edit permissions. The instance plugin sends them over rcon on start, on every change, and again after the controller restarts. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
19 lines
1.2 KiB
Lua
19 lines
1.2 KiB
Lua
--- Settings for kicking players when everyone online is afk
|
|
-- @config AFK-Kick
|
|
|
|
local Features = require("modules/exp_scenario/features")
|
|
local Roles = require("modules/exp_roles")
|
|
|
|
return Features.register("afk_kick", {
|
|
admin_as_active = true, --- @setting admin_as_active When true admins will be treated as active regardless of afk time
|
|
trust_as_active = true, --- @setting trust_as_active When true trusted players (by playtime) will be treated as active regardless of afk time
|
|
afk_minutes = 10, --- @setting afk_minutes The time in minutes that must pass for a player to be considered afk
|
|
kick_minutes = 30, --- @setting kick_minutes The time in minutes that must pass without any active players for all players to be kicked
|
|
trust_minutes = 600, --- @setting trust_minutes The time in minutes that a player must be online for to count as trusted
|
|
update_time = 3600 * 30, --- @setting update_time How often in ticks the script checks for active players, needs a restart to change
|
|
custom_active_check = function(player)
|
|
local veteran = Roles.get_role_by_name("Veteran")
|
|
return veteran ~= nil and not Roles.get_player_highest_role(player):is_lower_than(veteran)
|
|
end,
|
|
})
|