Don't cancel re-allowed connections unless the cancel was made by LP

This commit is contained in:
Luck 2017-06-26 21:39:59 +01:00
parent fa0b66c2dc
commit 5cd5186092
No known key found for this signature in database
GPG Key ID: EFA9B3EC5FD90F8B
3 changed files with 0 additions and 43 deletions

View File

@ -71,13 +71,6 @@ public class BukkitListener implements Listener {
ex.printStackTrace(); 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. /* 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. 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 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. 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.) */ 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 Player player = e.getPlayer();
final User user = plugin.getUserManager().getIfLoaded(plugin.getUuidCache().getUUID(player.getUniqueId())); final User user = plugin.getUserManager().getIfLoaded(plugin.getUuidCache().getUUID(player.getUniqueId()));

View File

@ -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.EventHandler;
import net.md_5.bungee.event.EventPriority; 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.UUID;
import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeUnit;
@ -57,8 +54,6 @@ import java.util.concurrent.TimeUnit;
public class BungeeListener implements Listener { public class BungeeListener implements Listener {
private final LPBungeePlugin plugin; private final LPBungeePlugin plugin;
private final Set<UUID> deniedLogin = Collections.synchronizedSet(new HashSet<>());
@EventHandler(priority = EventPriority.LOW) @EventHandler(priority = EventPriority.LOW)
public void onPlayerLogin(LoginEvent e) { public void onPlayerLogin(LoginEvent e) {
/* Called when the player first attempts a connection with the server. /* 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(); 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. /* 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. 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. */ 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. // 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()); 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); e.completeIntent(plugin);
return; return;
@ -115,7 +99,6 @@ public class BungeeListener implements Listener {
// there was some error loading // there was some error loading
plugin.getLog().warn("Error loading data. No permissions data will be loaded for: " + c.getUniqueId() + " - " + c.getName()); 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. // finally, complete our intent to modify state, so the proxy can continue handling the connection.

View File

@ -72,13 +72,6 @@ public class SpongeListener {
final GameProfile p = e.getProfile(); 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. /* 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. 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 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(); 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())); 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. */ /* User instance is null for whatever reason. Could be that it was unloaded between asyncpre and now. */