mirror of
https://github.com/PHIDIAS0303/ExpCluster.git
synced 2026-11-14 00:14:52 +09:00
Move the report commands into exp_reports
The create-report, get-reports and clear-reports commands now live in the plugin's own module next to the functions they call, with their locale. The permissions keep their exp_scenario.command names because the command authority derives them from the command name. The Discord report alert in exp_scenario is gone since exp_reports posts to its own webhook. The shared add_player stub takes an options table with connected and admin defaulting to true and false, replacing the copy in the exp_reports test environment. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
e47f41d440
commit
9ddb7b362b
20 files changed
+95
-155
No files matched your search
+10
-4
@@ -100,17 +100,23 @@ function Stubs.new()
|
||||
get_player = function(key) return players[key] end,
|
||||
}, { "player" })
|
||||
|
||||
--- @class Stubs.PlayerParams
|
||||
--- @field name string
|
||||
--- @field connected boolean? Defaults to true
|
||||
--- @field admin boolean? Defaults to false
|
||||
|
||||
--- Add a player to the stubbed game, indexes are assigned in join order
|
||||
--- @param name string
|
||||
--- @param is_connected boolean? Defaults to connected
|
||||
--- @param params Stubs.PlayerParams
|
||||
--- @return Stubs.Player
|
||||
function stubs.add_player(name, is_connected)
|
||||
function stubs.add_player(params)
|
||||
local name = params.name
|
||||
local index = #players_by_index + 1
|
||||
--- @class Stubs.Player
|
||||
local player = Stubs.strict("LuaPlayer " .. name, {
|
||||
name = name,
|
||||
index = index,
|
||||
connected = is_connected ~= false,
|
||||
connected = params.connected ~= false,
|
||||
admin = params.admin == true,
|
||||
valid = true,
|
||||
play_sound = function(opts)
|
||||
stubs.sounds[#stubs.sounds + 1] = name .. ":" .. opts.path
|
||||
|
||||
Reference in new issue
Block a user