Fix scoreboard team packet issues

This commit is contained in:
Mariaum 2018-07-22 09:48:34 -03:00 committed by Shane Freeder
parent 35a69a6c42
commit 988361eea9
6 changed files with 55 additions and 44 deletions

View File

@ -1,4 +1,4 @@
From 66c8d398c18f4d5c5ecfb84d2b40ae12b2071114 Mon Sep 17 00:00:00 2001
From 65dbbad1432589ac589cc7bbe64260a2c5443d19 Mon Sep 17 00:00:00 2001
From: Techcable <Techcable@techcable.net>
Date: Tue, 25 Oct 2016 11:58:37 -0400
Subject: [PATCH] Add Waterfall configuration files
@ -98,18 +98,18 @@ index 95590b6d..1019c307 100644
DumperOptions options = new DumperOptions();
options.setDefaultFlowStyle( DumperOptions.FlowStyle.BLOCK );
yaml = new Yaml( options );
@@ -54,6 +59,11 @@ public class YamlConfig implements ConfigurationAdapter
@@ -55,6 +60,11 @@ public class YamlConfig implements ConfigurationAdapter
@Override
public void load()
+ {
{
+ load(true);
+ }
+
+ public void load(boolean doPermissions)
{
+ {
try
{
file.createNewFile();
@@ -82,6 +92,7 @@ public class YamlConfig implements ConfigurationAdapter
throw new RuntimeException( "Could not load configuration!", ex );
}
@ -119,5 +119,5 @@ index 95590b6d..1019c307 100644
if ( permissions.isEmpty() )
{
--
2.18.0
2.13.2.windows.1

View File

@ -1,4 +1,4 @@
From 09125a80b5c210108da6bfdcd82b6a70a1099377 Mon Sep 17 00:00:00 2001
From c0d400a1b6b564cb5e9f6bb28b4477f0f94ea24f 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
@ -49,12 +49,12 @@ index 9509f8ee..60de276e 100644
+ }
+
public final DefinedPacket createPacket(int id, int version)
+ {
{
+ return createPacket(id, version, true);
+ }
+
+ public final DefinedPacket createPacket(int id, int version, boolean supportsForge)
{
+ {
ProtocolData protocolData = getProtocolData( version );
if ( protocolData == null )
{
@ -122,5 +122,5 @@ index cae566f5..bad9773b 100644
{
rewriteInt( packet, oldId, newId, readerIndex + packetIdLength );
--
2.18.0
2.13.2.windows.1

View File

@ -1,4 +1,4 @@
From acbdc846752ec4eaee62fac5636b5f0789e4261d Mon Sep 17 00:00:00 2001
From a3f0e2092f693b692659a90b30c7e39bdeee692a 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
@ -44,12 +44,12 @@ index 0e1ef5c4..ee63732d 100644
+ // Waterfall start
+ @Deprecated
public ServerKickEvent(ProxiedPlayer player, ServerInfo kickedFrom, BaseComponent[] kickReasonComponent, ServerInfo cancelServer, State state)
+ {
{
+ this( player, kickedFrom, kickReasonComponent, cancelServer, state, Cause.UNKNOWN );
+ }
+
+ public ServerKickEvent(ProxiedPlayer player, ServerInfo kickedFrom, BaseComponent[] kickReasonComponent, ServerInfo cancelServer, State state, Cause cause)
{
+ {
this.player = player;
this.kickedFrom = kickedFrom;
this.kickReasonComponent = kickReasonComponent;
@ -146,5 +146,5 @@ index b5a4a929..921605ab 100644
{
con.connectNow( event.getCancelServer(), ServerConnectEvent.Reason.KICK_REDIRECT );
--
2.18.0
2.13.2.windows.1

View File

@ -1,4 +1,4 @@
From 34006bf32ef70c80581b239aa6853d1da9cc2fbd Mon Sep 17 00:00:00 2001
From 8385fbfbe798dab73f17bd3ffaef40a1be90399a Mon Sep 17 00:00:00 2001
From: Minecrell <minecrell@minecrell.net>
Date: Fri, 22 Sep 2017 13:15:09 +0200
Subject: [PATCH] Allow plugins to use SLF4J for logging
@ -42,19 +42,19 @@ diff --git a/log4j/pom.xml b/log4j/pom.xml
index 36fceb93..a085a39c 100644
--- a/log4j/pom.xml
+++ b/log4j/pom.xml
@@ -38,6 +38,12 @@
<artifactId>log4j-jul</artifactId>
@@ -39,6 +39,12 @@
<version>${log4j2.version}</version>
</dependency>
+ <dependency>
<dependency>
+ <groupId>org.apache.logging.log4j</groupId>
+ <artifactId>log4j-slf4j-impl</artifactId>
+ <version>${log4j2.version}</version>
+ <scope>runtime</scope>
+ </dependency>
<dependency>
+ <dependency>
<groupId>com.lmax</groupId>
<artifactId>disruptor</artifactId>
<version>3.4.2</version>
--
2.18.0
2.13.2.windows.1

View File

@ -1,4 +1,4 @@
From 2cfa87ce594755647688295f317aa7c622ccd376 Mon Sep 17 00:00:00 2001
From ed00bc1b36619e56d2df86e68f37be022f79e849 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
@ -8,36 +8,36 @@ diff --git a/api/src/main/java/net/md_5/bungee/api/ProxyConfig.java b/api/src/ma
index 43519ce1..2631d6bb 100644
--- a/api/src/main/java/net/md_5/bungee/api/ProxyConfig.java
+++ b/api/src/main/java/net/md_5/bungee/api/ProxyConfig.java
@@ -168,6 +168,11 @@ public interface ProxyConfig
*/
@@ -169,6 +169,11 @@ public interface ProxyConfig
boolean isLogServerListPing();
+ /**
/**
+ * Whether we log InitialHandler connections
+ */
+ boolean isLogInitialHandlerConnections();
+
/**
+ /**
* The supported versions
*/
String getGameVersion();
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 7dc3c2d9..5ba15771 100644
--- a/proxy/src/main/java/io/github/waterfallmc/waterfall/conf/WaterfallConfiguration.java
+++ b/proxy/src/main/java/io/github/waterfallmc/waterfall/conf/WaterfallConfiguration.java
@@ -26,6 +26,13 @@ public class WaterfallConfiguration extends Configuration {
*/
@@ -27,6 +27,13 @@ public class WaterfallConfiguration extends Configuration {
private boolean logServerListPing = false;
+ /**
/**
+ * Whether we log InitialHandler connections
+ * <p>
+ * Default is true
+ */
+ private boolean logInitialHandlerConnections = true;
+
/**
+ /**
* The supported versions displayed to the client
* <p>Default is a comma seperated list of supported versions. For example 1.8.x, 1.9.x, 1.10.x</p>
*/
@@ -60,6 +67,7 @@ public class WaterfallConfiguration extends Configuration {
config.load(false); // Load, but no permissions
metrics = config.getBoolean("metrics", metrics);
@ -72,5 +72,5 @@ index 2347654c..c6e109c5 100644
ch.setProtocol( Protocol.LOGIN );
--
2.18.0
2.13.2.windows.1

View File

@ -1,4 +1,4 @@
From 5b1a96af91f4337f5c724daa15ed0351f23ff3b8 Mon Sep 17 00:00:00 2001
From 5017fe3f6491b212ab9563fa6c2fa38b12a38c15 Mon Sep 17 00:00:00 2001
From: Shane Freeder <theboyetronic@gmail.com>
Date: Sat, 21 Jul 2018 17:14:39 +0100
Subject: [PATCH] 1.13 protocol support
@ -54,26 +54,26 @@ index 6279d9f3..f1ad722d 100644
}
}
diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/packet/Team.java b/protocol/src/main/java/net/md_5/bungee/protocol/packet/Team.java
index f93508d9..19d0d2d9 100644
index f93508d9..1b748c37 100644
--- a/protocol/src/main/java/net/md_5/bungee/protocol/packet/Team.java
+++ b/protocol/src/main/java/net/md_5/bungee/protocol/packet/Team.java
@@ -1,5 +1,7 @@
@@ -1,5 +1,8 @@
package net.md_5.bungee.protocol.packet;
+import net.md_5.bungee.api.chat.BaseComponent;
+import net.md_5.bungee.api.chat.TextComponent; // Waterfall
+import net.md_5.bungee.chat.ComponentSerializer; // Waterfall
import net.md_5.bungee.protocol.DefinedPacket;
import io.netty.buffer.ByteBuf;
import lombok.AllArgsConstructor;
@@ -46,7 +48,14 @@ public class Team extends DefinedPacket
@@ -46,7 +49,13 @@ public class Team extends DefinedPacket
mode = buf.readByte();
if ( mode == 0 || mode == 2 )
{
- displayName = readString( buf );
+ // Waterfall start - 1.13
+ if (protocolVersion >= ProtocolConstants.MINECRAFT_1_13) {
+ String displayNameJson = readString(buf);
+ displayName = TextComponent.toLegacyText(ComponentSerializer.parse(displayNameJson));
+ displayName = readComponentAsString( buf );
+ } else {
+ displayName = readString( buf );
+ }
@ -81,22 +81,20 @@ index f93508d9..19d0d2d9 100644
if ( protocolVersion < ProtocolConstants.MINECRAFT_1_13 )
{
prefix = readString( buf );
@@ -61,8 +70,12 @@ public class Team extends DefinedPacket
@@ -61,8 +70,10 @@ public class Team extends DefinedPacket
color = ( protocolVersion >= ProtocolConstants.MINECRAFT_1_13 ) ? readVarInt( buf ) : buf.readByte();
if ( protocolVersion >= ProtocolConstants.MINECRAFT_1_13 )
{
- prefix = readString( buf );
- suffix = readString( buf );
+ // Waterfall start - 1.13
+ String prefixJson = readString( buf );
+ String suffixJson = readString( buf );
+ prefix = TextComponent.toLegacyText(ComponentSerializer.parse(prefixJson));
+ suffix = TextComponent.toLegacyText(ComponentSerializer.parse(suffixJson));
+ prefix = readComponentAsString( buf );
+ suffix = readComponentAsString( buf );
+ // Waterfall end
}
}
if ( mode == 0 || mode == 3 || mode == 4 )
@@ -83,7 +96,14 @@ public class Team extends DefinedPacket
@@ -83,7 +94,14 @@ public class Team extends DefinedPacket
buf.writeByte( mode );
if ( mode == 0 || mode == 2 )
{
@ -112,7 +110,7 @@ index f93508d9..19d0d2d9 100644
if ( protocolVersion < ProtocolConstants.MINECRAFT_1_13 )
{
writeString( prefix, buf );
@@ -98,9 +118,14 @@ public class Team extends DefinedPacket
@@ -98,9 +116,14 @@ public class Team extends DefinedPacket
if ( protocolVersion >= ProtocolConstants.MINECRAFT_1_13 )
{
@ -129,6 +127,19 @@ index f93508d9..19d0d2d9 100644
} else
{
buf.writeByte( color );
@@ -121,4 +144,12 @@ public class Team extends DefinedPacket
{
handler.handle( this );
}
+
+ // Waterfall start - 1.13
+ public static String readComponentAsString(ByteBuf buf)
+ {
+ BaseComponent[] components = ComponentSerializer.parse(readString(buf));
+ return components[0] == null ? "" : TextComponent.toLegacyText(components);
+ }
+ // Waterfall end - 1.13
}
--
2.18.0
2.13.2.windows.1