Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vanished Players from PremiumVanish still add to playercount #265

Open
Seeroh opened this issue Oct 15, 2019 · 5 comments
Open

Vanished Players from PremiumVanish still add to playercount #265

Seeroh opened this issue Oct 15, 2019 · 5 comments
Labels

Comments

@Seeroh
Copy link

Seeroh commented Oct 15, 2019

There is a closed issue about this, but I thought I'd create a new one.

Players hidden via PremiumVanish aren't removed from the total playercount in the server selector. The PV dev had this to say in May of last year, for this particular issue

Hey, PV adjusts the player count of the motd with "high" priority so you should be hidden in the player count IF SLP doesnt override the player count variable with some kind of custom colored player count string and if it doesnt have a higher priority than "high". PV doesnt change and cant change the motd player samples bungee-sided since that isnt a feature in vanilla Bungeecord and is only changed by plugins like SLP. It looks like SLP is in charge of your motd so you need to configure it properly so it doesnt reveil vanished players or you can contact SLP's author if that's not possible through configuration, PV has a Bungeecord API so the author can add support for it.

The API is here PremiumVanishAPI

@stephan-gh
Copy link
Member

Two cases must be discussed separately here:

  • Player count and %online% placeholder
  • Player list (i.e. the %random_players% placeholder and %online@server%)

Player count / %online% placeholder

If I understand you correctly, this is your main problem (and the reason for opening this issue).

In general, ServerListPlus does not touch the online player count.
The only exception is the (seemingly) displayed player count if you are using the custom Player Slots feature. (Is this the case?)

In this case, SLP inserts the player count that is currently configured in the response. That means that other plugins have the chance to modify the player count before SLP. So if PV would reduce the player count before SLP runs, the player count would be correct even when using the custom Player Slots feature.

Therefore, in this case, using the high priority for PV's event listener is actually the problem here. If it would run at low priority, and change the player count early, SLP could pick up the correct player count.

=> In my opinion, this is a problem in PV.

Player list

SLP does not remove vanished players if generating the player list itself. So if you use the %random_players% or %online@server% placeholder, vanished players will be included eventually.

This problem can only be solved if SLP uses some API to check if the player is vanished before including it in the list generated by the placeholder.

This can be implemented in two ways:

  1. SLP provides an API the vanish plugins can hook into
  2. SLP hooks into all the vanish APIs

You propose that I implement (2), i.e. call PremiumVanishAPI from SLP.

However, at least for PremiumVanish, (1) is the only possible option for me. This is because I do not want to support any proprietary (i.e. closed-source) plugins directly from SLP. I strongly believe in open-source and do not want to encourage proprietary plugins by supporting them directly in SLP. (Note: this is about the source code, not "premium" plugins...) Sorry :/

Option (1) would allow PremiumVanish to hook into SLP (instead of the other way around).
However, this API does not exist yet. But there is an open issue for this at #157.

@Jaimss
Copy link

Jaimss commented Dec 27, 2019

I accidentally posted another issue relating to this, so I will probably close it. That can be found here. I am not sure if what I am saying is 100% accurate, but I believe that PremiumVanish uses ProtocolLib to modify server lists. Is there a way that SLP could look for a player count from there, or am I dreaming?

Also, I am finding the issue with both the %online% and %online@server% placeholders.

@stephan-gh
Copy link
Member

SLP does also use ProtocolLib, so the comment above also applies to ProtocolLib IMO.

@Jaimss
Copy link

Jaimss commented Dec 30, 2019

So the only way for these placeholders to hide vanished players is for us to go to our respective vanish plugins and request that they hook into SLP. If that is the only way, is there an ETA on the API?

@stephan-gh
Copy link
Member

The first step would be fixing the "Player count / %online% placeholder" problem explained above. This one does not require hooking into SLP, just getting the priorities right.

For the other placeholders more work is needed. I don't have any ETA for it, SLP has been in "bugfixes only" mode for a while now since I have pretty much lost all interest in Minecraft. Contributions are very welcome of course, and I would gladly assist anyone who would like to work on improving SLP.

@stephan-gh stephan-gh modified the milestone: 3.5.0 May 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants