Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiplayer: Created anti-griefing "PeerOptions UI" (mute chat, mute/hide actors etc...) #3215

Merged
merged 6 commits into from
Jan 25, 2025

Conversation

ohlidalp
Copy link
Member

@ohlidalp ohlidalp commented Jan 21, 2025

This adds a popup menu to the multiplayer user list, allowing you to take actions against misbehaving players. Fixes #3196

  • Local actions: These change how your game treats other player's actions. These only last until you disconnect.
  • Server commands: These open the chatbox and pre-fill a command with user ID and info.

image

PeerOptions are flags used only locally on client to filter and control incoming traffic.

  • PEEROPT_MUTE_CHAT //!< CHAT and PRIVCHAT messages will not be allowed through. Existing chat messages will be purged.
  • PEEROPT_MUTE_ACTORS //!< Spawn actors muted and immediatelly mute existing actors.
  • PEEROPT_HIDE_ACTORS //!< Spawn actors hidden and immediatelly hide existing actors.

At the moment, these flags are only kept as long as you're connected to one server. The game does not remember them across sessions yet.

This introduces new messages:
✉️ MSG_SIM_(UN)MUTE_NET_ACTOR_REQUESTED - for consistency with existing (UN)HIDE_NET_ACTOR_REQUESTED
✉️ MSG_NET_(ADD/REMOVE)_PEEROPTIONS_REQUESTED - records the flag + does all necessary updates to existing actors.
✉️ MSG_GUI_SHOW_MESSAGEBOX_REQUESTED - shows the messagebox (if not already visible) and optionally sets it's text (discarding whatever was there previously).

The flags are set via extended MultiplayerClientList UI which now has a [<] button at every nickname, opening a popup menu.

It works just locally in the game, it doesn't need a rornet update.

@ohlidalp ohlidalp force-pushed the 3196_Mark_antigriefing branch 2 times, most recently from 37f7fb0 to b62706b Compare January 21, 2025 00:27
Detect hover continuously per whole line instead of individual icons/texts which have gaps.
PeerOptions are flags used only locally on client to filter and control incoming traffic.
*    PEEROPT_MUTE_CHAT     //!< CHAT and PRIVCHAT messages will not be allowed through.
*    PEEROPT_MUTE_ACTORS   //!< Spawn actors muted and immediatelly mute existing actors.
*    PEEROPT_HIDE_ACTORS   //!< Spawn actors hidden and immediatelly hide existing actors.

At the moment, these flags are only kept as long as you're connected to one server. The game does not remember them across sessions yet.

This introduces new messages:
:envelope:    `MSG_SIM_MUTE_NET_ACTOR_REQUESTED`      - for consistency with existing `(UN)HIDE_NET_ACTOR_REQUESTED`
:envelope:    `MSG_SIM_UNMUTE_NET_ACTOR_REQUESTED`
:envelope:    `MSG_NET_ADD_PEEROPTIONS_REQUESTED`     - for easy setting/clearing of the flags from UI, also triggers necessary updates to existing actors.
:envelope:    `MSG_NET_REMOVE_PEEROPTIONS_REQUESTED`

The flags are set via extended MultiplayerClientList UI which now has a [<] button at every nickname, opening a popup menu.
* fixed mouse hover region being too short on right side.
* corrected spacing between the popup and client list panels.
* made the [ < ] buttons thinner to fix alignment with nicknames and add vertical gaps.
@ohlidalp ohlidalp force-pushed the 3196_Mark_antigriefing branch from 81d1ebf to b88ae89 Compare January 23, 2025 21:41
@Zentro
Copy link
Member

Zentro commented Jan 25, 2025

Code looks good, tested and works.

@ohlidalp ohlidalp merged commit 360f75b into RigsOfRods:master Jan 25, 2025
2 checks passed
@ohlidalp ohlidalp deleted the 3196_Mark_antigriefing branch January 25, 2025 12:13
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.

Ability to hide a player's messages and prevent their objects from spawning during a multiplayer session
2 participants