CardinalPGM icon indicating copy to clipboard operation
CardinalPGM copied to clipboard

Admin star doesn't update in the tab

Open ghost opened this issue 9 years ago • 25 comments

ghost avatar May 17 '15 22:05 ghost

You have to relog for the changes to take effect.

SungMatt avatar May 18 '15 00:05 SungMatt

@SungMatt The intended goal though is that you shouldn't have to relog.

connorjayr avatar May 18 '15 01:05 connorjayr

The RankChangeEvent must not be firing

ElliottWhyman avatar May 18 '15 15:05 ElliottWhyman

@CaptainElliott From what I have seen there isn't a PlayerOpEvent, so it can't be fired.

dentmaged avatar May 18 '15 16:05 dentmaged

@dentmaged We can always implement it...

twizmwazin avatar May 18 '15 18:05 twizmwazin

@twizmwazin How will you trigger it? You could use CommandPreprocessEvent. But what about player.setOp(true)?

dentmaged avatar May 18 '15 20:05 dentmaged

@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.

ryanwarsaw avatar May 19 '15 15:05 ryanwarsaw

@ryanw-se How will you tell if the player was just opped? You would need a for loop which is very efficient.

dentmaged avatar May 19 '15 17:05 dentmaged

@dentmaged Just use a scheduled task and filter through any of the players online for rank updates.

ryanwarsaw avatar May 19 '15 18:05 ryanwarsaw

@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 avatar May 19 '15 18:05 dentmaged

@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.

ryanwarsaw avatar May 19 '15 19:05 ryanwarsaw

@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.

ElliottWhyman avatar May 19 '15 20:05 ElliottWhyman

@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.

twizmwazin avatar May 19 '15 21:05 twizmwazin

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>

ghost avatar Jul 26 '15 23:07 ghost

@TiTo-418 You can PR it (https://github.com/twizmwazin/CardinalPGM/blob/master/src/main/resources/ranks.xml)

ghost avatar Jul 26 '15 23:07 ghost

@Alfalik I don't know how to link it with the Op

ghost avatar Jul 26 '15 23:07 ghost

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 avatar Jul 26 '15 23:07 Pablete1234

@Pablete1234 No, the op should have all the perms

ghost avatar Jul 26 '15 23:07 ghost

@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

Pablete1234 avatar Jul 26 '15 23:07 Pablete1234

I think this is resolved

Prodigy4532 avatar Feb 17 '16 03:02 Prodigy4532

@xFracTV it's not

Pablete1234 avatar Feb 17 '16 03:02 Pablete1234

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 avatar Feb 17 '16 03:02 twizmwazin

@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

Pablete1234 avatar Feb 17 '16 04:02 Pablete1234

@twizmwazin Cardinal 2? and @Pablete1234, don't wildcard permissions work in Bukkit? Maybe not SportBukkit because it's for OCN.

dentmaged avatar Feb 17 '16 12:02 dentmaged

@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!

Pablete1234 avatar Feb 17 '16 13:02 Pablete1234