mirror of
https://github.com/PaperMC/Waterfall.git
synced 2024-09-28 22:47:49 +02:00
Fix scoreboard team packet issues
This commit is contained in:
parent
35a69a6c42
commit
988361eea9
@ -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>
|
From: Techcable <Techcable@techcable.net>
|
||||||
Date: Tue, 25 Oct 2016 11:58:37 -0400
|
Date: Tue, 25 Oct 2016 11:58:37 -0400
|
||||||
Subject: [PATCH] Add Waterfall configuration files
|
Subject: [PATCH] Add Waterfall configuration files
|
||||||
@ -98,18 +98,18 @@ index 95590b6d..1019c307 100644
|
|||||||
DumperOptions options = new DumperOptions();
|
DumperOptions options = new DumperOptions();
|
||||||
options.setDefaultFlowStyle( DumperOptions.FlowStyle.BLOCK );
|
options.setDefaultFlowStyle( DumperOptions.FlowStyle.BLOCK );
|
||||||
yaml = new Yaml( options );
|
yaml = new Yaml( options );
|
||||||
@@ -54,6 +59,11 @@ public class YamlConfig implements ConfigurationAdapter
|
@@ -55,6 +60,11 @@ public class YamlConfig implements ConfigurationAdapter
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void load()
|
public void load()
|
||||||
+ {
|
{
|
||||||
+ load(true);
|
+ load(true);
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
+ public void load(boolean doPermissions)
|
+ public void load(boolean doPermissions)
|
||||||
{
|
+ {
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
file.createNewFile();
|
||||||
@@ -82,6 +92,7 @@ public class YamlConfig implements ConfigurationAdapter
|
@@ -82,6 +92,7 @@ public class YamlConfig implements ConfigurationAdapter
|
||||||
throw new RuntimeException( "Could not load configuration!", ex );
|
throw new RuntimeException( "Could not load configuration!", ex );
|
||||||
}
|
}
|
||||||
@ -119,5 +119,5 @@ index 95590b6d..1019c307 100644
|
|||||||
if ( permissions.isEmpty() )
|
if ( permissions.isEmpty() )
|
||||||
{
|
{
|
||||||
--
|
--
|
||||||
2.18.0
|
2.13.2.windows.1
|
||||||
|
|
||||||
|
@ -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>
|
From: Techcable <Techcable@techcable.net>
|
||||||
Date: Thu, 19 May 2016 17:09:22 -0600
|
Date: Thu, 19 May 2016 17:09:22 -0600
|
||||||
Subject: [PATCH] Allow invalid packet ids for forge servers
|
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)
|
public final DefinedPacket createPacket(int id, int version)
|
||||||
+ {
|
{
|
||||||
+ return createPacket(id, version, true);
|
+ return createPacket(id, version, true);
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
+ public final DefinedPacket createPacket(int id, int version, boolean supportsForge)
|
+ public final DefinedPacket createPacket(int id, int version, boolean supportsForge)
|
||||||
{
|
+ {
|
||||||
ProtocolData protocolData = getProtocolData( version );
|
ProtocolData protocolData = getProtocolData( version );
|
||||||
if ( protocolData == null )
|
if ( protocolData == null )
|
||||||
{
|
{
|
||||||
@ -122,5 +122,5 @@ index cae566f5..bad9773b 100644
|
|||||||
{
|
{
|
||||||
rewriteInt( packet, oldId, newId, readerIndex + packetIdLength );
|
rewriteInt( packet, oldId, newId, readerIndex + packetIdLength );
|
||||||
--
|
--
|
||||||
2.18.0
|
2.13.2.windows.1
|
||||||
|
|
||||||
|
@ -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>
|
From: Nathan Poirier <nathan@poirier.io>
|
||||||
Date: Tue, 28 Jun 2016 23:00:49 -0500
|
Date: Tue, 28 Jun 2016 23:00:49 -0500
|
||||||
Subject: [PATCH] Improve ServerKickEvent
|
Subject: [PATCH] Improve ServerKickEvent
|
||||||
@ -44,12 +44,12 @@ index 0e1ef5c4..ee63732d 100644
|
|||||||
+ // Waterfall start
|
+ // Waterfall start
|
||||||
+ @Deprecated
|
+ @Deprecated
|
||||||
public ServerKickEvent(ProxiedPlayer player, ServerInfo kickedFrom, BaseComponent[] kickReasonComponent, ServerInfo cancelServer, State state)
|
public ServerKickEvent(ProxiedPlayer player, ServerInfo kickedFrom, BaseComponent[] kickReasonComponent, ServerInfo cancelServer, State state)
|
||||||
+ {
|
{
|
||||||
+ this( player, kickedFrom, kickReasonComponent, cancelServer, state, Cause.UNKNOWN );
|
+ this( player, kickedFrom, kickReasonComponent, cancelServer, state, Cause.UNKNOWN );
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
+ public ServerKickEvent(ProxiedPlayer player, ServerInfo kickedFrom, BaseComponent[] kickReasonComponent, ServerInfo cancelServer, State state, Cause cause)
|
+ public ServerKickEvent(ProxiedPlayer player, ServerInfo kickedFrom, BaseComponent[] kickReasonComponent, ServerInfo cancelServer, State state, Cause cause)
|
||||||
{
|
+ {
|
||||||
this.player = player;
|
this.player = player;
|
||||||
this.kickedFrom = kickedFrom;
|
this.kickedFrom = kickedFrom;
|
||||||
this.kickReasonComponent = kickReasonComponent;
|
this.kickReasonComponent = kickReasonComponent;
|
||||||
@ -146,5 +146,5 @@ index b5a4a929..921605ab 100644
|
|||||||
{
|
{
|
||||||
con.connectNow( event.getCancelServer(), ServerConnectEvent.Reason.KICK_REDIRECT );
|
con.connectNow( event.getCancelServer(), ServerConnectEvent.Reason.KICK_REDIRECT );
|
||||||
--
|
--
|
||||||
2.18.0
|
2.13.2.windows.1
|
||||||
|
|
||||||
|
@ -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>
|
From: Minecrell <minecrell@minecrell.net>
|
||||||
Date: Fri, 22 Sep 2017 13:15:09 +0200
|
Date: Fri, 22 Sep 2017 13:15:09 +0200
|
||||||
Subject: [PATCH] Allow plugins to use SLF4J for logging
|
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
|
index 36fceb93..a085a39c 100644
|
||||||
--- a/log4j/pom.xml
|
--- a/log4j/pom.xml
|
||||||
+++ b/log4j/pom.xml
|
+++ b/log4j/pom.xml
|
||||||
@@ -38,6 +38,12 @@
|
@@ -39,6 +39,12 @@
|
||||||
<artifactId>log4j-jul</artifactId>
|
|
||||||
<version>${log4j2.version}</version>
|
<version>${log4j2.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
+ <dependency>
|
<dependency>
|
||||||
+ <groupId>org.apache.logging.log4j</groupId>
|
+ <groupId>org.apache.logging.log4j</groupId>
|
||||||
+ <artifactId>log4j-slf4j-impl</artifactId>
|
+ <artifactId>log4j-slf4j-impl</artifactId>
|
||||||
+ <version>${log4j2.version}</version>
|
+ <version>${log4j2.version}</version>
|
||||||
+ <scope>runtime</scope>
|
+ <scope>runtime</scope>
|
||||||
+ </dependency>
|
+ </dependency>
|
||||||
<dependency>
|
+ <dependency>
|
||||||
<groupId>com.lmax</groupId>
|
<groupId>com.lmax</groupId>
|
||||||
<artifactId>disruptor</artifactId>
|
<artifactId>disruptor</artifactId>
|
||||||
|
<version>3.4.2</version>
|
||||||
--
|
--
|
||||||
2.18.0
|
2.13.2.windows.1
|
||||||
|
|
||||||
|
@ -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>
|
From: Gabriele C <sgdc3.mail@gmail.com>
|
||||||
Date: Thu, 8 Feb 2018 19:10:52 +0100
|
Date: Thu, 8 Feb 2018 19:10:52 +0100
|
||||||
Subject: [PATCH] Optionally log InitialHandler connections
|
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
|
index 43519ce1..2631d6bb 100644
|
||||||
--- a/api/src/main/java/net/md_5/bungee/api/ProxyConfig.java
|
--- a/api/src/main/java/net/md_5/bungee/api/ProxyConfig.java
|
||||||
+++ b/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();
|
boolean isLogServerListPing();
|
||||||
|
|
||||||
+ /**
|
/**
|
||||||
+ * Whether we log InitialHandler connections
|
+ * Whether we log InitialHandler connections
|
||||||
+ */
|
+ */
|
||||||
+ boolean isLogInitialHandlerConnections();
|
+ boolean isLogInitialHandlerConnections();
|
||||||
+
|
+
|
||||||
/**
|
+ /**
|
||||||
* The supported versions
|
* 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
|
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
|
index 7dc3c2d9..5ba15771 100644
|
||||||
--- a/proxy/src/main/java/io/github/waterfallmc/waterfall/conf/WaterfallConfiguration.java
|
--- a/proxy/src/main/java/io/github/waterfallmc/waterfall/conf/WaterfallConfiguration.java
|
||||||
+++ b/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;
|
private boolean logServerListPing = false;
|
||||||
|
|
||||||
+ /**
|
/**
|
||||||
+ * Whether we log InitialHandler connections
|
+ * Whether we log InitialHandler connections
|
||||||
+ * <p>
|
+ * <p>
|
||||||
+ * Default is true
|
+ * Default is true
|
||||||
+ */
|
+ */
|
||||||
+ private boolean logInitialHandlerConnections = true;
|
+ private boolean logInitialHandlerConnections = true;
|
||||||
+
|
+
|
||||||
/**
|
+ /**
|
||||||
* The supported versions displayed to the client
|
* 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>
|
* <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 {
|
@@ -60,6 +67,7 @@ public class WaterfallConfiguration extends Configuration {
|
||||||
config.load(false); // Load, but no permissions
|
config.load(false); // Load, but no permissions
|
||||||
metrics = config.getBoolean("metrics", metrics);
|
metrics = config.getBoolean("metrics", metrics);
|
||||||
@ -72,5 +72,5 @@ index 2347654c..c6e109c5 100644
|
|||||||
ch.setProtocol( Protocol.LOGIN );
|
ch.setProtocol( Protocol.LOGIN );
|
||||||
|
|
||||||
--
|
--
|
||||||
2.18.0
|
2.13.2.windows.1
|
||||||
|
|
||||||
|
@ -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>
|
From: Shane Freeder <theboyetronic@gmail.com>
|
||||||
Date: Sat, 21 Jul 2018 17:14:39 +0100
|
Date: Sat, 21 Jul 2018 17:14:39 +0100
|
||||||
Subject: [PATCH] 1.13 protocol support
|
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
|
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
|
--- 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
|
+++ 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;
|
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.api.chat.TextComponent; // Waterfall
|
||||||
+import net.md_5.bungee.chat.ComponentSerializer; // Waterfall
|
+import net.md_5.bungee.chat.ComponentSerializer; // Waterfall
|
||||||
import net.md_5.bungee.protocol.DefinedPacket;
|
import net.md_5.bungee.protocol.DefinedPacket;
|
||||||
import io.netty.buffer.ByteBuf;
|
import io.netty.buffer.ByteBuf;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
@@ -46,7 +48,14 @@ public class Team extends DefinedPacket
|
@@ -46,7 +49,13 @@ public class Team extends DefinedPacket
|
||||||
mode = buf.readByte();
|
mode = buf.readByte();
|
||||||
if ( mode == 0 || mode == 2 )
|
if ( mode == 0 || mode == 2 )
|
||||||
{
|
{
|
||||||
- displayName = readString( buf );
|
- displayName = readString( buf );
|
||||||
+ // Waterfall start - 1.13
|
+ // Waterfall start - 1.13
|
||||||
+ if (protocolVersion >= ProtocolConstants.MINECRAFT_1_13) {
|
+ if (protocolVersion >= ProtocolConstants.MINECRAFT_1_13) {
|
||||||
+ String displayNameJson = readString(buf);
|
+ displayName = readComponentAsString( buf );
|
||||||
+ displayName = TextComponent.toLegacyText(ComponentSerializer.parse(displayNameJson));
|
|
||||||
+ } else {
|
+ } else {
|
||||||
+ displayName = readString( buf );
|
+ displayName = readString( buf );
|
||||||
+ }
|
+ }
|
||||||
@ -81,22 +81,20 @@ index f93508d9..19d0d2d9 100644
|
|||||||
if ( protocolVersion < ProtocolConstants.MINECRAFT_1_13 )
|
if ( protocolVersion < ProtocolConstants.MINECRAFT_1_13 )
|
||||||
{
|
{
|
||||||
prefix = readString( buf );
|
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();
|
color = ( protocolVersion >= ProtocolConstants.MINECRAFT_1_13 ) ? readVarInt( buf ) : buf.readByte();
|
||||||
if ( protocolVersion >= ProtocolConstants.MINECRAFT_1_13 )
|
if ( protocolVersion >= ProtocolConstants.MINECRAFT_1_13 )
|
||||||
{
|
{
|
||||||
- prefix = readString( buf );
|
- prefix = readString( buf );
|
||||||
- suffix = readString( buf );
|
- suffix = readString( buf );
|
||||||
+ // Waterfall start - 1.13
|
+ // Waterfall start - 1.13
|
||||||
+ String prefixJson = readString( buf );
|
+ prefix = readComponentAsString( buf );
|
||||||
+ String suffixJson = readString( buf );
|
+ suffix = readComponentAsString( buf );
|
||||||
+ prefix = TextComponent.toLegacyText(ComponentSerializer.parse(prefixJson));
|
|
||||||
+ suffix = TextComponent.toLegacyText(ComponentSerializer.parse(suffixJson));
|
|
||||||
+ // Waterfall end
|
+ // Waterfall end
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ( mode == 0 || mode == 3 || mode == 4 )
|
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 );
|
buf.writeByte( mode );
|
||||||
if ( mode == 0 || mode == 2 )
|
if ( mode == 0 || mode == 2 )
|
||||||
{
|
{
|
||||||
@ -112,7 +110,7 @@ index f93508d9..19d0d2d9 100644
|
|||||||
if ( protocolVersion < ProtocolConstants.MINECRAFT_1_13 )
|
if ( protocolVersion < ProtocolConstants.MINECRAFT_1_13 )
|
||||||
{
|
{
|
||||||
writeString( prefix, buf );
|
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 )
|
if ( protocolVersion >= ProtocolConstants.MINECRAFT_1_13 )
|
||||||
{
|
{
|
||||||
@ -129,6 +127,19 @@ index f93508d9..19d0d2d9 100644
|
|||||||
} else
|
} else
|
||||||
{
|
{
|
||||||
buf.writeByte( color );
|
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
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user