mirror of
https://github.com/PHIDIAS0303/ExpCluster.git
synced 2026-11-15 16:24:52 +09:00
Format names of players who never joined the instance
Reports carry names from the controller, so the reported player, the reporter or the caller may never have joined this server. The exp_util formatter asserts the player exists, so those names now fall back to plain white text. The test stub of the formatter now requires a LuaPlayer like the real one, which made the existing receiver tests fail before the fix. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
12ac7052a1
commit
fd0401e781
2 files changed
+19
-3
No files matched your search
@@ -23,8 +23,12 @@ return Framework.suite(function(env)
|
||||
--- @cast env ExpReports.TestEnv
|
||||
env.extend_requires{
|
||||
["modules/exp_util"] = {
|
||||
format_player_name_locale = function(name) return name end,
|
||||
color = { orange_red = "orange_red" },
|
||||
format_player_name_locale = function(player)
|
||||
assert(type(player) == "table", "format_player_name_locale takes a LuaPlayer")
|
||||
return player.name
|
||||
end,
|
||||
format_rich_text_color_locale = function(message) return message end,
|
||||
color = { orange_red = "orange_red", white = "white" },
|
||||
},
|
||||
}
|
||||
env.Reports = assert(loadfile(plugin_root .. "/module/control.lua"))() --- @type ExpReports
|
||||
|
||||
Reference in new issue
Block a user