Jump to content

Get Op level of player on server


Raycoms

Recommended Posts

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 by Raycoms
Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.