Z0rdak / Yet-Another-World-Protector

Yet Another World Protector is a server-side protection mod which allows you to protect your creations against various different events/actions of players, mobs and the environment. It was inspired by the forge mod WorldProtector and the WorldGuard plugin.
https://www.curseforge.com/minecraft/mc-mods/yawp
GNU Affero General Public License v3.0
19 stars 8 forks source link

Cannot disable commands for default users #96

Closed JavierMarinGuimera closed 5 months ago

JavierMarinGuimera commented 11 months ago

Am I doing anythign wrong? I want to disable ALL commands from "/yawp" and this is my yawp-common.toml error yawp Is there any option like "disable-all-commands" or something like that?

Z0rdak commented 11 months ago

Hey,

there is no such option to disable all commands. I might add something like this.

The commands of the mods are not disabled with these options in the way that the players are no longer able to see them in the console.

Disabling these commands entirely is not as easy as it seems, because they are also based on region membership, which is very dynamic.

Instead, there is a permission check to use these commands.

With your options, players should be able to see the commands but should not be allowed to execute them.

That said, I just noticed that the /wp marker give command are not considered with this permission check.

I am looking into adding support for LuckyPerms to make handling YAWP commands easier.

JavierMarinGuimera commented 11 months ago

But then how do you prevent simple players from executing commands for example /yawp marker give? I mean, if I don't have OP permisions, I shouldn't be able to execute those commands because I can troll everyone by setting up a region for the entire world, right?

Also, with the config that I posted, simple players shouldn't be able to even see the command "/yawp" when they type the slash and I can see it even with that config.

JavierMarinGuimera commented 11 months ago

Btw, thank you for your answer!

Z0rdak commented 11 months ago

I think I have not expressed myself clearly enough. I'll try it again.

Also, with the config that I posted, simple players shouldn't be able to even see the command "/yawp" when they type the slash and I can see it even with that config.

That's not true (I am using a custom permission system, because the default vanilla one does not quite fit my needs).

The config does not prevent simple players from seeing the commands. It does prevent simple players from executing the commands, though.

Have you tried to execute the commands with this config setup as a simple player? You should get a message which tells you that you don't have the needed permission.

But then how do you prevent simple players from executing commands for example /yawp marker give?

This specific command (/yawp marker give) is not yet covered – I simply forgot it. I'll add this in the next patch, so players can't use this command. But even with the RegionMarker simple players should not be able to create regions with your config setup – try it out.

JavierMarinGuimera commented 11 months ago

I already tried to create a region without any permissions and it let me create it. Let me check again, but I'm 99% sure that I had no OP privileges or something similar.

I'll tell you in a couple of minutes.

JavierMarinGuimera commented 11 months ago

Wait, the command is not showing to me right now xd

I love this thing. The moment I notify about a problem is the moment when the problem is solved (apparently) xddddddddd

imagen

JavierMarinGuimera commented 11 months ago

By the way, I have done this on LuckPerms and appears to work correctly (it's writen in Spanish, just in case): imagen

JavierMarinGuimera commented 11 months ago

Nevermind. I don't know what happened but the command appears again. I had to restart the server and had to make some changes on a voice chat file. imagen

But yes, you are true, people cannot create zones: imagen

Z0rdak commented 11 months ago

Thanks for the heads-up.

I'll think about a config option to disable specific commands entirely, except for OPs and the server console.

EnderMelody commented 5 months ago

still having this problem on version 0.0.2.9-beta3 on fabric 1.20.4. really like the mod but this problem makes it unusable.

Z0rdak commented 5 months ago

There are no changes in this version. Its just a port fort 1.20.4.

The next (WIP) update already has some features that should cover this until the LuckPerms integration is done.

EnderMelody commented 5 months ago

ah my bad i assumed there was an update since then. looking forward to the fix as this mod is very promising. and thanks for the quick response.

Z0rdak commented 5 months ago

Resolved by https://github.com/Z0rdak/Yet-Another-World-Protector/commit/8b350a12a581365ec5781b82878286bd1146840e and the dedicated checks for the marker command.

Will be released with YAWP 0.0.3.0-beta