EssentialsX

EssentialsX

2M Downloads

Vanish and SilentJoin bug [GroupManager]

PlugITNow opened this issue · 13 comments

commented

EssentialsX version (/essentials):
EssentialsX-2.0.1 (build #545)

Server software (/version):
PaperSpigot-1.8.8-R0.1-SNAPSHOT

Bug description
When an opped player connect on the server, he isn't vanished and the silent join doesnt work.
It's very annying because players can see the staff

I precise that I have silent join and quit on true on my config

commented

I have tested this on GroupManager with Vault. The correct permissions are being reported by both. ElgarL/GroupManager#93 (comment)
The join message is correctly muted but the quit is not. This is an Essentials issue which is here -

if (base instanceof OfflinePlayer) {

if (base instanceof OfflinePlayer) {

if (base instanceof OfflinePlayer) {

Those instanceof checks are always going to pass, as a Player is also an instanceof OfflinePlayer. It's never going to get beyond that and as such is going to treat all checks which go through there as OfflinePlayer/no permission. Reverse it if you want that test to work...
if (!(base instanceof Player)) {

Here are the actual perms as reported by Vault and those Essentials thinks it has due to the OfflinePlayer instanceof always passing.
[13:33:32] [Server thread/INFO]: Permission test (essentials.silentquit) true
[13:33:32] [Server thread/INFO]: checking if ElgarL has essentials.silentquit - false

import org.bukkit.Bukkit;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerQuitEvent;
import org.bukkit.plugin.Plugin;
import org.bukkit.plugin.RegisteredServiceProvider;

import net.milkbowl.vault.permission.Permission;

public class Permissions implements Listener {

	Plugin plugin;
	private Permission perms;

	public Permissions(Plugin plugin) {

		this.plugin = plugin;
		setupPermissions();
	}

	@EventHandler
	public void event(PlayerQuitEvent event) {

		Bukkit.broadcastMessage("Permission test (essentials.silentquit) " + perms.has(event.getPlayer(), "essentials.silentquit"));
	}

	private boolean setupPermissions() {

		RegisteredServiceProvider<Permission> rsp = plugin.getServer().getServicesManager().getRegistration(Permission.class);
		perms = rsp.getProvider();
		return perms != null;
	}
}
commented

Yeah I've been looking into this more and this does not fix your issue.

I have after many hours of digging found the cause. It is GroupManager removing the permission attachment (clean-up) at the same priority (HIGHEST) as EssentialsX performs its PlayerQuit.
I have delayed the clean-up by 1 tick in the pre-release of GroupManager https://github.com/ElgarL/GroupManager/releases/tag/v3.0-SNAPSHOT

This issue can now be closed properly on both ends.

commented

Make sure you've granted the relevant permissions to the group that should be vanished on join; to my knowledge, these are essentials.silentjoin (silent join), essentials.silentquit (silent disconnect) and essentials.silentjoin.vanish (vanish on join).

commented

If you run /vanish after connecting, what message appears?

commented

The group already have thoses perms

commented

I have the same bug.
Only owner group has all the relevant vanish/silent join/quit permissions
Yet admin and mod groups join silently/part silently and also when they login they are also in vanish
So i added both to the individual users and groups: -essentials.vanish, -essentials.silentjoin, -essentials.silentquit, -essentials.silentjoin.vanish - still having same problem
so i removed the g:vanish_mod from global groups - still happening
in between each step ive tried, user log in vanished, so i get them to un vanish, (getting a message saying vanish is disabled making us visible to users) get them to log out and in to check the permissions went through, but they log back in, in vanish again. Ive gone into their individual user files removed anything even remotely associated with vanish (while they were visible) and same thing still occurs

commented

@FatmanC This is a different problem. Please open a separate issue for this problem.

commented

ok

commented

@md678685

it show "Invisibility for [Dev] PlugIT : activated" and another green message after "You are now invisible"

Debug mode show, no one of thoose perm are working (i tried to give it manually or by groups) :

[15:28:50] [Server thread/INFO]: [Essentials] checking if PlugIT has essentials.vanish.see - false
[15:28:50] [Server thread/INFO]: [Essentials] checking if PlugIT has essentials.sleepingignored - false
[15:28:50] [Server thread/INFO]: [Essentials] checking if PlugIT has essentials.silentjoin - false
[15:28:50] [Server thread/INFO]: [Essentials] checking if PlugIT has essentials.silentjoin.vanish - false
[15:28:50] [Server thread/INFO]: �[0;30;1m[�[0;32;1m+�[0;30;1m] �[0;31;1m[Dev] �[0;31;22m�[21mPlugIT�[m�[m
[15:28:50] [Server thread/INFO]: [Essentials] looking up groupname of PlugIT - dev
[15:28:50] [Server thread/INFO]: [Essentials] checking if PlugIT has essentials.motd - false
[15:28:50] [Server thread/INFO]: [Essentials] checking if PlugIT has essentials.mail - false
[15:28:50] [Server thread/INFO]: [Essentials] checking if PlugIT has essentials.fly.safelogin - false
[15:28:50] [Server thread/INFO]: [Essentials] checking if PlugIT has essentials.speed - false

commented

GroupManager is not supported - please switch to a supported permissions plugin such as PermissionsEx or LuckPerms.

commented

What permissions plugin are you using?

commented

EssentialsGroupManager

commented

For people who want to keep on GroupManager, erasing the '*' perm of groups / player perms solve the issue, for others PEX is better ^^