CodeCrafter47 / BungeeTabListPlus

GNU General Public License v3.0
148 stars 70 forks source link

PlayerOrder Vault with LuckPerms #263

Open BastienCUENOT opened 7 years ago

BastienCUENOT commented 7 years ago

Hi, I try to put VaultGroupInfo in playerorder but it doesn't work. I have Luckperms plugins and the weight are set. The placeholders with Vault work as ${viewer vault_player_prefix}....

CodeCrafter47 commented 7 years ago

Can you explain what you mean with "doesn't work". Are the players ordered randomly, mostly correct or is the order just reversed?

BastienCUENOT commented 7 years ago

My orderplayer is: playerOrder: "AFKLast,vaultGroupInfo,alphabetically" The players are ordered by alphabetically and Afk but no with their groups. And if i make only vaultGroupInfo, it's random

CodeCrafter47 commented 7 years ago

You might have to use /lp group <group> meta set weight <weight> to set the weight (it'll set a value different to the weight used by LuckPerms, but BungeeTabListPlus will be able to read it).

BastienCUENOT commented 7 years ago

I use the parent groups and not primarygroup. All players have same default primarygroups and differents parents groups. With primarygroups that's work but i must use parent groups. How I can make ?

CodeCrafter47 commented 7 years ago

I don't know. Ask someone with more knowledge of LuckPerms.

mibby commented 7 years ago

@CodeCrafter47 I recently made the move from PermissionsEx to LuckPerms and seem to be experiencing this issue as well.

LuckPerms prioritizes groups based on the higher value of their weight rather than how PEX relied on a lower number for higher priority. For my grouping, I have all groups with the default weight of 5 with staff positions sorted in order of 6-10.

  playerOrder: "vaultGroupInfo,alphabetically"

BungeeTabListPlus no longer seems to sort the staff ranked players on top of the tab list like it did with PermissionsEx. Thus would it be possible to fix LuckPerms weight sorting / vault reading or allow an inverted weight sort from high to low rather than low to high?

LuckPerms + Vault + BungeeTabListPlus_BukkitBridge are installed on each Bukkit server; BungeeTabListPlus is installed on Bungee directly. Both luckpermsgroupinfo & luckpermsgroupinforeversed seem to do nothing for me.

BungeeTabListPlus dev 711 LuckPerms dev 362

CodeCrafter47 commented 7 years ago

You can use vaultGroupInfoReversed to sort the players the other way round. The luckperms options for sorting players only work if luckperms is installed on BungeeCord.

mibby commented 7 years ago

Ah, I see. Unfortunately vaultGroupInfoReversed doesn't seem to work for me though. Users don't seem to be sorted by their group weight.

CodeCrafter47 commented 7 years ago

LuckPerms doesn't expose the group weight through Vault, you need to set the group meta. See my comments above.

mibby commented 7 years ago

The group meta weight is set on all groups.

For example.

Admin

name: admin
permissions:
- group.mod
- prefix.11.&4
- weight.11

Member

name: member
permissions:
- prefix.5.&b
- weight.5

However with the following, players are just sorted alphabetically. Admins / staff aren't sorted above everyone else.

  playerOrder: "vaultGroupInfoReversed,alphabetically"
CodeCrafter47 commented 7 years ago

Have you checked whether BTLP is able to detect the bridge plugin using the /btlp status command?

mibby commented 7 years ago

The bridge is detected properly so I can only assume weight detection is broken within BTLP.

[06:10:33] [Console Command Thread #0/INFO]: You are running BungeeTabListPlus version 2.8.2-SNAPSHOT
[06:10:33] [Console Command Thread #0/INFO]: Looking for an update...
[06:10:33] [Console Command Thread #0/INFO]: You are already running the latest version.
[06:10:33] [Console Command Thread #0/INFO]: Servers with the bridge plugin: server1, server2
[06:10:33] [Console Command Thread #0/INFO]: Servers with PlaceholderAPI: server1, server2
[06:10:33] [Console Command Thread #0/INFO]: Thanks for using BungeeTabListPlus.
mibby commented 7 years ago

@CodeCrafter47 Any ideas for what else it could be?

CodeCrafter47 commented 7 years ago

Not really. The weight information is passed from LuckPerms through Vault to the bridge plugin which passes it to BungeeTabListPlus. And something can go wrong anywhere. You should make sure you're using the latest version of all these plugins and you can use the /vault-info command to check whether it uses LuckPerms as permission provider.

mibby commented 7 years ago

/vault-info is returning LuckPerms correctly as the permission provider.

[03:17:05 INFO]: [Vault] Vault v1.6.1 Information
[03:17:05 INFO]: [Vault] Economy: Essentials Economy [LuckPerms]
[03:17:05 INFO]: [Vault] Permission: LuckPerms [LuckPerms, SuperPerms]
[03:17:05 INFO]: [Vault] Chat: LuckPerms [LuckPerms]

I am already using the latest dev builds of all 3 plugins (LuckPerms / Vault / BungeeTabListPlus & Bridge). So again, I can only assume that the weight detection itself is broken from within BTLP.

Is it possible to debug whether BTLP is receiving the weight values or not for sorting?

CodeCrafter47 commented 7 years ago

I'm afraid there's no way to get more insight into what BTLP does under the hood.

mibby commented 7 years ago

Could you perhaps take a look into why it doesn't work then when you get a chance?

Second account should be shown first on tab due to weight priority, but they aren't re-sorted to be shown first.

CodeCrafter47 commented 7 years ago

Thanks. I'll look into it later.

CodeCrafter47 commented 7 years ago

As I've already mentioned above, LuckPerms doesn't expose the weight value it uses internally, but only the meta values. You need to set the weight using the /lp group <group> meta set weight <weight> command, then it'll work. The permission node that command creates looks as follows:

permissions:
- meta.weight.10
mibby commented 7 years ago

Oh! Meta.weight isn't the same thing as normal weight value. Thought you were referring to the actual weight set, my bad! Setting meta does seem to fix it, thanks. :)

mibby commented 7 years ago

Running into a slight issue. All groups seem to order fine with the exception of the default (guest in my case) group. Players who login to the server with the default group, they are always being sorted to the top to be displayed first. No matter what the meta weight value is set.

Edit: Removing the invert (to have normal vault sorting) and changing all weight from low to high forces guests at the bottom. This works for me. :)

elstur commented 6 years ago

@CodeCrafter47 This fixed the playerOrder issue, but not the playerSet filters for sorting rules. It still ignores luckperms/vault primary group when trying to tell BTLP which player groups to load first.

  global:
    filter: "true"
    hiddenPlayers: VISIBLE_TO_ADMINS
  currentserver:
    filter: "${player server} == ${viewer server}"
    hiddenPlayers: VISIBLE_TO_ADMINS
  owners:
    filter: ${player luckperms_primary_group} == "owner"
  admins:
    filter: ${player luckperms_primary_group} == "admin"
  mods:
    filter: ${player luckperms_primary_group} == "moderator"

and so on will show in any order

CodeCrafter47 commented 6 years ago

Could you post you're entire config please.

elstur commented 6 years ago

https://hastebin.com/fakohewoma.bash That's my whole config. When I used Pex, this sorting method worked great with Vault_primary_group

Now, using either vault_primary_group or luckperms_primary_group, neither results in a correct filter. It's the same as no filter.

Desired effect: Show owners/admins/mods/etc on top, followed by donors, followed by everyone else

All ranks have both a weight and meta weight.

CodeCrafter47 commented 6 years ago

Using LuckPermsGroupInfo or any of the LuckPerms placeholders requires LuckPerms to be installed on BungeeCord and will take the information from LuckPerms running on Bungee.

If you're using LuckPerms only on your Spigot servers you should continue to use the vault placeholders and for the playerOrder you should use VaultGroupInfoReversed. If you're having issues make sure you're using recent versions of BungeeTabListPlus and LuckPerms.

elstur commented 6 years ago

I have luckperms set up correctly and it is installed on my bungee. Everything is working correctly except for that one single feature. My tab player colors filter correctly, my playerOrder is working correctly. But my filter for what order to display ranks in is not.

Just to get it out of the way: I am a fanatic about keeping plugins up-to-date. I am using the most recent versions of luckperms, bungeetablistplus and spigot. I verify all of my plugins every week to check for updates.

CodeCrafter47 commented 6 years ago

Can you explain what you mean by my filter for what order to display ranks in? To my knowledge the only way to influence the order players are displayed in is the playerOrder option.

elstur commented 6 years ago

The filter I posted above worked when I used PEX with vault group perms. It does not work now that I have switched to LuckPerms.

Here is how it used to be: Owner1 Owner2 Admin Mod Helper Donator Normal Player1 Normal Player2

Here is how it is now: Normal Player2 Owner1 Mod Owner2 Normal Player1 Donator Admin Helper

It used to be ordered by rank with the filter config I posted above. Now that is not working.

CodeCrafter47 commented 6 years ago

There is no filter that influences the order of players. It works like this: If you're using PEX or another Spigot permission plugin you set the playerOrder to VaultGroupInfo, if you're using LuckPerms on BungeeCord you set it to LuckPermsGroupInfo. Then BungeeTabListPlus will ask your permission plugin for the weight of each group and use that to determine the order in which the players appear. I think you need to set the weight of your groups.

elstur commented 6 years ago

I feel like I'm not being understood.

I used a playerSet (as shown in my config and in the post that I initially made) to filter the order in which ranks are displayed in tab on my server so that staff are listed above everyone else. This worked for an entire year until I switched to luckperms.

To quote the config itself: # Player sets are required to display players and player counts on the tab list. So, if a player set is needed to display players, it makes sense to me that this is the area I would choose which sets of players to display, right? But now, it's not working at all.

CodeCrafter47 commented 6 years ago

I think you misunderstand how the configuration file works.

In the playerSets section you can define different player sets, i.e. creating some filters and giving a name to each. In fact that is the only purpose of this part of the config: associating a name with a filter. It only indirectly influences which players are displayed and has absolutely no effect on the order in which the players are displayed. Player sets that are no referenced elsewhere in the config have no effect on the tab list. Since the currentserver player set is the only one you're using the others are basically ignored by the plugin.

Further towards the bottom of your config you have a line saying playerSet: currentserver. This line is used to configure which players are displayed. The plugin will look up the name given here in the playerSets section to find the corresponding filter to select the players to be displayed. Note that this line too has no effect on the order in which the players are displayed.

The next line in your config says playerOrder: "LuckPermsGroupInfo,alphabetically". This is where the order in which the players appear can be configured. Note that this is the only option in the config has an effect on the player order. Setting it to LuckPermsGroupInfo,alphabetically tells the plugin to first use the groups from LuckPerms and sort them by their weight, displaying groups with highest (I think) weight first, and sorting players within the same group by their name. If you did no assign weights to your groups then the players are sorted just by their name.

elstur commented 6 years ago

Then I definitely misunderstood playersets. Groups are weighted (both meta and weight), LP is installed and working on bungee and my config is above but players are still sorting only by name. What else could I be missing?

CodeCrafter47 commented 6 years ago

I don't know what else could be wrong. You can double check on the group weights using the /lpb listgroups command and also check the proxy log for errors.

elstur commented 6 years ago

Groups were listed with correct weights and there were no errors. I switched it to LuckPermsGroupInfoReversed and it appears to be working.

andrewkm commented 5 years ago

For the record, playerOrder: "vaultGroupInfoReversed" works great for us on LuckPerms here. Found this ticket via google, thought I'd drop in and perhaps mention it's fixed.