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

Client: Only allow pointing with interact priv #14745

Closed
wants to merge 1 commit into from

Conversation

appgurueu
Copy link
Contributor

Trivial UX improvement: When you don't have interact, you can't point at anything anymore, to signal that you are unable to interact with anything.

Previously, client prediction made it look as if you were still able to interact with things, even though the server ignores the interactions. You could still point at things, "dig" nodes (clientside), "punch" and "kill" entities clientside.

Provides a solution for part of the use case behind #14742: Simply revoking interact should now work well. Care needs to be taken to re-grant interact on player join, since privs are persisted.

The use case of tools that can't point at anything is however still valid, but a bit trickier to solve.

If we were to change behavior and make range = 0 => no pointing, the fix would be trivial: Add d > 0 && to the condition. (Oh also, it looks like you can still point at nodes you are inside of when you are in third person?)

(However, with a negative range or similar, it's a bit trickier: We already use a negative value (-1) as the default for "no value". This was what led me down the route of NaN back then, which in hindsight was a bad idea.)

How to test

  1. Host server
  2. Join with second client (can't revoke interact from singleplayer / admin)
  3. Revoke interact priv of second client
  4. Notice that second client can't point at anything anymore

@appgurueu appgurueu added Trivial The change is a trivial bug fix, documentation or maintenance change, as per the Git Guidelines Bugfix 🐛 PRs that fix a bug UI/UX labels Jun 10, 2024
@cx384
Copy link
Contributor

cx384 commented Jun 10, 2024

I like the idea, but I'm not so sure if we really want this.
For example, if a server requires new players to read rules before they can get interact, and if the rules are written down on signs using infotext, new players can't read them anymore. (The rules contain a hidden password/command to grant them interact.) There were/are definitely servers which do this, so this change may break something.

Also, regarding further client side modding, it may problematic if players need interact to point something.
(A similar problem occurs when you prohibit pointing of unauthorized players in protected areas.)

@appgurueu appgurueu added the Won't add The feature request was rejected and will not be added. label Jun 10, 2024
@appgurueu
Copy link
Contributor Author

You're right, this would be a breaking change. I hadn't thought about e.g. infotext. Thanks for pointing this out.

@appgurueu appgurueu closed this Jun 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bugfix 🐛 PRs that fix a bug Trivial The change is a trivial bug fix, documentation or maintenance change, as per the Git Guidelines UI/UX Won't add The feature request was rejected and will not be added.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants