Skip to content

Kick a player or everyone, and raise announcements and direct messages for the server's resources, in contract 5 - #58

Merged
ImBaphomettt merged 9 commits into
mainfrom
player-kick-messages
Nov 11, 2026
Merged

ImBaphomettt merged 9 commits into
mainfrom
player-kick-messages

Conversation

@ImBaphomettt

@ImBaphomettt ImBaphomettt commented Nov 11, 2026 •

Copy link
Copy Markdown
Member

The staff can kick a connected player from the Online now column, from their profile or from the live map, and kick everyone from the top bar. The player reads the kick message the owner writes in the settings, which can quote the reason, as a banned player reads the refusal message. Announcements and direct messages are raised for the server's resources as observer:announcement and observer:directMessage: Observer shows players nothing of them, a resource does. With Send txAdmin's events too, the bridge also raises txAdmin's matching events, and now txAdmin:events:playerBanned and txAdmin:events:actionRevoked for each ban made or lifted. Each action has its permission and its audit entry. The bridge contract goes to version 5.

What changed

  • observer-domain: moderation (DTOs KickRequest, KickAllRequest, KickedAll, AnnouncementRequest, DirectMessageRequest, KickSettings; the kick message with {reason} and {by}, 600 characters, rendered to 700 bytes at most; announcements and messages of 400 characters, lines kept, hidden characters removed). bans::clean_message and bans::fill now serve both messages. Permission bits 29 PLAYERS_KICK, 30 PLAYERS_ANNOUNCE, 31 PLAYERS_MESSAGE. Audit actions player_kicked, everyone_kicked, kick_settings_changed, announcement_sent, direct_message_sent. Error codes player_not_connected, invalid_kick, invalid_kick_settings, invalid_message.
  • observer-store: the setting kicks.message (no migration), and bans::held, what a ban holds.
  • observer-fxserver: contract 5. Events announcement and directMessage. Actions kick (the players listed, split over as many console lines as the list needs, or everyone, as the server counts them when it runs the action), banned and lifted (txAdmin's ban events only). BridgeAction::fitted cuts any of an action's texts, and a txAdmin ban event's hardware tokens, then its identifiers, first.
  • observer-app: the Moderation service (kick, kick everyone, announce, message, the kick message). It refuses a stopped server (server_not_running) and a player the bridge does not list, or lists under another licence (player_not_connected): server ids start again from 1 after a restart. kick_players(targets, kick) kicks a list or everyone with a cause and a rendered message, and checks and audits nothing, for the allowlist and the maintenance mode to come. Bans::connected_players. Bans tells txAdmin's listeners of each ban made, before it drops anyone, and of each ban lifted, only when the saved launch settings ask for txAdmin's events.
  • observer-web: POST /servers/default/kicks, POST /servers/default/kicks/all (SERVER_CONTROL, as txAdmin gates it), GET|PUT /servers/default/kicks/settings (SETTINGS_VIEW, then SETTINGS_MANAGE and the password again), POST /servers/default/announcements, POST /servers/default/messages.
  • Bridge (server.lua): the kick action raises observer:playerKicked for every player first, then drops them; banned and lifted raise txAdmin:events:playerBanned and txAdmin:events:actionRevoked when observer_txadmin_events is 1; TXADMIN maps the new events. CONTRACT.md: the Kicks and the Announcements and messages sections, the txAdmin table, a security note on the staff's text. observer_example handles the three new events.
  • Panel: an actions menu on each row of Online now (Message…, Kick…), Message and Kick on a profile with a session online and on the map's selected card, Send an announcement… and Kick everyone… under the top bar's More server actions, the kick message in Settings under Bans and kicks (it shares the refusal message's editor), and a browser flow.
  • Fake FXServer: the kick action prints observer:playerKicked, then kicked <id> "<message>", and drops with category 1, the bridge as the resource; txAdmin's ban events are printed when observer_txadmin_events is 1.
  • README: the Kicks, announcements and messages section, the kick message as the second text Observer shows players, and txAdmin's ban events.

Notes for review

Verified

  • On Windows, on this branch with main merged in: cargo xtask check in one run (fmt, icons, clippy with and without observer/test-catalog, cargo test --workspace, bindings unchanged, the panel's format, lint, type check, tests and build).
  • End to end with the fake FXServer: a kick drops the player with the owner's kick message and raises observer:playerKicked; a kick or a message for a server id another licence holds now is refused; kick everyone; the announcement and direct message events; txAdmin's ban events with the option on, and nothing written with it off.
  • The CI's browser tests, run the same way on Windows (cargo xtask icons --check, the build with observer/test-catalog, Playwright on Chromium): 12 passed, and the 2 flows that run on Linux only were skipped, among them the new "the staff writes to a player from the players column, then kicks them with the kick message".
  • In the browser, against a local Observer and the fake FXServer: kicks from the column and from a profile, a message, an announcement, kick everyone, the kick message saved then read by the next kick, in both themes, at 1440 and 375 px.
  • GitHub Actions did not start the jobs (the organisation's billing): the checks above are the CI's, run locally on Windows.

Not verified

  • The bridge on a real FXServer: the kick, banned and lifted actions, the three new events and txAdmin's five.
  • Linux: no cfg(unix) or cfg(windows) code changed here, and nothing was built or run on Linux.
  • The light theme at 375 px was looked at on the kick dialog and the settings only.

@ImBaphomettt
ImBaphomettt merged commit 19ecc38 into main Nov 11, 2026
2 of 3 checks passed
@ImBaphomettt
ImBaphomettt deleted the player-kick-messages branch November 11, 2026 16:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant