Patches bug on Bukkit/Spigot servers may result in some players not being kicked on VPN detection.

I believe this occurs when the API response is below 50ms, and we attempt to Player#kickPlayer() or run commands on console that attempt to kick the player. The problem is that if this is running before the tick PlayerLoginEvent runs on ends, the player wouldn't be considered "online". Therefore, the player would never be removed from the server even if desired.

I assumed wrongly that the async processing of the query would always end up on the next tick. So now I update the PlayerLoginEvent result to KICK_BANNED no matter if the processing is async or in the same thread stack as the event.
This commit is contained in:
2023-12-30 14:06:44 -05:00
parent 2bdd7d2c34
commit 5b6d214e6f
9 changed files with 44 additions and 17 deletions
@@ -45,7 +45,6 @@ import java.util.Objects;
@NonnullByDefault
public final class LibraryLoader {
@SuppressWarnings("Guava")
private static final Supplier<URLClassLoaderAccess> URL_INJECTOR = Suppliers.memoize(() -> URLClassLoaderAccess.create((URLClassLoader) AntiVPN.getInstance().getClass().getClassLoader()));
/**