Posted March 25, 20178 yr Is there a reliable way to get the op level of a specific player on a server? We currently use: FMLCommonHandler.instance().getMinecraftServerInstance().canUseCommand(requiredOpLevel, cmdName) where requiredOpLevel is the required Op level for a certain action. Seems to work well in smp and ssp but doesn't work at all on sponge servers or similar. Is there a better way? Edited March 25, 20178 yr by Raycoms
March 25, 20178 yr Author The problem with this is that most permission plugins seem to use permission node which give the player the ability to use certain commands. This seems to give them op in this sense and doesn't work for us I think.
March 25, 20178 yr Author We have custom commands players can call. One of them, for example, is "delete colony". Ops can delete everyone's colonies, players only their owns. In singlePlayer or lan we check if they have op the normal way and if not we restrict the usage. But on a server with permission nodes. We have to allow the whole command usage, and, the player gains op level for that execution because of that.
March 25, 20178 yr Author Yeah me neither. But for some reason a permission node does open a certain command completely.
March 25, 20178 yr Author The problem is that the permission mod only allows binary decisions. Allow a command completely without restrictions or don't allow a command. But since we want to check inside the command the op level of the player, and the permission plugin gives him completely op for that command, this doesn't work. That's why we want a general way to decide it. Thought about checking if the player is allowed to execute a certain sort of commands like gamemode, ban or kick, but that isn't that reliable as well.
March 25, 20178 yr Author -.- Like I said PlayerList::canSendCommands checks if the player is able to send a certain command. Which, even on a server and not op, he might be due to a permission mod. Therefore, this doesn't work.
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.