mirror of
https://github.com/LuckPerms/LuckPerms.git
synced 2024-11-24 03:25:19 +01:00
Don't cancel re-allowed connections unless the cancel was made by LP
This commit is contained in:
parent
fa0b66c2dc
commit
5cd5186092
@ -71,13 +71,6 @@ public class BukkitListener implements Listener {
|
||||
ex.printStackTrace();
|
||||
}
|
||||
|
||||
/* the player was denied entry to the server before this priority.
|
||||
log this, so we can handle appropriately later. */
|
||||
if (e.getLoginResult() != AsyncPlayerPreLoginEvent.Result.ALLOWED) {
|
||||
deniedAsyncLogin.add(e.getUniqueId());
|
||||
return;
|
||||
}
|
||||
|
||||
/* there was an issue connecting to the DB, performing file i/o, etc.
|
||||
we don't let players join in this case, because it means they can connect to the server without their permissions data.
|
||||
some server admins rely on negating perms to stop users from causing damage etc, so it's really important that
|
||||
@ -144,13 +137,6 @@ public class BukkitListener implements Listener {
|
||||
At this point, the users data should be present and loaded.
|
||||
Listening on LOW priority to allow plugins to further modify data here. (auth plugins, etc.) */
|
||||
|
||||
/* the player was denied entry to the server before this priority.
|
||||
log this, so we can handle appropriately later. */
|
||||
if (e.getResult() != PlayerLoginEvent.Result.ALLOWED) {
|
||||
deniedLogin.add(e.getPlayer().getUniqueId());
|
||||
return;
|
||||
}
|
||||
|
||||
final Player player = e.getPlayer();
|
||||
final User user = plugin.getUserManager().getIfLoaded(plugin.getUuidCache().getUUID(player.getUniqueId()));
|
||||
|
||||
|
@ -47,9 +47,6 @@ import net.md_5.bungee.api.plugin.Listener;
|
||||
import net.md_5.bungee.event.EventHandler;
|
||||
import net.md_5.bungee.event.EventPriority;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
@ -57,8 +54,6 @@ import java.util.concurrent.TimeUnit;
|
||||
public class BungeeListener implements Listener {
|
||||
private final LPBungeePlugin plugin;
|
||||
|
||||
private final Set<UUID> deniedLogin = Collections.synchronizedSet(new HashSet<>());
|
||||
|
||||
@EventHandler(priority = EventPriority.LOW)
|
||||
public void onPlayerLogin(LoginEvent e) {
|
||||
/* Called when the player first attempts a connection with the server.
|
||||
@ -74,16 +69,6 @@ public class BungeeListener implements Listener {
|
||||
|
||||
final PendingConnection c = e.getConnection();
|
||||
|
||||
/* another plugin (or the proxy itself) has cancelled this connection already */
|
||||
if (e.isCancelled()) {
|
||||
|
||||
// log that we are not loading any data
|
||||
deniedLogin.add(c.getUniqueId());
|
||||
|
||||
e.completeIntent(plugin);
|
||||
return;
|
||||
}
|
||||
|
||||
/* there was an issue connecting to the DB, performing file i/o, etc.
|
||||
as this is bungeecord, we will still allow the login, as players can't really do much harm without permissions data.
|
||||
the proxy will just fallback to using the config file perms. */
|
||||
@ -91,7 +76,6 @@ public class BungeeListener implements Listener {
|
||||
|
||||
// log that the user tried to login, but was denied at this stage.
|
||||
plugin.getLog().warn("Permissions storage is not loaded. No permissions data will be loaded for: " + c.getUniqueId() + " - " + c.getName());
|
||||
deniedLogin.add(c.getUniqueId());
|
||||
|
||||
e.completeIntent(plugin);
|
||||
return;
|
||||
@ -115,7 +99,6 @@ public class BungeeListener implements Listener {
|
||||
|
||||
// there was some error loading
|
||||
plugin.getLog().warn("Error loading data. No permissions data will be loaded for: " + c.getUniqueId() + " - " + c.getName());
|
||||
deniedLogin.add(c.getUniqueId());
|
||||
}
|
||||
|
||||
// finally, complete our intent to modify state, so the proxy can continue handling the connection.
|
||||
|
@ -72,13 +72,6 @@ public class SpongeListener {
|
||||
|
||||
final GameProfile p = e.getProfile();
|
||||
|
||||
/* the player was denied entry to the server before this priority.
|
||||
log this, so we can handle appropriately later. */
|
||||
if (e.isCancelled()) {
|
||||
deniedAsyncLogin.add(p.getUniqueId());
|
||||
return;
|
||||
}
|
||||
|
||||
/* either the plugin hasn't finished starting yet, or there was an issue connecting to the DB, performing file i/o, etc.
|
||||
we don't let players join in this case, because it means they can connect to the server without their permissions data.
|
||||
some server admins rely on negating perms to stop users from causing damage etc, so it's really important that
|
||||
@ -147,11 +140,6 @@ public class SpongeListener {
|
||||
|
||||
final GameProfile player = e.getProfile();
|
||||
|
||||
/* the player was denied entry to the server before this priority. */
|
||||
if (e.isCancelled()) {
|
||||
return;
|
||||
}
|
||||
|
||||
final User user = plugin.getUserManager().getIfLoaded(plugin.getUuidCache().getUUID(player.getUniqueId()));
|
||||
|
||||
/* User instance is null for whatever reason. Could be that it was unloaded between asyncpre and now. */
|
||||
|
Loading…
Reference in New Issue
Block a user