Merge upstream

This commit is contained in:
Shane Freeder 2018-04-02 10:21:24 +01:00
parent 5882e0a157
commit 58127189ff
No known key found for this signature in database
GPG Key ID: A3F61EA5A085289C
16 changed files with 125 additions and 95 deletions

@ -1 +1 @@
Subproject commit 272258cf5a22602fda6b9030fa91524d90511c11
Subproject commit cbfdf64a15ddade2311db0db4296de4e5813398a

View File

@ -1,4 +1,4 @@
From ae3d646da41f223ab8f1b866b7e773ac73d527ff Mon Sep 17 00:00:00 2001
From ef839d48f68cbcbb545180ff88559c0d7a9f1b59 Mon Sep 17 00:00:00 2001
From: Techcable <Techcable@techcable.net>
Date: Tue, 3 May 2016 20:31:52 -0700
Subject: [PATCH] Don't access a ByteBuf's underlying array
@ -43,10 +43,10 @@ index 6dcdece5..e67773d9 100644
* Allow this packet to be sent as an "extended" packet.
*/
diff --git a/proxy/src/main/java/net/md_5/bungee/ServerConnector.java b/proxy/src/main/java/net/md_5/bungee/ServerConnector.java
index 6c31f15f..4a96a601 100644
index b2eef8e6..8194dbde 100644
--- a/proxy/src/main/java/net/md_5/bungee/ServerConnector.java
+++ b/proxy/src/main/java/net/md_5/bungee/ServerConnector.java
@@ -200,7 +200,7 @@ public class ServerConnector extends PacketHandler
@@ -201,7 +201,7 @@ public class ServerConnector extends PacketHandler
ByteBuf brand = ByteBufAllocator.DEFAULT.heapBuffer();
DefinedPacket.writeString( bungee.getName() + " (" + bungee.getVersion() + ")", brand );
@ -56,10 +56,10 @@ index 6c31f15f..4a96a601 100644
user.setDimension( login.getDimension() );
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 6b912ac7..95b547b3 100644
index 931f3f30..9ea61319 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
@@ -240,7 +240,7 @@ public class DownstreamBridge extends PacketHandler
@@ -241,7 +241,7 @@ public class DownstreamBridge extends PacketHandler
brand = ByteBufAllocator.DEFAULT.heapBuffer();
DefinedPacket.writeString( bungee.getName() + " (" + bungee.getVersion() + ")" + " <- " + serverBrand, brand );
@ -86,5 +86,5 @@ index 551ae1e1..be9685b9 100644
{
@Override
--
2.14.3
2.16.3

View File

@ -1,4 +1,4 @@
From a7d849a2666501db7513a79a0fba9d7d6b7bd278 Mon Sep 17 00:00:00 2001
From 7360d776711bb8c685651162e926f9113c63a979 Mon Sep 17 00:00:00 2001
From: Techcable <Techcable@outlook.com>
Date: Mon, 14 Mar 2016 15:40:44 -0700
Subject: [PATCH] Optimize uuid conversions
@ -258,10 +258,10 @@ index 27b51849..8bf17f9c 100644
}
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 e596f822..2f0cd28d 100644
index 1c65e002..59216860 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
@@ -600,7 +600,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection
@@ -601,7 +601,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection
@Override
public String getUUID()
{
@ -271,5 +271,5 @@ index e596f822..2f0cd28d 100644
@Override
--
2.14.3
2.16.3

View File

@ -1,4 +1,4 @@
From 1424553c4cbf124a575ada58158b2bbdd6342572 Mon Sep 17 00:00:00 2001
From 3a79961d7efefc19ce12e3f3e5a2f3be4d8eb1be Mon Sep 17 00:00:00 2001
From: Daniel Naylor <git@drnaylor.co.uk>
Date: Tue, 25 Oct 2016 12:23:07 -0400
Subject: [PATCH] Add support for FML with IP Forwarding enabled
@ -12,7 +12,7 @@ However, there is now at least one Forge coremod that intends to support IP forw
No breaking changes occur due to this patch.
diff --git a/proxy/src/main/java/net/md_5/bungee/ServerConnector.java b/proxy/src/main/java/net/md_5/bungee/ServerConnector.java
index 4a96a601..61c53b30 100644
index 8194dbde..6c367c73 100644
--- a/proxy/src/main/java/net/md_5/bungee/ServerConnector.java
+++ b/proxy/src/main/java/net/md_5/bungee/ServerConnector.java
@@ -3,6 +3,7 @@ package net.md_5.bungee;
@ -23,7 +23,7 @@ index 4a96a601..61c53b30 100644
import java.util.Queue;
import java.util.Set;
import java.util.UUID;
@@ -93,15 +94,39 @@ public class ServerConnector extends PacketHandler
@@ -94,15 +95,39 @@ public class ServerConnector extends PacketHandler
String newHost = copiedHandshake.getHost() + "\00" + user.getAddress().getHostString() + "\00" + user.getUUID();
LoginResult profile = user.getPendingConnection().getLoginProfile();
@ -67,7 +67,7 @@ index 4a96a601..61c53b30 100644
}
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 67adfef9..48f2aa8e 100644
index dfa4b71b..2daaf999 100644
--- a/proxy/src/main/java/net/md_5/bungee/UserConnection.java
+++ b/proxy/src/main/java/net/md_5/bungee/UserConnection.java
@@ -165,8 +165,12 @@ public final class UserConnection implements ProxiedPlayer
@ -100,5 +100,5 @@ index 6dca2048..f5253b89 100644
* The FML 1.8 handshake token.
*/
--
2.16.1
2.16.3

View File

@ -1,14 +1,14 @@
From b12d17dd55382be82a38a60b73be09ba18c3ce23 Mon Sep 17 00:00:00 2001
From 461ed3f4fb2478874649d3dab83e94632048d373 Mon Sep 17 00:00:00 2001
From: Tux <write@imaginarycode.com>
Date: Thu, 19 May 2016 17:36:31 -0600
Subject: [PATCH] Better unit tests for Chat API
diff --git a/chat/src/test/java/net/md_5/bungee/api/chat/ComponentsTest.java b/chat/src/test/java/net/md_5/bungee/api/chat/ComponentsTest.java
index 5bf1bf8e..16bc9730 100644
index 6eda2a72..22398005 100644
--- a/chat/src/test/java/net/md_5/bungee/api/chat/ComponentsTest.java
+++ b/chat/src/test/java/net/md_5/bungee/api/chat/ComponentsTest.java
@@ -200,6 +200,26 @@ public class ComponentsTest
@@ -202,6 +202,26 @@ public class ComponentsTest
Assert.assertEquals( eventRetention[1].getClickEvent(), testClickEvent );
}
@ -53,5 +53,5 @@ index 0837c672..38147e2a 100644
+ }
}
--
2.16.2
2.16.3

View File

@ -1,4 +1,4 @@
From c001ff289470f54a0c30524af6df8c6be00c62fc Mon Sep 17 00:00:00 2001
From a4545c85d6b55640f54d6a1ba6f511bb1cae477b Mon Sep 17 00:00:00 2001
From: Tux <write@imaginarycode.com>
Date: Thu, 19 May 2016 18:05:33 -0600
Subject: [PATCH] Micro-optimizations
@ -46,10 +46,10 @@ index 507db01f..fde98e27 100644
{
}
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 48f2aa8e..d9810c63 100644
index 2daaf999..bc1227a5 100644
--- a/proxy/src/main/java/net/md_5/bungee/UserConnection.java
+++ b/proxy/src/main/java/net/md_5/bungee/UserConnection.java
@@ -538,7 +538,7 @@ public final class UserConnection implements ProxiedPlayer
@@ -561,7 +561,7 @@ public final class UserConnection implements ProxiedPlayer
@Override
public Locale getLocale()
{
@ -59,10 +59,10 @@ index 48f2aa8e..d9810c63 100644
@Override
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 95b547b3..5829dda9 100644
index 9ea61319..565e6b0e 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
@@ -222,7 +222,6 @@ public class DownstreamBridge extends PacketHandler
@@ -223,7 +223,6 @@ public class DownstreamBridge extends PacketHandler
@Override
public void handle(PluginMessage pluginMessage) throws Exception
{
@ -70,7 +70,7 @@ index 95b547b3..5829dda9 100644
PluginMessageEvent event = new PluginMessageEvent( server, con, pluginMessage.getTag(), pluginMessage.getData().clone() );
if ( bungee.getPluginManager().callEvent( event ).isCancelled() )
@@ -249,6 +248,7 @@ public class DownstreamBridge extends PacketHandler
@@ -250,6 +249,7 @@ public class DownstreamBridge extends PacketHandler
if ( pluginMessage.getTag().equals( "BungeeCord" ) )
{
@ -79,5 +79,5 @@ index 95b547b3..5829dda9 100644
String subChannel = in.readUTF();
--
2.16.1
2.16.3

View File

@ -1,4 +1,4 @@
From 71374ababcec369da8b75d493e708767dbbef271 Mon Sep 17 00:00:00 2001
From bb9e8a7d07d20a1c3d9fa653d6852e475dbee85e Mon Sep 17 00:00:00 2001
From: Techcable <Techcable@techcable.net>
Date: Thu, 19 May 2016 17:09:22 -0600
Subject: [PATCH] Allow invalid packet ids for forge servers
@ -66,10 +66,10 @@ index cd065631..3f6b1766 100644
throw new BadPacketException( "Packet with id " + id + " outside of range " );
}
diff --git a/proxy/src/main/java/net/md_5/bungee/ServerConnector.java b/proxy/src/main/java/net/md_5/bungee/ServerConnector.java
index 61c53b30..b29ee7c5 100644
index 6c367c73..6df62b22 100644
--- a/proxy/src/main/java/net/md_5/bungee/ServerConnector.java
+++ b/proxy/src/main/java/net/md_5/bungee/ServerConnector.java
@@ -29,7 +29,9 @@ import net.md_5.bungee.forge.ForgeUtils;
@@ -30,7 +30,9 @@ import net.md_5.bungee.forge.ForgeUtils;
import net.md_5.bungee.netty.ChannelWrapper;
import net.md_5.bungee.netty.HandlerBoss;
import net.md_5.bungee.netty.PacketHandler;
@ -79,7 +79,7 @@ index 61c53b30..b29ee7c5 100644
import net.md_5.bungee.protocol.Protocol;
import net.md_5.bungee.protocol.packet.EncryptionRequest;
import net.md_5.bungee.protocol.packet.Handshake;
@@ -184,6 +186,12 @@ public class ServerConnector extends PacketHandler
@@ -185,6 +187,12 @@ public class ServerConnector extends PacketHandler
ServerConnection server = new ServerConnection( ch, target );
ServerConnectedEvent event = new ServerConnectedEvent( user, server );
@ -93,7 +93,7 @@ index 61c53b30..b29ee7c5 100644
ch.write( BungeeCord.getInstance().registerChannels() );
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 d9810c63..5468144a 100644
index bc1227a5..61502ea8 100644
--- a/proxy/src/main/java/net/md_5/bungee/UserConnection.java
+++ b/proxy/src/main/java/net/md_5/bungee/UserConnection.java
@@ -71,6 +71,7 @@ public final class UserConnection implements ProxiedPlayer
@ -122,5 +122,5 @@ index 847a3eca..27ee21f2 100644
{
rewriteInt( packet, oldId, newId, readerIndex + packetIdLength );
--
2.16.1
2.16.3

View File

@ -1,4 +1,4 @@
From 9ef8e269ec4e0905e4a47ca654c92f05fd2f95cf Mon Sep 17 00:00:00 2001
From 1a25d40377f6737665656f8327b5e2571b5a7f3f Mon Sep 17 00:00:00 2001
From: Janmm14 <computerjanimaus@yahoo.de>
Date: Sat, 12 Dec 2015 23:43:30 +0100
Subject: [PATCH] Optional server list ping logging.
@ -61,10 +61,10 @@ index e56d3591..68f25460 100644
+ }
}
diff --git a/proxy/src/main/java/net/md_5/bungee/ServerConnector.java b/proxy/src/main/java/net/md_5/bungee/ServerConnector.java
index b29ee7c5..79e88cc5 100644
index 6df62b22..972c70ec 100644
--- a/proxy/src/main/java/net/md_5/bungee/ServerConnector.java
+++ b/proxy/src/main/java/net/md_5/bungee/ServerConnector.java
@@ -389,6 +389,6 @@ public class ServerConnector extends PacketHandler
@@ -390,6 +390,6 @@ public class ServerConnector extends PacketHandler
@Override
public String toString()
{
@ -73,10 +73,10 @@ index b29ee7c5..79e88cc5 100644
}
}
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 5829dda9..02284f16 100644
index 565e6b0e..085a4e60 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
@@ -510,6 +510,6 @@ public class DownstreamBridge extends PacketHandler
@@ -511,6 +511,6 @@ public class DownstreamBridge extends PacketHandler
@Override
public String toString()
{
@ -85,10 +85,10 @@ index 5829dda9..02284f16 100644
}
}
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 1824b97f..5f0801f4 100644
index 59216860..1c764f52 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
@@ -281,19 +281,22 @@ public class InitialHandler extends PacketHandler implements PendingConnection
@@ -282,19 +282,22 @@ public class InitialHandler extends PacketHandler implements PendingConnection
}
this.virtualHost = InetSocketAddress.createUnresolved( handshake.getHost(), handshake.getPort() );
@ -112,7 +112,7 @@ index 1824b97f..5f0801f4 100644
thisState = State.USERNAME;
ch.setProtocol( Protocol.LOGIN );
@@ -606,7 +609,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection
@@ -607,7 +610,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection
@Override
public String toString()
{
@ -134,5 +134,5 @@ index ccdeaed1..742ff503 100644
}
}
--
2.16.1
2.16.3

View File

@ -1,4 +1,4 @@
From 7d3827b6b64dacf956782ac40a0897f065f05f8c Mon Sep 17 00:00:00 2001
From ec155caf85fc6f5ef2f152733055ee2215b2e666 Mon Sep 17 00:00:00 2001
From: Techcable <Techcable@outlook.com>
Date: Sun, 7 Feb 2016 00:01:19 -0700
Subject: [PATCH] Add a property to accept invalid ping packets
@ -9,10 +9,10 @@ You can enable it by setting '-Dwaterfall.acceptInvalidPackets=true' at the comm
Fixes #23
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 7ab4d042..bf450f98 100644
index 1c764f52..ba3d5204 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
@@ -247,10 +247,14 @@ public class InitialHandler extends PacketHandler implements PendingConnection
@@ -248,10 +248,14 @@ public class InitialHandler extends PacketHandler implements PendingConnection
thisState = State.PING;
}
@ -29,5 +29,5 @@ index 7ab4d042..bf450f98 100644
disconnect( "" );
}
--
2.14.1
2.16.3

View File

@ -1,4 +1,4 @@
From 0a3a3e40c649e188cf4aa5ff1d1fbcc028df9ab5 Mon Sep 17 00:00:00 2001
From a575b61861d16924305e4f832be476a936f0c186 Mon Sep 17 00:00:00 2001
From: Troy Frew <fuzzy_bot@arenaga.me>
Date: Wed, 29 Jun 2016 04:29:25 +0200
Subject: [PATCH] Add dynamic server addition/removal api.
@ -144,10 +144,10 @@ index 262b29c8..d7ed3e11 100644
{
int index = path.indexOf( SEPARATOR );
diff --git a/module/cmd-server/src/main/java/net/md_5/bungee/module/cmd/server/CommandServer.java b/module/cmd-server/src/main/java/net/md_5/bungee/module/cmd/server/CommandServer.java
index b3ff750f..43d11cf2 100644
index 416c54e3..920b9b36 100644
--- a/module/cmd-server/src/main/java/net/md_5/bungee/module/cmd/server/CommandServer.java
+++ b/module/cmd-server/src/main/java/net/md_5/bungee/module/cmd/server/CommandServer.java
@@ -83,7 +83,7 @@ public class CommandServer extends Command implements TabExecutor
@@ -84,7 +84,7 @@ public class CommandServer extends Command implements TabExecutor
@Override
public Iterable<String> onTabComplete(final CommandSender sender, final String[] args)
{
@ -298,5 +298,5 @@ index d131c02c..a755121a 100644
+ // Waterfall end
}
--
2.16.1
2.16.3

View File

@ -1,14 +1,14 @@
From f6c48a227b9dc70d97ee9c22f54d0481913535fb Mon Sep 17 00:00:00 2001
From 02f89ab7ae7b288cc0fbd2494b7a7bfb90330ce6 Mon Sep 17 00:00:00 2001
From: Techcable <Techcable@techcable.net>
Date: Mon, 6 Jun 2016 13:36:10 -0600
Subject: [PATCH] Don't send KICK packets while in HANDSHAKE state
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 bf450f98..9e501c00 100644
index ba3d5204..14929879 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
@@ -266,7 +266,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection
@@ -267,7 +267,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection
this.handshake = handshake;
ch.setVersion( handshake.getProtocolVersion() );
@ -17,7 +17,7 @@ index bf450f98..9e501c00 100644
// with Bungee's IP forwarding, so we detect it, and remove it from the host string, for now.
// We know FML appends \00FML\00. However, we need to also consider that other systems might
// add their own data to the end of the string. So, we just take everything from the \0 character
@@ -547,7 +547,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection
@@ -548,7 +548,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection
@Override
public void disconnect(final BaseComponent... reason)
{
@ -27,5 +27,5 @@ index bf450f98..9e501c00 100644
ch.delayedClose( new Kick( ComponentSerializer.toString( reason ) ) );
} else
--
2.14.1
2.16.3

View File

@ -1,4 +1,4 @@
From 4f2868a5e5839988b6a17d3204966c9863fb703e Mon Sep 17 00:00:00 2001
From dd1d2c326ff05dd227612b43a7dc72f7cafd47bd Mon Sep 17 00:00:00 2001
From: Nathan Poirier <nathan@poirier.io>
Date: Tue, 28 Jun 2016 23:00:49 -0500
Subject: [PATCH] Improve ServerKickEvent
@ -62,10 +62,10 @@ index 0e1ef5c4..ee63732d 100644
@Deprecated
public String getKickReason()
diff --git a/proxy/src/main/java/net/md_5/bungee/ServerConnector.java b/proxy/src/main/java/net/md_5/bungee/ServerConnector.java
index 79e88cc5..38361c2b 100644
index 972c70ec..1213c206 100644
--- a/proxy/src/main/java/net/md_5/bungee/ServerConnector.java
+++ b/proxy/src/main/java/net/md_5/bungee/ServerConnector.java
@@ -314,7 +314,7 @@ public class ServerConnector extends PacketHandler
@@ -315,7 +315,7 @@ public class ServerConnector extends PacketHandler
public void handle(Kick kick) throws Exception
{
ServerInfo def = user.updateAndGetNextServer( target );
@ -75,7 +75,7 @@ index 79e88cc5..38361c2b 100644
{
// Pre cancel the event if we are going to try another server
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 dcd6924d..de905b83 100644
index 085a4e60..c6da6c47 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
@@ -4,6 +4,7 @@ import com.google.common.base.Preconditions;
@ -86,7 +86,7 @@ index dcd6924d..de905b83 100644
import io.netty.buffer.ByteBuf;
import io.netty.buffer.ByteBufAllocator;
import io.netty.buffer.Unpooled;
@@ -59,16 +60,19 @@ public class DownstreamBridge extends PacketHandler
@@ -60,16 +61,19 @@ public class DownstreamBridge extends PacketHandler
return;
}
@ -97,10 +97,10 @@ index dcd6924d..de905b83 100644
+ if ( event.isCancelled() && event.getCancelServer() != null )
{
server.setObsolete( true );
- con.connectNow( def );
- con.connectNow( def, ServerConnectEvent.Reason.SERVER_DOWN_REDIRECT );
- con.sendMessage( bungee.getTranslation( "server_went_down" ) );
- } else
+ con.connectNow( event.getCancelServer() );
+ con.connectNow( event.getCancelServer(), ServerConnectEvent.Reason.SERVER_DOWN_REDIRECT );
+ }
+ else
{
@ -111,7 +111,7 @@ index dcd6924d..de905b83 100644
}
@Override
@@ -83,7 +87,19 @@ public class DownstreamBridge extends PacketHandler
@@ -84,7 +88,19 @@ public class DownstreamBridge extends PacketHandler
if ( !server.isObsolete() )
{
@ -132,7 +132,7 @@ index dcd6924d..de905b83 100644
}
ServerDisconnectEvent serverDisconnectEvent = new ServerDisconnectEvent( con, server.getInfo() );
@@ -454,7 +470,11 @@ public class DownstreamBridge extends PacketHandler
@@ -455,7 +471,11 @@ public class DownstreamBridge extends PacketHandler
public void handle(Kick kick) throws Exception
{
ServerInfo def = con.updateAndGetNextServer( server.getInfo() );
@ -144,7 +144,7 @@ index dcd6924d..de905b83 100644
+ ServerKickEvent event = bungee.getPluginManager().callEvent( new ServerKickEvent( con, server.getInfo(), ComponentSerializer.parse( kick.getMessage() ), def, ServerKickEvent.State.CONNECTED, ServerKickEvent.Cause.SERVER ) ); // Waterfall
if ( event.isCancelled() && event.getCancelServer() != null )
{
con.connectNow( event.getCancelServer() );
con.connectNow( event.getCancelServer(), ServerConnectEvent.Reason.KICK_REDIRECT );
--
2.14.1
2.16.3

View File

@ -1,4 +1,4 @@
From f82be462da498b66febd16be3ffee08ac55fee95 Mon Sep 17 00:00:00 2001
From aa1ec62226004b9135a87762e7530133eaa5e9ee Mon Sep 17 00:00:00 2001
From: Ichbinjoe <joe@ibj.io>
Date: Sat, 16 Jul 2016 20:44:01 -0400
Subject: [PATCH] Add timeout variant to connect methods
@ -6,10 +6,10 @@ Subject: [PATCH] Add timeout variant to connect methods
Also added more connect methods to ProxiedPlayer, in addition to the new method
diff --git a/api/src/main/java/net/md_5/bungee/api/connection/ProxiedPlayer.java b/api/src/main/java/net/md_5/bungee/api/connection/ProxiedPlayer.java
index 2bb92a93..23658cf9 100644
index a7334c87..4638617d 100644
--- a/api/src/main/java/net/md_5/bungee/api/connection/ProxiedPlayer.java
+++ b/api/src/main/java/net/md_5/bungee/api/connection/ProxiedPlayer.java
@@ -99,6 +99,38 @@ public interface ProxiedPlayer extends Connection, CommandSender
@@ -110,6 +110,38 @@ public interface ProxiedPlayer extends Connection, CommandSender
*/
void connect(ServerInfo target, Callback<Boolean> callback);
@ -44,37 +44,67 @@ index 2bb92a93..23658cf9 100644
+ */
+ void connect(ServerInfo target, Callback<Boolean> callback, boolean retry, int timeout);
+ // Waterfall end
+
/**
* Connects / transfers this user to the specified connection, gracefully
* closing the current one. Depending on the implementation, this method
@@ -123,6 +155,25 @@ public interface ProxiedPlayer extends Connection, CommandSender
*/
void connect(ServerInfo target, Callback<Boolean> callback, ServerConnectEvent.Reason reason);
+ // Waterfall start
+ /**
+ * Connects / transfers this user to the specified connection, gracefully
+ * closing the current one. Depending on the implementation, this method
+ * might return before the user has been connected.
+ *
+ * @param target the new server to connect to
+ * @param callback the method called when the connection is complete, or
+ * when an exception is encountered. The boolean parameter denotes success
+ * or failure.
+ * @param retry whether to retry the connection if the initial connection
+ * fails.
+ * @param reason the reason for connecting to the new server
+ * @param timeout timeout in milliseconds of the connection created to the
+ * target server
+ */
+ void connect(ServerInfo target, Callback<Boolean> callback, boolean retry, ServerConnectEvent.Reason reason, int timeout);
+ // Waterfall end
+
/**
* Gets the server this player is connected to.
*
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 5468144a..eee311df 100644
index 61502ea8..8344a9b6 100644
--- a/proxy/src/main/java/net/md_5/bungee/UserConnection.java
+++ b/proxy/src/main/java/net/md_5/bungee/UserConnection.java
@@ -233,6 +233,12 @@ public final class UserConnection implements ProxiedPlayer
@@ -256,6 +256,16 @@ public final class UserConnection implements ProxiedPlayer
public void connect(ServerInfo info, final Callback<Boolean> callback, final boolean retry)
public void connect(ServerInfo info, final Callback<Boolean> callback, final boolean retry, ServerConnectEvent.Reason reason)
{
+ // Waterfall start
+ connect(info, callback, retry, 5000); // todo: configurable
+ connect(info, callback, retry, reason, 5000); // todo: configurable
+ }
+ public void connect(ServerInfo info, final Callback<Boolean> callback, final boolean retry, final int timeout)
+ public void connect(ServerInfo info, final Callback<Boolean> callback, final boolean retry, int timeout) {
+ connect(info, callback, retry, ServerConnectEvent.Reason.PLUGIN, timeout);
+ }
+
+ public void connect(ServerInfo info, final Callback<Boolean> callback, final boolean retry, ServerConnectEvent.Reason reason, final int timeout)
+ {
+ // Waterfall end
Preconditions.checkNotNull( info, "info" );
ServerConnectEvent event = new ServerConnectEvent( this, info );
@@ -306,7 +312,7 @@ public final class UserConnection implements ProxiedPlayer
ServerConnectEvent event = new ServerConnectEvent( this, info, reason );
@@ -329,7 +339,7 @@ public final class UserConnection implements ProxiedPlayer
if ( retry && def != null && ( getServer() == null || def != getServer().getInfo() ) )
{
sendMessage( bungee.getTranslation( "fallback_lobby" ) );
- connect( def, null, true );
+ connect( def, null, true, timeout ); // Waterfall
- connect( def, null, true, ServerConnectEvent.Reason.LOBBY_FALLBACK );
+ connect( def, null, true, ServerConnectEvent.Reason.LOBBY_FALLBACK, timeout ); // Waterfall
} else if ( dimensionChange )
{
disconnect( bungee.getTranslation( "fallback_kick", future.cause().getClass().getName() ) );
@@ -321,7 +327,7 @@ public final class UserConnection implements ProxiedPlayer
@@ -344,7 +354,7 @@ public final class UserConnection implements ProxiedPlayer
.channel( PipelineUtils.getChannel() )
.group( ch.getHandle().eventLoop() )
.handler( initializer )
@ -84,5 +114,5 @@ index 5468144a..eee311df 100644
// Windows is bugged, multi homed users will just have to live with random connecting IPs
if ( getPendingConnection().getListener().isSetLocalAddress() && !PlatformDependent.isWindows() )
--
2.16.1
2.16.3

View File

@ -1,4 +1,4 @@
From bc0316ea4c7f910c13c24922686f5631555ad4bb Mon Sep 17 00:00:00 2001
From da1be2161a2c3c701996135871c9a53080c4c66b Mon Sep 17 00:00:00 2001
From: Aaron Hill <aa1ronham@gmail.com>
Date: Thu, 15 Sep 2016 22:38:37 +0200
Subject: [PATCH] Fix potion race condition on Forge 1.8.9
@ -163,7 +163,7 @@ index 00000000..7ed2dc3a
+ }
+}
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 eee311df..520b42c8 100644
index 8344a9b6..ef12a019 100644
--- a/proxy/src/main/java/net/md_5/bungee/UserConnection.java
+++ b/proxy/src/main/java/net/md_5/bungee/UserConnection.java
@@ -2,7 +2,9 @@ package net.md_5.bungee;
@ -188,10 +188,10 @@ index eee311df..520b42c8 100644
@Getter
private String displayName;
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 9b21b05d..201b6c3e 100644
index c6da6c47..1edb9439 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
@@ -31,6 +31,8 @@ import net.md_5.bungee.netty.PacketHandler;
@@ -32,6 +32,8 @@ import net.md_5.bungee.netty.PacketHandler;
import net.md_5.bungee.protocol.DefinedPacket;
import net.md_5.bungee.protocol.PacketWrapper;
import net.md_5.bungee.protocol.packet.BossBar;
@ -200,7 +200,7 @@ index 9b21b05d..201b6c3e 100644
import net.md_5.bungee.protocol.packet.KeepAlive;
import net.md_5.bungee.protocol.packet.PlayerListItem;
import net.md_5.bungee.protocol.packet.Respawn;
@@ -521,6 +523,32 @@ public class DownstreamBridge extends PacketHandler
@@ -522,6 +524,32 @@ public class DownstreamBridge extends PacketHandler
}
}
@ -271,5 +271,5 @@ index 673497e5..17e250d4 100644
* Sends the server mod list to the client, or stores it for sending later.
*
--
2.16.1
2.16.3

View File

@ -1,4 +1,4 @@
From 97f93928568ff18ab147bec87e21b7f606563881 Mon Sep 17 00:00:00 2001
From 97a884f769d667547d3398d81aac496740aa8fe4 Mon Sep 17 00:00:00 2001
From: phenomax <phenomax@revayd.net>
Date: Thu, 10 Aug 2017 18:41:17 +0200
Subject: [PATCH] Providing access to the player's LoginResult on LoginEvent
@ -52,10 +52,10 @@ similarity index 100%
rename from proxy/src/main/java/net/md_5/bungee/connection/LoginResult.java
rename to api/src/main/java/net/md_5/bungee/connection/LoginResult.java
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 9e501c00..c7a4bd2a 100644
index 14929879..88b9a18c 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
@@ -535,7 +535,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection
@@ -536,7 +536,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection
};
// fire login event
@ -65,5 +65,5 @@ index 9e501c00..c7a4bd2a 100644
@Override
--
2.14.3
2.16.3

View File

@ -1,4 +1,4 @@
From 376a7248540252d37977f324e15bd394dc67825b Mon Sep 17 00:00:00 2001
From 24a81a16c1096e60dcadbf0ddd89d24793608294 Mon Sep 17 00:00:00 2001
From: Gabriele C <sgdc3.mail@gmail.com>
Date: Thu, 8 Feb 2018 19:10:52 +0100
Subject: [PATCH] Optionally log InitialHandler connections
@ -57,10 +57,10 @@ index 7dc3c2d9..5ba15771 100644
+ }
}
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 c7a4bd2a..10f6001b 100644
index 88b9a18c..1accd61d 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
@@ -300,7 +300,9 @@ public class InitialHandler extends PacketHandler implements PendingConnection
@@ -301,7 +301,9 @@ public class InitialHandler extends PacketHandler implements PendingConnection
break;
case 2:
// Login
@ -72,5 +72,5 @@ index c7a4bd2a..10f6001b 100644
ch.setProtocol( Protocol.LOGIN );
--
2.16.1
2.16.3