Change to command logic for compatibility with LuckPerms
authvin opened this issue ยท 6 comments
When running OTG on SpongeForge alongside LuckPerms, neither commands nor the O menu work as intended, because LuckPerms "disables" the OP system. The game sees everyone as OP, and LuckPerms instead makes everything rely on permissions. As OTG isn't designed to fit in with Sponge permissions, this fails, and the GUI opens for any player on the server.
Sponge handles permissions by taking the command name string in a canCommandSenderUseCommand(int permlevel, String commandName) and making it a permission. So, if we sent "openterraingenerator.openui" as a commandname in the code that opens the ui, then vanilla Forge still only looks at the permLevel int, but Sponge now checks to see the user has the permission given as CommandName. Right now the commandName string is just the name of the command (like "map" or "biomes"), whereas with this change it'd be "openterraingenerator.map" or something along those lines. Again, as far as I'm aware this should not change Forge behaviour at all, and should make it compatible with LuckPerms.
Normally I would change this myself and submit a pull request, but I'm without a PC for a few days so I'm submitting the idea as a ticket instead for now.
TL;DR: Change how the names of commands are passed to fit the Sponge standard
This is unlikely to be implemented anywhere in the near future, because:
- OTG does not officially support Sponge
- This seems like a Luckperms problem
I know OTG doesn't officially support Sponge, but that doesn't mean we can't fix a simple compatibility error for a popular plugin. And I thought it was a LuckPerms problem too at first, but they follow Sponge standard just fine. If this is to be fixed, it has to be done from OTG's side. And like I said, I'm very much willing to implement this myself and submit a pull request. It's not a big change.
because LuckPerms "disables" the OP system
I thought it was a LuckPerms problem
I mean it still sounds like a LuckPerms problem.
The incompatibility comes from OTG not following Sponge permission standards. Considering how easy it is to comply with that standard, I'd say this is an OTG problem, not a LuckPerms one.
This is an issue with OTG not following Forge permission standards not Sponge or LuckPerms.
LuckPerms is simply forcing a low op permission level.
Checking for OP status doesn't necessarily mean that a user has permission as there is an OP permission level specified in the server.properties file hence the presence of permLevel parameter on canCommandSenderUseCommand
#441 should fix this