mirror of
https://github.com/LuckPerms/LuckPerms.git
synced 2024-11-24 19:46:32 +01:00
Don't force cancel Sponge ClientConnection.Join if the cancellation state changes, shuffle event orders slightly - fixes #335
This commit is contained in:
parent
cf5318b92b
commit
8e224c4a27
@ -64,7 +64,7 @@ public class SpongeListener {
|
|||||||
private final Set<UUID> deniedAsyncLogin = Collections.synchronizedSet(new HashSet<>());
|
private final Set<UUID> deniedAsyncLogin = Collections.synchronizedSet(new HashSet<>());
|
||||||
private final Set<UUID> deniedLogin = Collections.synchronizedSet(new HashSet<>());
|
private final Set<UUID> deniedLogin = Collections.synchronizedSet(new HashSet<>());
|
||||||
|
|
||||||
@Listener(order = Order.AFTER_PRE)
|
@Listener(order = Order.EARLY)
|
||||||
@IsCancelled(Tristate.UNDEFINED)
|
@IsCancelled(Tristate.UNDEFINED)
|
||||||
public void onClientAuth(ClientConnectionEvent.Auth e) {
|
public void onClientAuth(ClientConnectionEvent.Auth e) {
|
||||||
/* Called when the player first attempts a connection with the server.
|
/* Called when the player first attempts a connection with the server.
|
||||||
@ -120,7 +120,7 @@ public class SpongeListener {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Listener(order = Order.BEFORE_POST)
|
@Listener(order = Order.LAST)
|
||||||
@IsCancelled(Tristate.UNDEFINED)
|
@IsCancelled(Tristate.UNDEFINED)
|
||||||
public void onClientAuthMonitor(ClientConnectionEvent.Auth e) {
|
public void onClientAuthMonitor(ClientConnectionEvent.Auth e) {
|
||||||
/* Listen to see if the event was cancelled after we initially handled the connection
|
/* Listen to see if the event was cancelled after we initially handled the connection
|
||||||
@ -137,7 +137,7 @@ public class SpongeListener {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Listener(order = Order.AFTER_PRE)
|
@Listener(order = Order.FIRST)
|
||||||
@IsCancelled(Tristate.UNDEFINED)
|
@IsCancelled(Tristate.UNDEFINED)
|
||||||
public void onClientLogin(ClientConnectionEvent.Login e) {
|
public void onClientLogin(ClientConnectionEvent.Login e) {
|
||||||
try (Timing ignored = plugin.getTimings().time(LPTiming.ON_CLIENT_LOGIN)) {
|
try (Timing ignored = plugin.getTimings().time(LPTiming.ON_CLIENT_LOGIN)) {
|
||||||
@ -147,10 +147,8 @@ public class SpongeListener {
|
|||||||
|
|
||||||
final GameProfile player = e.getProfile();
|
final GameProfile player = e.getProfile();
|
||||||
|
|
||||||
/* the player was denied entry to the server before this priority.
|
/* the player was denied entry to the server before this priority. */
|
||||||
log this, so we can handle appropriately later. */
|
|
||||||
if (e.isCancelled()) {
|
if (e.isCancelled()) {
|
||||||
deniedLogin.add(player.getUniqueId());
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -192,7 +190,7 @@ public class SpongeListener {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Listener(order = Order.BEFORE_POST)
|
@Listener(order = Order.LAST)
|
||||||
@IsCancelled(Tristate.UNDEFINED)
|
@IsCancelled(Tristate.UNDEFINED)
|
||||||
public void onClientLoginMonitor(ClientConnectionEvent.Login e) {
|
public void onClientLoginMonitor(ClientConnectionEvent.Login e) {
|
||||||
/* Listen to see if the event was cancelled after we initially handled the login
|
/* Listen to see if the event was cancelled after we initially handled the login
|
||||||
@ -214,7 +212,7 @@ public class SpongeListener {
|
|||||||
plugin.doAsync(() -> LoginHelper.refreshPlayer(plugin, e.getTargetEntity().getUniqueId()));
|
plugin.doAsync(() -> LoginHelper.refreshPlayer(plugin, e.getTargetEntity().getUniqueId()));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Listener(order = Order.LAST)
|
@Listener(order = Order.POST)
|
||||||
public void onClientLeave(ClientConnectionEvent.Disconnect e) {
|
public void onClientLeave(ClientConnectionEvent.Disconnect e) {
|
||||||
/* We don't actually remove the user instance here, as Sponge likes to keep performing checks
|
/* We don't actually remove the user instance here, as Sponge likes to keep performing checks
|
||||||
on players when they disconnect. The instance gets cleared up on a housekeeping task
|
on players when they disconnect. The instance gets cleared up on a housekeeping task
|
||||||
|
Loading…
Reference in New Issue
Block a user