From 1bb826109c57c7cd804b27bd5ba134f9edbcddda Mon Sep 17 00:00:00 2001 From: md_5 Date: Thu, 23 Aug 2018 20:52:25 +1000 Subject: [PATCH 1/3] Minecraft 1.13.1 support --- protocol/src/main/java/net/md_5/bungee/protocol/Protocol.java | 3 +++ .../main/java/net/md_5/bungee/protocol/ProtocolConstants.java | 4 +++- proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap.java | 1 + 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/Protocol.java b/protocol/src/main/java/net/md_5/bungee/protocol/Protocol.java index 9509f8ee79..06390751fe 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/Protocol.java +++ b/protocol/src/main/java/net/md_5/bungee/protocol/Protocol.java @@ -376,6 +376,9 @@ public static class DirectionData linkedProtocols.put( ProtocolConstants.MINECRAFT_1_12_1, Arrays.asList( ProtocolConstants.MINECRAFT_1_12_2 ) ); + linkedProtocols.put( ProtocolConstants.MINECRAFT_1_13, Arrays.asList( + ProtocolConstants.MINECRAFT_1_13_1 + ) ); } @Getter diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/ProtocolConstants.java b/protocol/src/main/java/net/md_5/bungee/protocol/ProtocolConstants.java index b2dc942340..9a61fa4cf4 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/ProtocolConstants.java +++ b/protocol/src/main/java/net/md_5/bungee/protocol/ProtocolConstants.java @@ -18,6 +18,7 @@ public class ProtocolConstants public static final int MINECRAFT_1_12_1 = 338; public static final int MINECRAFT_1_12_2 = 340; public static final int MINECRAFT_1_13 = 393; + public static final int MINECRAFT_1_13_1 = 401; public static final List SUPPORTED_VERSIONS = Arrays.asList( "1.8.x", "1.9.x", @@ -37,7 +38,8 @@ public class ProtocolConstants ProtocolConstants.MINECRAFT_1_12, ProtocolConstants.MINECRAFT_1_12_1, ProtocolConstants.MINECRAFT_1_12_2, - ProtocolConstants.MINECRAFT_1_13 + ProtocolConstants.MINECRAFT_1_13, + ProtocolConstants.MINECRAFT_1_13_1 ); public enum Direction diff --git a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap.java b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap.java index c65a848190..d1eebbf0cf 100644 --- a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap.java +++ b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap.java @@ -48,6 +48,7 @@ public static EntityMap getEntityMap(int version) case ProtocolConstants.MINECRAFT_1_12_2: return EntityMap_1_12_1.INSTANCE; case ProtocolConstants.MINECRAFT_1_13: + case ProtocolConstants.MINECRAFT_1_13_1: return EntityMap_1_13.INSTANCE; } throw new RuntimeException( "Version " + version + " has no entity map" ); From 16b349057647d272d25767ab67546bdef5ad275b Mon Sep 17 00:00:00 2001 From: JoJoDeveloping Date: Tue, 28 Aug 2018 09:25:50 +0200 Subject: [PATCH 2/3] #2520: Fix ConcurrentModificationException when tasks are cancelled during shutdown --- .../java/net/md_5/bungee/scheduler/BungeeScheduler.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/proxy/src/main/java/net/md_5/bungee/scheduler/BungeeScheduler.java b/proxy/src/main/java/net/md_5/bungee/scheduler/BungeeScheduler.java index 1dc1cc66e6..fd0dabcf46 100644 --- a/proxy/src/main/java/net/md_5/bungee/scheduler/BungeeScheduler.java +++ b/proxy/src/main/java/net/md_5/bungee/scheduler/BungeeScheduler.java @@ -62,9 +62,12 @@ public void cancel(ScheduledTask task) public int cancel(Plugin plugin) { Set toRemove = new HashSet<>(); - for ( ScheduledTask task : tasksByPlugin.get( plugin ) ) + synchronized ( lock ) { - toRemove.add( task ); + for ( ScheduledTask task : tasksByPlugin.get( plugin ) ) + { + toRemove.add( task ); + } } for ( ScheduledTask task : toRemove ) { From ba0739798a0b6f184eca4def52750e8633623487 Mon Sep 17 00:00:00 2001 From: NayXegp Date: Mon, 30 Jul 2018 00:43:11 +0200 Subject: [PATCH 3/3] #2494: Add an option to disable pings in log --- .../main/java/net/md_5/bungee/conf/Configuration.java | 2 ++ .../java/net/md_5/bungee/connection/InitialHandler.java | 9 ++++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/proxy/src/main/java/net/md_5/bungee/conf/Configuration.java b/proxy/src/main/java/net/md_5/bungee/conf/Configuration.java index 1ee82eec2a..d7879d10f9 100644 --- a/proxy/src/main/java/net/md_5/bungee/conf/Configuration.java +++ b/proxy/src/main/java/net/md_5/bungee/conf/Configuration.java @@ -51,6 +51,7 @@ public class Configuration implements ProxyConfig * Whether we log proxy commands to the proxy log */ private boolean logCommands; + private boolean logPings = true; private int playerLimit = -1; private Collection disabledCommands; private int throttle = 4000; @@ -82,6 +83,7 @@ public void load() uuid = adapter.getString( "stats", uuid ); onlineMode = adapter.getBoolean( "online_mode", onlineMode ); logCommands = adapter.getBoolean( "log_commands", logCommands ); + logPings = adapter.getBoolean( "log_pings", logPings ); playerLimit = adapter.getInt( "player_limit", playerLimit ); throttle = adapter.getInt( "connection_throttle", throttle ); ipForward = adapter.getBoolean( "ip_forward", ipForward ); diff --git a/proxy/src/main/java/net/md_5/bungee/connection/InitialHandler.java b/proxy/src/main/java/net/md_5/bungee/connection/InitialHandler.java index e5d361e3c3..a6bd37200b 100644 --- a/proxy/src/main/java/net/md_5/bungee/connection/InitialHandler.java +++ b/proxy/src/main/java/net/md_5/bungee/connection/InitialHandler.java @@ -293,7 +293,10 @@ public void handle(Handshake handshake) throws Exception } this.virtualHost = InetSocketAddress.createUnresolved( handshake.getHost(), handshake.getPort() ); - bungee.getLogger().log( Level.INFO, "{0} has connected", this ); + if ( bungee.getConfig().isLogPings() ) + { + bungee.getLogger().log( Level.INFO, "{0} has connected", this ); + } bungee.getPluginManager().callEvent( new PlayerHandshakeEvent( InitialHandler.this, handshake ) ); @@ -306,6 +309,10 @@ public void handle(Handshake handshake) throws Exception break; case 2: // Login + if ( !bungee.getConfig().isLogPings() ) + { + bungee.getLogger().log( Level.INFO, "{0} has connected", this ); + } thisState = State.USERNAME; ch.setProtocol( Protocol.LOGIN );