Remove redundant patch. Fixes #98

Upstream resolved the issue 3a0b0aa116
This commit is contained in:
Jamie Mansfield 2016-11-01 15:51:42 +00:00
parent 59f69a69c5
commit 51993973fc
No known key found for this signature in database
GPG Key ID: 27F6918C0D47DF94
16 changed files with 68 additions and 347 deletions

View File

@ -1,4 +1,4 @@
From b391d662f4c5d3c01675904514ef809f01090194 Mon Sep 17 00:00:00 2001
From 176eede573861401925dba13a9e76f3fb87a1e85 Mon Sep 17 00:00:00 2001
From: Techcable <Techcable@techcable.net>
Date: Thu, 19 May 2016 10:55:20 -0700
Subject: [PATCH] Configurable Waterfall Metrics
@ -17,143 +17,46 @@ index b30541b..293ec4e 100644
+ */
+ boolean isMetrics();
}
diff --git a/proxy/src/main/java/io/github/waterfallmc/waterfall/Metrics.java b/proxy/src/main/java/io/github/waterfallmc/waterfall/Metrics.java
new file mode 100644
index 0000000..ae5a2a9
--- /dev/null
diff --git a/proxy/src/main/java/net/md_5/bungee/Metrics.java b/proxy/src/main/java/io/github/waterfallmc/waterfall/Metrics.java
similarity index 96%
rename from proxy/src/main/java/net/md_5/bungee/Metrics.java
rename to proxy/src/main/java/io/github/waterfallmc/waterfall/Metrics.java
index 9523987..ae5a2a9 100644
--- a/proxy/src/main/java/net/md_5/bungee/Metrics.java
+++ b/proxy/src/main/java/io/github/waterfallmc/waterfall/Metrics.java
@@ -0,0 +1,131 @@
@@ -1,4 +1,4 @@
-package net.md_5.bungee;
+package io.github.waterfallmc.waterfall;
+
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStreamReader;
+import java.io.OutputStreamWriter;
+import java.io.UnsupportedEncodingException;
+import java.net.URL;
+import java.net.URLConnection;
+import java.net.URLEncoder;
+import java.util.TimerTask;
import java.io.BufferedReader;
import java.io.IOException;
@@ -9,6 +9,8 @@ import java.net.URL;
import java.net.URLConnection;
import java.net.URLEncoder;
import java.util.TimerTask;
+
+import net.md_5.bungee.BungeeCord;
+import net.md_5.bungee.api.ProxyServer;
+
+public class Metrics extends TimerTask
+{
+
+ /**
+ * The current revision number
+ */
+ private final static int REVISION = 5;
+ /**
+ * The base url of the metrics domain
+ */
+ private static final String BASE_URL = "http://mcstats.org";
+ /**
+ * The url used to report a server's status
+ */
+ private static final String REPORT_URL = "/report/%s";
+ /**
+ * Interval of time to ping (in minutes)
+ */
import net.md_5.bungee.api.ProxyServer;
public class Metrics extends TimerTask
@@ -29,7 +31,7 @@ public class Metrics extends TimerTask
/**
* Interval of time to ping (in minutes)
*/
- final static int PING_INTERVAL = 10;
+ public final static int PING_INTERVAL = 10;
+ boolean firstPost = true;
+
+ @Override
+ public void run()
+ {
+ try
+ {
+ // We use the inverse of firstPost because if it is the first time we are posting,
+ // it is not a interval ping, so it evaluates to FALSE
+ // Each time thereafter it will evaluate to TRUE, i.e PING!
+ postPlugin( !firstPost );
+
+ // After the first post we set firstPost to false
+ // Each post thereafter will be a ping
+ firstPost = false;
+ } catch ( IOException ex )
+ {
+ // ProxyServer.getInstance().getLogger().info( "[Metrics] " + ex.getMessage() );
+ }
+ }
+
+ /**
+ * Generic method that posts a plugin to the metrics website
+ */
+ private void postPlugin(boolean isPing) throws IOException
+ {
+ // Construct the post data
+ final StringBuilder data = new StringBuilder();
+ data.append( encode( "guid" ) ).append( '=' ).append( encode( BungeeCord.getInstance().config.getUuid() ) );
+ encodeDataPair( data, "version", ProxyServer.getInstance().getVersion() );
+ encodeDataPair( data, "server", "0" );
+ encodeDataPair( data, "players", Integer.toString( ProxyServer.getInstance().getOnlineCount() ) );
+ encodeDataPair( data, "revision", String.valueOf( REVISION ) );
+
+ // If we're pinging, append it
+ if ( isPing )
+ {
+ encodeDataPair( data, "ping", "true" );
+ }
+
+ // Create the url
boolean firstPost = true;
@Override
@@ -71,7 +73,7 @@ public class Metrics extends TimerTask
}
// Create the url
- URL url = new URL( BASE_URL + String.format( REPORT_URL, encode( "BungeeCord" ) ) );
+ URL url = new URL( BASE_URL + String.format( REPORT_URL, encode( "Waterfall" ) ) );
+
+ // Connect to the website
+ URLConnection connection;
+
+ connection = url.openConnection();
+
+ connection.setDoOutput( true );
+ final BufferedReader reader;
+ final String response;
+ try ( OutputStreamWriter writer = new OutputStreamWriter( connection.getOutputStream() ) )
+ {
+ writer.write( data.toString() );
+ writer.flush();
+ reader = new BufferedReader( new InputStreamReader( connection.getInputStream() ) );
+ response = reader.readLine();
+ }
+ reader.close();
+
+ if ( response == null || response.startsWith( "ERR" ) )
+ {
+ throw new IOException( response ); //Throw the exception
+ }
+ }
+
+ /**
+ * <p>
+ * Encode a key/value data pair to be used in a HTTP post request. This
+ * INCLUDES a & so the first key/value pair MUST be included manually,
+ * e.g:</p>
+ * <code>
+ * StringBuffer data = new StringBuffer();
+ * data.append(encode("guid")).append('=').append(encode(guid));
+ * encodeDataPair(data, "version", description.getVersion());
+ * </code>
+ *
+ * @param buffer the StringBuilder to append the data pair onto
+ * @param key the key value
+ * @param value the value
+ */
+ private static void encodeDataPair(final StringBuilder buffer, final String key, final String value) throws UnsupportedEncodingException
+ {
+ buffer.append( '&' ).append( encode( key ) ).append( '=' ).append( encode( value ) );
+ }
+
+ /**
+ * Encode text as UTF-8
+ *
+ * @param text the text to encode
+ * @return the encoded text, as UTF-8
+ */
+ private static String encode(final String text) throws UnsupportedEncodingException
+ {
+ return URLEncoder.encode( text, "UTF-8" );
+ }
+}
// Connect to the website
URLConnection connection;
diff --git a/proxy/src/main/java/io/github/waterfallmc/waterfall/conf/WaterfallConfiguration.java b/proxy/src/main/java/io/github/waterfallmc/waterfall/conf/WaterfallConfiguration.java
index 12c5859..692b83e 100644
--- a/proxy/src/main/java/io/github/waterfallmc/waterfall/conf/WaterfallConfiguration.java
@ -206,141 +109,6 @@ index 7bb0862..304a794 100644
}
public void startListeners()
diff --git a/proxy/src/main/java/net/md_5/bungee/Metrics.java b/proxy/src/main/java/net/md_5/bungee/Metrics.java
deleted file mode 100644
index 9523987..0000000
--- a/proxy/src/main/java/net/md_5/bungee/Metrics.java
+++ /dev/null
@@ -1,129 +0,0 @@
-package net.md_5.bungee;
-
-import java.io.BufferedReader;
-import java.io.IOException;
-import java.io.InputStreamReader;
-import java.io.OutputStreamWriter;
-import java.io.UnsupportedEncodingException;
-import java.net.URL;
-import java.net.URLConnection;
-import java.net.URLEncoder;
-import java.util.TimerTask;
-import net.md_5.bungee.api.ProxyServer;
-
-public class Metrics extends TimerTask
-{
-
- /**
- * The current revision number
- */
- private final static int REVISION = 5;
- /**
- * The base url of the metrics domain
- */
- private static final String BASE_URL = "http://mcstats.org";
- /**
- * The url used to report a server's status
- */
- private static final String REPORT_URL = "/report/%s";
- /**
- * Interval of time to ping (in minutes)
- */
- final static int PING_INTERVAL = 10;
- boolean firstPost = true;
-
- @Override
- public void run()
- {
- try
- {
- // We use the inverse of firstPost because if it is the first time we are posting,
- // it is not a interval ping, so it evaluates to FALSE
- // Each time thereafter it will evaluate to TRUE, i.e PING!
- postPlugin( !firstPost );
-
- // After the first post we set firstPost to false
- // Each post thereafter will be a ping
- firstPost = false;
- } catch ( IOException ex )
- {
- // ProxyServer.getInstance().getLogger().info( "[Metrics] " + ex.getMessage() );
- }
- }
-
- /**
- * Generic method that posts a plugin to the metrics website
- */
- private void postPlugin(boolean isPing) throws IOException
- {
- // Construct the post data
- final StringBuilder data = new StringBuilder();
- data.append( encode( "guid" ) ).append( '=' ).append( encode( BungeeCord.getInstance().config.getUuid() ) );
- encodeDataPair( data, "version", ProxyServer.getInstance().getVersion() );
- encodeDataPair( data, "server", "0" );
- encodeDataPair( data, "players", Integer.toString( ProxyServer.getInstance().getOnlineCount() ) );
- encodeDataPair( data, "revision", String.valueOf( REVISION ) );
-
- // If we're pinging, append it
- if ( isPing )
- {
- encodeDataPair( data, "ping", "true" );
- }
-
- // Create the url
- URL url = new URL( BASE_URL + String.format( REPORT_URL, encode( "BungeeCord" ) ) );
-
- // Connect to the website
- URLConnection connection;
-
- connection = url.openConnection();
-
- connection.setDoOutput( true );
- final BufferedReader reader;
- final String response;
- try ( OutputStreamWriter writer = new OutputStreamWriter( connection.getOutputStream() ) )
- {
- writer.write( data.toString() );
- writer.flush();
- reader = new BufferedReader( new InputStreamReader( connection.getInputStream() ) );
- response = reader.readLine();
- }
- reader.close();
-
- if ( response == null || response.startsWith( "ERR" ) )
- {
- throw new IOException( response ); //Throw the exception
- }
- }
-
- /**
- * <p>
- * Encode a key/value data pair to be used in a HTTP post request. This
- * INCLUDES a & so the first key/value pair MUST be included manually,
- * e.g:</p>
- * <code>
- * StringBuffer data = new StringBuffer();
- * data.append(encode("guid")).append('=').append(encode(guid));
- * encodeDataPair(data, "version", description.getVersion());
- * </code>
- *
- * @param buffer the StringBuilder to append the data pair onto
- * @param key the key value
- * @param value the value
- */
- private static void encodeDataPair(final StringBuilder buffer, final String key, final String value) throws UnsupportedEncodingException
- {
- buffer.append( '&' ).append( encode( key ) ).append( '=' ).append( encode( value ) );
- }
-
- /**
- * Encode text as UTF-8
- *
- * @param text the text to encode
- * @return the encoded text, as UTF-8
- */
- private static String encode(final String text) throws UnsupportedEncodingException
- {
- return URLEncoder.encode( text, "UTF-8" );
- }
-}
--
2.7.4 (Apple Git-66)
2.10.0

View File

@ -1,47 +0,0 @@
From 79cbc4bd219b90f7a8691004cd42760f7a9d0234 Mon Sep 17 00:00:00 2001
From: Jonas Konrad <me@yawk.at>
Date: Tue, 23 Jun 2015 21:56:13 +0200
Subject: [PATCH] Ignore incoming chat messages before connecting to the
backend
Merges SpigotMC/BungeeCord#1515
diff --git a/proxy/src/main/java/net/md_5/bungee/connection/UpstreamBridge.java b/proxy/src/main/java/net/md_5/bungee/connection/UpstreamBridge.java
index 417b2f7..1abeb63 100644
--- a/proxy/src/main/java/net/md_5/bungee/connection/UpstreamBridge.java
+++ b/proxy/src/main/java/net/md_5/bungee/connection/UpstreamBridge.java
@@ -4,6 +4,7 @@ import com.google.common.base.Preconditions;
import java.util.ArrayList;
import java.util.List;
import net.md_5.bungee.BungeeCord;
+import net.md_5.bungee.ServerConnection;
import net.md_5.bungee.UserConnection;
import net.md_5.bungee.Util;
import net.md_5.bungee.api.ProxyServer;
@@ -113,13 +114,21 @@ public class UpstreamBridge extends PacketHandler
{
Preconditions.checkArgument( chat.getMessage().length() <= 100, "Chat message too long" ); // Mojang limit, check on updates
- ChatEvent chatEvent = new ChatEvent( con, con.getServer(), chat.getMessage() );
+ ServerConnection server = con.getServer();
+
+ // if we're still connecting just ignore this packet
+ if ( server == null )
+ {
+ throw CancelSendSignal.INSTANCE;
+ }
+
+ ChatEvent chatEvent = new ChatEvent( con, server, chat.getMessage() );
if ( !bungee.getPluginManager().callEvent( chatEvent ).isCancelled() )
{
chat.setMessage( chatEvent.getMessage() );
if ( !chatEvent.isCommand() || !bungee.getPluginManager().dispatchCommand( con, chat.getMessage().substring( 1 ) ) )
{
- con.getServer().unsafe().sendPacket( chat );
+ server.unsafe().sendPacket( chat );
}
}
throw CancelSendSignal.INSTANCE;
--
2.7.4 (Apple Git-66)

View File

@ -1,4 +1,4 @@
From 3fd91a969622f74e00c86a689c3e406ada51d245 Mon Sep 17 00:00:00 2001
From 7ae4d59792e53ed7985e899b8d3f679cf10bf5ee Mon Sep 17 00:00:00 2001
From: kamcio96 <k.nadworski@icloud.com>
Date: Mon, 14 Mar 2016 16:07:20 -0700
Subject: [PATCH] Use a worker and a boss event loop group.
@ -83,5 +83,5 @@ index bc56d4f..efcba31 100644
.option( ChannelOption.CONNECT_TIMEOUT_MILLIS, 5000 ) // TODO: Configurable
.remoteAddress( getAddress() )
--
2.7.4 (Apple Git-66)
2.10.0

View File

@ -1,4 +1,4 @@
From 86a346c6b32e63edaa4fcb3898f80477adfb9ef3 Mon Sep 17 00:00:00 2001
From e909df719847e5263bbd50644914a19cb55fd29e Mon Sep 17 00:00:00 2001
From: Techcable <Techcable@techcable.net>
Date: Fri, 18 Mar 2016 10:53:24 -0700
Subject: [PATCH] Better Decompression Sanity
@ -58,5 +58,5 @@ index 0b0dd73..ba8f940 100644
if ( compressionThreshold == -1 )
{
--
2.7.4 (Apple Git-66)
2.10.0

View File

@ -1,4 +1,4 @@
From 7a70a7366cbd3f62178205d7317867739d5940ac Mon Sep 17 00:00:00 2001
From 27e270db17b1cd9aecc94dc18c94c00e83964ff8 Mon Sep 17 00:00:00 2001
From: Techcable <Techcable@techcable.net>
Date: Tue, 5 Apr 2016 11:00:16 -0700
Subject: [PATCH] Print stack trace when the ByteBuf is not direct.
@ -19,5 +19,5 @@ index 29e54db..6da27fc 100644
// See https://github.com/SpigotMC/BungeeCord/issues/1717
--
2.7.4 (Apple Git-66)
2.10.0

View File

@ -1,4 +1,4 @@
From 8ac165b0615288e4bf40a56278e5d66481ca6d2f Mon Sep 17 00:00:00 2001
From 6160bd409a7759a460bddb26dae0dfc36a0680a4 Mon Sep 17 00:00:00 2001
From: Tux <write@imaginarycode.com>
Date: Tue, 25 Oct 2016 12:34:41 -0400
Subject: [PATCH] Validate that chat messages are non-blank
@ -34,7 +34,7 @@ index 0000000..d294dda
+}
\ No newline at end of file
diff --git a/proxy/src/main/java/net/md_5/bungee/connection/UpstreamBridge.java b/proxy/src/main/java/net/md_5/bungee/connection/UpstreamBridge.java
index 1abeb63..9dbcfd1 100644
index 417b2f7..3c3fd98 100644
--- a/proxy/src/main/java/net/md_5/bungee/connection/UpstreamBridge.java
+++ b/proxy/src/main/java/net/md_5/bungee/connection/UpstreamBridge.java
@@ -1,6 +1,7 @@
@ -45,14 +45,14 @@ index 1abeb63..9dbcfd1 100644
import java.util.ArrayList;
import java.util.List;
import net.md_5.bungee.BungeeCord;
@@ -113,6 +114,7 @@ public class UpstreamBridge extends PacketHandler
@@ -112,6 +113,7 @@ public class UpstreamBridge extends PacketHandler
public void handle(Chat chat) throws Exception
{
Preconditions.checkArgument( chat.getMessage().length() <= 100, "Chat message too long" ); // Mojang limit, check on updates
+ Preconditions.checkArgument(!StringUtil.isBlank(chat.getMessage()), "Chat message is empty");
ServerConnection server = con.getServer();
ChatEvent chatEvent = new ChatEvent( con, con.getServer(), chat.getMessage() );
if ( !bungee.getPluginManager().callEvent( chatEvent ).isCancelled() )
--
2.7.4 (Apple Git-66)
2.10.0

View File

@ -1,4 +1,4 @@
From 6228b5e5fbfe99d6c929f063c851ec948e543355 Mon Sep 17 00:00:00 2001
From 5eca7dd60b1298b1c5f45fb5991329bb4f634a0b Mon Sep 17 00:00:00 2001
From: Techcable <Techcable@techcable.net>
Date: Mon, 25 Apr 2016 23:46:00 -0700
Subject: [PATCH] Reduce the overhead of lots and lots of teams with the same
@ -292,5 +292,5 @@ index 0000000..5aa306a
+
+}
--
2.9.2
2.10.0

View File

@ -1,4 +1,4 @@
From 21308e824570f0f9f43eb2837a03c8ed241a7e94 Mon Sep 17 00:00:00 2001
From 0d5af31570a42d366fdcf2c4228a4b2a6716006c Mon Sep 17 00:00:00 2001
From: Techcable <Techcable@techcable.net>
Date: Wed, 6 Apr 2016 23:46:00 -0700
Subject: [PATCH] Better debug checks
@ -18,5 +18,5 @@ index db2843f..4decbb2 100644
return protocolData.packetMap.get( packet );
}
--
2.7.4 (Apple Git-66)
2.10.0

View File

@ -1,4 +1,4 @@
From 150064853eeda8e6991722c254a272e1f1cca0a8 Mon Sep 17 00:00:00 2001
From 504b8d3df17dcef7a07c595b640dbe3932ac872f Mon Sep 17 00:00:00 2001
From: DoctorDark <doctordark11@gmail.com>
Date: Sun, 14 Feb 2016 15:54:40 +0000
Subject: [PATCH] Allow the console to tab complete commands
@ -95,5 +95,5 @@ index 0000000..455b078
+ }
+}
--
2.7.4 (Apple Git-66)
2.10.0

View File

@ -1,4 +1,4 @@
From b89db05da1e90b978c7138cf60c68fb229dd93cb Mon Sep 17 00:00:00 2001
From 3a4a864eacf06308d1a6104547ba217889c17421 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.
@ -285,5 +285,5 @@ index db9ebbd..4d16fa3 100644
+ // Waterfall end
}
--
2.7.4 (Apple Git-66)
2.10.0

View File

@ -1,4 +1,4 @@
From a3ded1b0b29b6dd6e2d0e022c6837681119b0824 Mon Sep 17 00:00:00 2001
From 8d3beb42d6ef677c18531749c030e83641056339 Mon Sep 17 00:00:00 2001
From: Troy Frew <fuzzy_bot@arenaga.me>
Date: Tue, 28 Jun 2016 23:00:49 -0500
Subject: [PATCH] Improve ServerKickEvent
@ -135,5 +135,5 @@ index c4d8d81..2a1a719 100644
{
con.connectNow( event.getCancelServer() );
--
2.7.4 (Apple Git-66)
2.10.0

View File

@ -1,4 +1,4 @@
From d5cff331d038f7297355594818cb90ff8a7fae96 Mon Sep 17 00:00:00 2001
From 29642727f4731e93eda04843d693da9d97262f99 Mon Sep 17 00:00:00 2001
From: Troy Frew <fuzzy_bot@arenaga.me>
Date: Wed, 29 Jun 2016 13:56:57 -0500
Subject: [PATCH] Configurable server version in ping response
@ -72,5 +72,5 @@ index df618d3..910bb02 100644
@Override
--
2.7.4 (Apple Git-66)
2.10.0

View File

@ -1,4 +1,4 @@
From dd2fe5d53aafb69a2fee7f1a9a651fe404721634 Mon Sep 17 00:00:00 2001
From 4f55bde65e4220f8e1d5456b4bb4ea2c74d24e05 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
@ -84,5 +84,5 @@ index 6d197ef..7e934ef 100644
// Windows is bugged, multi homed users will just have to live with random connecting IPs
if ( getPendingConnection().getListener().isSetLocalAddress() && !PlatformDependent.isWindows() )
--
2.7.4 (Apple Git-66)
2.10.0

View File

@ -1,4 +1,4 @@
From 5dc9a07ab2a5e4a0af1917faff3e804ed19fa517 Mon Sep 17 00:00:00 2001
From 02239d6bb1bc5c60eb46ef6f1802f63efacc298f Mon Sep 17 00:00:00 2001
From: minecrafter <unknown@unknown>
Date: Sun, 3 Jul 2016 04:03:21 -0400
Subject: [PATCH] Proxy query event
@ -215,5 +215,5 @@ index 0be915c..e577b3f 100644
} else
{
--
2.7.4 (Apple Git-66)
2.10.0

View File

@ -1,4 +1,4 @@
From fc7d2aa80f1913deef8e6dd15b743526c2ca758e Mon Sep 17 00:00:00 2001
From e4d11ee967d8c4ece85697de3d5fb93de0358b37 Mon Sep 17 00:00:00 2001
From: Techcable <Techcable@techcable.net>
Date: Thu, 4 Aug 2016 19:30:49 -0700
Subject: [PATCH] Dump the raw hex of a packet on a decoding error
@ -53,5 +53,5 @@ index 447eaae..17d8444 100644
{
if ( slice != null )
--
2.7.4 (Apple Git-66)
2.10.0

View File

@ -1,4 +1,4 @@
From ca2e2844d502172203d1131effe29b3f047584fc Mon Sep 17 00:00:00 2001
From 340eedc8b19ec16f1178d048dac9c866cb604616 Mon Sep 17 00:00:00 2001
From: Aaron Hill <aa1ronham@gmail.com>
Date: Thu, 15 Sep 2016 16:38:37 -0400
Subject: [PATCH] Fix potion race condition on Forge 1.8.9
@ -268,5 +268,5 @@ index 673497e..17e250d 100644
* Sends the server mod list to the client, or stores it for sending later.
*
--
2.7.4 (Apple Git-66)
2.10.0