CardinalPGM
CardinalPGM copied to clipboard
Admin star doesn't update in the tab
You have to relog for the changes to take effect.
@SungMatt The intended goal though is that you shouldn't have to relog.
The RankChangeEvent
must not be firing
@CaptainElliott From what I have seen there isn't a PlayerOpEvent
, so it can't be fired.
@dentmaged We can always implement it...
@twizmwazin How will you trigger it? You could use CommandPreprocessEvent. But what about player.setOp(true)?
@dentmaged There is a method provided by the Bukkit API called player.isOp()
which returns a boolean value depending on if the user is op or not. No need to use CommandPreprocessEvent.
@ryanw-se How will you tell if the player was just opped? You would need a for loop which is very efficient.
@dentmaged Just use a scheduled task and filter through any of the players online for rank updates.
@ryanw-se That can cause a lot of lag. Think about a large explosion and all the timed modules that are being ran combined with the for loop.
@dentmaged Your just checking to see if anyone is OP and if they are, update the tab list name. It can be ran every minute or so and I don't see how that will cause a "lot of lag".
Another idea, Cardinal could implement its own /op command that could be used to trigger this as well and filter out /op from being used directly. That would allow Cardinal to wrap around the command and provide events for it.
@ryanw-se Although that would be the best solution there is still the op's manually entered into the ops.json. However we could just check that on the server reload.
Actually they should automatically update when the server it reloaded and the ops take affect, nvm.
@dentmaged If the task is run not on the main thread (async), then it won't create any server lag unless the server is being run on a single-threaded CPU.
I'll post this here it isn't really an issue: I think the "admin" should be a rank (in the ranks.xml), so people can change the flair and the color.
<rank name="Operator" op="true" flair="`6❖">
</rank>
@TiTo-418 You can PR it (https://github.com/twizmwazin/CardinalPGM/blob/master/src/main/resources/ranks.xml)
@Alfalik I don't know how to link it with the Op
Maybe the same way there's a default rank there should be an op default, and /op should be an "alias" of that rank, that way you can also remove permissions from op's
@Pablete1234 No, the op should have all the perms
@TiTo-418 why not? make "default" be able to be "true, false, or op", (only 1 default and only 1 op), that way you can change the op flair, and maybe remove permissions, and you can also if someone is given the rank with a "default=op" tag they will get opped, or if someone gets opped they will get the op rank
I think this is resolved
@xFracTV it's not
The way I'd like to fix this is in Cardinal2 is to not recognize op'd players. Admin should be a rank along side other ranks that has the same permissions as an op, but without actually op'ing the user.
The reason why this bug has existed for so long is that Bukkit doesn't provide a hook when players are op'ed or deop'ed, and the only proposed workaround is periodically checking if any players have gained or lost "op."
@twizmwazin it would be easy to implement if wildcard imports worked, just make and admin rank, with the permission *, and done, the thing is, other plugins may use "player.isOp()" to test if someone has permission, and it would cause issues if you never give op to anyone.
Maybe a workarround would be to do the same we do to prevent /msg when you are muted, detect either /op or /minecraft:op, and trigger a rank update event 1 tick after that
@twizmwazin Cardinal 2? and @Pablete1234, don't wildcard permissions work in Bukkit? Maybe not SportBukkit because it's for OCN.
@dentmaged it's a cardinal thing, because permissions are not specified in the plugin yml (with parents and all of the tree structure etc) @twizmwazin YOU REVEALED THE SECRET!