Add the exp_reports plugin and move the scenario onto it

Reports were the last legacy control module, kept in the lua state of
each instance. They are now an exp_reports plugin which stores them on
the controller: a report is immutable and holds the reported player, who
made it, the reason, the instance name and when it was made, and the only
operations are get, list, create and delete.

In game nothing is stored. The lua module sends each request over ipc,
the instance plugin asks the controller and hands the answer back with
rcon, and the module prints it to whoever asked if they are still online.
Answers are dropped if the instance stopped meanwhile. The module raises
on_player_reported with the count and reporters of every report against
the player, which report_jail and discord_alerts use, and the commands
and player list button call into it.

The web ui gets a /reports page: a table with search on the player,
reporter and reason, a filter on the instance, delete per row and a
create form which reports in the name of the web user.

New reports are posted to two optional webhooks configured on the
controller, a Discord channel hook as an embed and a generic JSON hook.
Failures are logged rather than failing the report.

Tests cover the messages, the controller against a real Controller, the
instance plugin against a real Instance, and the lua module through the
shared harness.
This commit is contained in:
bbassie committed 2026-09-06 16:44:23 +00:00
1 parent 142d296a02
commit bad98c5013
35 files changed
+1707 -350

No files matched your search

-10
View File
@@ -172,16 +172,6 @@ arg-reason=Reason you want to report this player.
arg-from-player=Only remove the report from this player.
player-immune=This player can not be reported.
self-report=You cannot report yourself.
response=__1__ was reported for __2__.
response-admin=__1__ was reported by __2__ for __3__.
already-reported=You can only report a player once, you can ask a moderator to clear this report.
not-reported=The player had no reports on them.
not-reported-by=The player had no reports on them from __1__.
reports-title=The following players have reports against them:
player-title=__1__ has __2__ __plural_for_parameter__2__{1=report|rest=reports}__ against them:
list-element=__1__: __2__
removed-all=__1__ has has all of their reports removed by __2__.
removed=__1__ has a report removed by __2__.
[exp-commands_roles]
description-assign=Assigns a role to a player.
-10
View File
@@ -173,16 +173,6 @@ arg-reason=原因
arg-from-player=用戶
player-immune=用戶不能被舉報
self-report=你不能舉報自己
response=__1__ 因 __2__ 被舉報了。
response-admin=__1__ 因 __3__ 被 __2__ 舉報了。
already-reported=你已經舉報過該用戶了,你可以讓管理員清除報告來重寫
not-reported=該用戶沒有被舉報的紀錄。
not-reported-by=該用戶沒有被 __1__ 舉報的紀錄。
reports-title==該用戶現在的被舉報紀錄:
player-title=__1__ 有 __2__ 項被舉報的紀錄:
list-element=__1__: __2__
removed-all=__1__ 被舉報的所有紀錄已被 __2__ 清除。
removed=__1__ 被舉報的一個紀錄已被 __2__ 清除。
[exp-commands_roles]
description-assign=為用戶指配用戶組
-10
View File
@@ -173,16 +173,6 @@ arg-reason=原因
arg-from-player=用戶
player-immune=用戶不能被舉報
self-report=你不能舉報自己
response=__1__ 因 __2__ 被舉報了。
response-admin=__1__ 因 __3__ 被 __2__ 舉報了。
already-reported=你已經舉報過該用戶了,你可以讓管理員清除報告來重寫
not-reported=該用戶沒有被舉報的紀錄。
not-reported-by=該用戶沒有被 __1__ 舉報的紀錄。
reports-title==該用戶現在的被舉報紀錄:
player-title=__1__ 有 __2__ 項被舉報的紀錄:
list-element=__1__: __2__
removed-all=__1__ 被舉報的所有紀錄已被 __2__ 清除。
removed=__1__ 被舉報的一個紀錄已被 __2__ 清除。
[exp-commands_roles]
description-assign=為用戶指配用戶組