From 903ada06f02924d160408a49bdf5b2609b409c4a Mon Sep 17 00:00:00 2001 From: Zartec Date: Thu, 3 Mar 2016 18:27:47 +0100 Subject: [PATCH] Sould break the priority lookup after server found If the list would look like this - test1 -> 1.8 -> ServerKickEvent cancelled -> reason set to "outdated" - test2 -> 1.8 - test3 -> 1.9 and a player joins with version 1.8 he would never be connected to test2 because the server test2 is not equal to test1 and the server test3 is not equal to test1. So test3 is the last in the while loop and would be used also if another server with higher priority matches the requirements. --- proxy/src/main/java/net/md_5/bungee/UserConnection.java | 1 + 1 file changed, 1 insertion(+) diff --git a/proxy/src/main/java/net/md_5/bungee/UserConnection.java b/proxy/src/main/java/net/md_5/bungee/UserConnection.java index 6efd10a5..b9681e39 100644 --- a/proxy/src/main/java/net/md_5/bungee/UserConnection.java +++ b/proxy/src/main/java/net/md_5/bungee/UserConnection.java @@ -243,6 +243,7 @@ public final class UserConnection implements ProxiedPlayer if ( !Objects.equal( currentTarget, candidate ) ) { next = candidate; + break; } }