From 908b7f7374d0e7fd2a2650c22677b336f4172757 Mon Sep 17 00:00:00 2001 From: Mystiflow Date: Sun, 6 Nov 2016 00:25:46 +0000 Subject: [PATCH] Use server priority for downstream kicks too (#1978) --- .../net/md_5/bungee/connection/DownstreamBridge.java | 10 +++------- proxy/src/main/resources/messages.properties | 6 +++--- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/proxy/src/main/java/net/md_5/bungee/connection/DownstreamBridge.java b/proxy/src/main/java/net/md_5/bungee/connection/DownstreamBridge.java index 22f10452e..c2dd942ff 100644 --- a/proxy/src/main/java/net/md_5/bungee/connection/DownstreamBridge.java +++ b/proxy/src/main/java/net/md_5/bungee/connection/DownstreamBridge.java @@ -60,8 +60,8 @@ public class DownstreamBridge extends PacketHandler return; } - ServerInfo def = bungee.getServerInfo( con.getPendingConnection().getListener().getFallbackServer() ); - if ( server.getInfo() != def ) + ServerInfo def = con.updateAndGetNextServer( server.getInfo() ); + if ( def != null ) { server.setObsolete( true ); con.connectNow( def ); @@ -453,11 +453,7 @@ public class DownstreamBridge extends PacketHandler @Override public void handle(Kick kick) throws Exception { - ServerInfo def = bungee.getServerInfo( con.getPendingConnection().getListener().getFallbackServer() ); - if ( Objects.equal( server.getInfo(), def ) ) - { - def = null; - } + ServerInfo def = con.updateAndGetNextServer( server.getInfo() ); ServerKickEvent event = bungee.getPluginManager().callEvent( new ServerKickEvent( con, server.getInfo(), ComponentSerializer.parse( kick.getMessage() ), def, ServerKickEvent.State.CONNECTED ) ); if ( event.isCancelled() && event.getCancelServer() != null ) { diff --git a/proxy/src/main/resources/messages.properties b/proxy/src/main/resources/messages.properties index 8acc26f98..e8a7f0b42 100644 --- a/proxy/src/main/resources/messages.properties +++ b/proxy/src/main/resources/messages.properties @@ -6,8 +6,8 @@ command_list=\u00a7a[{0}] \u00a7e({1}): \u00a7r{2} connect_kick=\u00a7cKicked whilst connecting to {0}: {1} connect_kick_outdated_forge=\u00a7cYour version of Forge is outdated. Please update Forge and try again. current_server=\u00a76You are currently connected to {0}. -fallback_kick=\u00a7cCould not connect to default or fallback server, please try again later: {0} -fallback_lobby=\u00a7cCould not connect to target server, you have been moved to the fallback server. +fallback_kick=\u00a7cCould not connect to a default or fallback server, please try again later: {0} +fallback_lobby=\u00a7cCould not connect to target server, you have been moved to a fallback server. lost_connection=[Proxy] Lost connection to server. mojang_fail=Error occurred while contacting login servers, are they down? no_permission=\u00a7cYou do not have permission to execute this command! @@ -19,7 +19,7 @@ proxy_full=Server is full! restart=[Proxy] Proxy restarting. server_kick=[Kicked] server_list=\u00a76You may connect to the following servers at this time: -server_went_down=\u00a7cThe server you were previously on went down, you have been connected to the lobby +server_went_down=\u00a7cThe server you were previously on went down, you have been connected to a fallback server total_players=Total players online: {0} name_too_long=Cannot have username longer than 16 characters name_invalid=Username contains invalid characters.