mirror of
https://github.com/PaperMC/Waterfall.git
synced 2024-11-18 16:25:14 +01:00
Updated Upstream (Waterfall)
This commit is contained in:
parent
4feb291b0d
commit
b69efbcf2c
@ -1 +1 @@
|
|||||||
Subproject commit 80a64a6f08eb4f00a12fd98991ca6640b4d5a3f0
|
Subproject commit 2322301e636482f5eee44b7f7586a66408a502f4
|
@ -1,4 +1,4 @@
|
|||||||
From 73739a822f6730c871a88ade6d7fe7d5efbc117c Mon Sep 17 00:00:00 2001
|
From 6c907417fb81eab79424a93cd1d5db29ebbab197 Mon Sep 17 00:00:00 2001
|
||||||
From: Techcable <Techcable@techcable.net>
|
From: Techcable <Techcable@techcable.net>
|
||||||
Date: Mon, 6 Jun 2016 13:47:46 -0600
|
Date: Mon, 6 Jun 2016 13:47:46 -0600
|
||||||
Subject: [PATCH] Rename references from Waterfall to FlameCord
|
Subject: [PATCH] Rename references from Waterfall to FlameCord
|
||||||
@ -44,7 +44,7 @@ index d703d6d2..49dce84b 100644
|
|||||||
}
|
}
|
||||||
|
|
||||||
diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java
|
diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java
|
||||||
index 07d74c67..a4b58d9c 100644
|
index 9ef2b77a..2fef94e5 100644
|
||||||
--- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java
|
--- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java
|
||||||
+++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java
|
+++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java
|
||||||
@@ -188,7 +188,7 @@ public class BungeeCord extends ProxyServer
|
@@ -188,7 +188,7 @@ public class BungeeCord extends ProxyServer
|
||||||
@ -56,7 +56,7 @@ index 07d74c67..a4b58d9c 100644
|
|||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
@@ -539,7 +539,7 @@ public class BungeeCord extends ProxyServer
|
@@ -536,7 +536,7 @@ public class BungeeCord extends ProxyServer
|
||||||
@Override
|
@Override
|
||||||
public String getName()
|
public String getName()
|
||||||
{
|
{
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
From 40ee61cc9b114b89dfabfc3f0f070edf18c2bd03 Mon Sep 17 00:00:00 2001
|
From 87c680c40d5cb84882e5328c9f1d0adffc86b386 Mon Sep 17 00:00:00 2001
|
||||||
From: LinsaFTW <25271111+linsaftw@users.noreply.github.com>
|
From: LinsaFTW <25271111+linsaftw@users.noreply.github.com>
|
||||||
Date: Tue, 8 Jun 2021 22:24:27 -0300
|
Date: Tue, 8 Jun 2021 22:24:27 -0300
|
||||||
Subject: [PATCH] FlameCord rebrand
|
Subject: [PATCH] FlameCord rebrand
|
||||||
|
|
||||||
|
|
||||||
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 e31fb00ae..ff4bbf34d 100644
|
index e31fb00a..ff4bbf34 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
|
||||||
@@ -68,7 +68,8 @@ public class WaterfallConfiguration extends Configuration {
|
@@ -68,7 +68,8 @@ public class WaterfallConfiguration extends Configuration {
|
||||||
@ -19,10 +19,10 @@ index e31fb00ae..ff4bbf34d 100644
|
|||||||
// Throttling options
|
// Throttling options
|
||||||
tabThrottle = config.getInt("throttling.tab_complete", tabThrottle);
|
tabThrottle = config.getInt("throttling.tab_complete", tabThrottle);
|
||||||
diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java
|
diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java
|
||||||
index a4b58d9c6..40ceeb18d 100644
|
index 2fef94e5..15a639de 100644
|
||||||
--- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java
|
--- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java
|
||||||
+++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java
|
+++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java
|
||||||
@@ -545,7 +545,7 @@ public class BungeeCord extends ProxyServer
|
@@ -542,7 +542,7 @@ public class BungeeCord extends ProxyServer
|
||||||
@Override
|
@Override
|
||||||
public String getVersion()
|
public String getVersion()
|
||||||
{
|
{
|
||||||
@ -32,7 +32,7 @@ index a4b58d9c6..40ceeb18d 100644
|
|||||||
|
|
||||||
public void reloadMessages()
|
public void reloadMessages()
|
||||||
diff --git a/proxy/src/main/java/net/md_5/bungee/command/CommandBungee.java b/proxy/src/main/java/net/md_5/bungee/command/CommandBungee.java
|
diff --git a/proxy/src/main/java/net/md_5/bungee/command/CommandBungee.java b/proxy/src/main/java/net/md_5/bungee/command/CommandBungee.java
|
||||||
index 820f7b03c..aeda79639 100644
|
index 820f7b03..aeda7963 100644
|
||||||
--- a/proxy/src/main/java/net/md_5/bungee/command/CommandBungee.java
|
--- a/proxy/src/main/java/net/md_5/bungee/command/CommandBungee.java
|
||||||
+++ b/proxy/src/main/java/net/md_5/bungee/command/CommandBungee.java
|
+++ b/proxy/src/main/java/net/md_5/bungee/command/CommandBungee.java
|
||||||
@@ -16,6 +16,7 @@ public class CommandBungee extends Command
|
@@ -16,6 +16,7 @@ public class CommandBungee extends Command
|
||||||
@ -45,7 +45,7 @@ index 820f7b03c..aeda79639 100644
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
diff --git a/query/src/main/java/net/md_5/bungee/query/QueryHandler.java b/query/src/main/java/net/md_5/bungee/query/QueryHandler.java
|
diff --git a/query/src/main/java/net/md_5/bungee/query/QueryHandler.java b/query/src/main/java/net/md_5/bungee/query/QueryHandler.java
|
||||||
index 0c1ecfb8e..b2b199969 100644
|
index 0c1ecfb8..b2b19996 100644
|
||||||
--- a/query/src/main/java/net/md_5/bungee/query/QueryHandler.java
|
--- a/query/src/main/java/net/md_5/bungee/query/QueryHandler.java
|
||||||
+++ b/query/src/main/java/net/md_5/bungee/query/QueryHandler.java
|
+++ b/query/src/main/java/net/md_5/bungee/query/QueryHandler.java
|
||||||
@@ -103,7 +103,8 @@ public class QueryHandler extends SimpleChannelInboundHandler<DatagramPacket>
|
@@ -103,7 +103,8 @@ public class QueryHandler extends SimpleChannelInboundHandler<DatagramPacket>
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
From 4ad196ffeace48412b9dd00040c605ffc6f2fb36 Mon Sep 17 00:00:00 2001
|
From 2c965a41d72b044e78b263ce969bfd91a14062ba Mon Sep 17 00:00:00 2001
|
||||||
From: LinsaFTW <25271111+linsaftw@users.noreply.github.com>
|
From: LinsaFTW <25271111+linsaftw@users.noreply.github.com>
|
||||||
Date: Thu, 30 Sep 2021 19:54:33 -0300
|
Date: Thu, 30 Sep 2021 19:54:33 -0300
|
||||||
Subject: [PATCH] 1.7.x support
|
Subject: [PATCH] 1.7.x support
|
||||||
@ -706,7 +706,7 @@ index 92bacc7c..cae5bda5 100644
|
|||||||
DefinedPacket.writeVarInt( items.length, buf );
|
DefinedPacket.writeVarInt( items.length, buf );
|
||||||
for ( Item item : items )
|
for ( Item item : items )
|
||||||
diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/packet/PluginMessage.java b/protocol/src/main/java/net/md_5/bungee/protocol/packet/PluginMessage.java
|
diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/packet/PluginMessage.java b/protocol/src/main/java/net/md_5/bungee/protocol/packet/PluginMessage.java
|
||||||
index 4f3a8c72..2d87692f 100644
|
index 91f71c09..57a82d29 100644
|
||||||
--- a/protocol/src/main/java/net/md_5/bungee/protocol/packet/PluginMessage.java
|
--- a/protocol/src/main/java/net/md_5/bungee/protocol/packet/PluginMessage.java
|
||||||
+++ b/protocol/src/main/java/net/md_5/bungee/protocol/packet/PluginMessage.java
|
+++ b/protocol/src/main/java/net/md_5/bungee/protocol/packet/PluginMessage.java
|
||||||
@@ -73,6 +73,15 @@ public class PluginMessage extends DefinedPacket
|
@@ -73,6 +73,15 @@ public class PluginMessage extends DefinedPacket
|
||||||
@ -723,8 +723,8 @@ index 4f3a8c72..2d87692f 100644
|
|||||||
+ // FlameCord end - 1.7.x support
|
+ // FlameCord end - 1.7.x support
|
||||||
+
|
+
|
||||||
tag = ( protocolVersion >= ProtocolConstants.MINECRAFT_1_13 ) ? MODERNISE.apply( readString( buf ) ) : readString( buf, 20 );
|
tag = ( protocolVersion >= ProtocolConstants.MINECRAFT_1_13 ) ? MODERNISE.apply( readString( buf ) ) : readString( buf, 20 );
|
||||||
int maxSize = direction == ProtocolConstants.Direction.TO_SERVER ? Short.MAX_VALUE : 0x100000;
|
int maxSize = ( direction == ProtocolConstants.Direction.TO_SERVER ) ? Short.MAX_VALUE : 0x100000;
|
||||||
Preconditions.checkArgument( buf.readableBytes() < maxSize );
|
Preconditions.checkArgument( buf.readableBytes() <= maxSize, "Payload too large" );
|
||||||
@@ -83,6 +92,15 @@ public class PluginMessage extends DefinedPacket
|
@@ -83,6 +92,15 @@ public class PluginMessage extends DefinedPacket
|
||||||
@Override
|
@Override
|
||||||
public void write(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion)
|
public void write(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion)
|
||||||
@ -741,6 +741,112 @@ index 4f3a8c72..2d87692f 100644
|
|||||||
writeString( ( protocolVersion >= ProtocolConstants.MINECRAFT_1_13 ) ? MODERNISE.apply( tag ) : tag, buf );
|
writeString( ( protocolVersion >= ProtocolConstants.MINECRAFT_1_13 ) ? MODERNISE.apply( tag ) : tag, buf );
|
||||||
buf.writeBytes( data );
|
buf.writeBytes( data );
|
||||||
}
|
}
|
||||||
|
diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/packet/PluginMessage.java.orig b/protocol/src/main/java/net/md_5/bungee/protocol/packet/PluginMessage.java.orig
|
||||||
|
new file mode 100644
|
||||||
|
index 00000000..91f71c09
|
||||||
|
--- /dev/null
|
||||||
|
+++ b/protocol/src/main/java/net/md_5/bungee/protocol/packet/PluginMessage.java.orig
|
||||||
|
@@ -0,0 +1,100 @@
|
||||||
|
+package net.md_5.bungee.protocol.packet;
|
||||||
|
+
|
||||||
|
+import com.google.common.base.Function;
|
||||||
|
+import com.google.common.base.Preconditions;
|
||||||
|
+import io.netty.buffer.ByteBuf;
|
||||||
|
+import io.netty.buffer.ByteBufUtil; // Waterfall
|
||||||
|
+import java.io.ByteArrayInputStream;
|
||||||
|
+import java.io.DataInput;
|
||||||
|
+import java.io.DataInputStream;
|
||||||
|
+import java.util.Locale;
|
||||||
|
+import lombok.AllArgsConstructor;
|
||||||
|
+import lombok.Data;
|
||||||
|
+import lombok.EqualsAndHashCode;
|
||||||
|
+import lombok.NoArgsConstructor;
|
||||||
|
+import net.md_5.bungee.protocol.AbstractPacketHandler;
|
||||||
|
+import net.md_5.bungee.protocol.DefinedPacket;
|
||||||
|
+import net.md_5.bungee.protocol.ProtocolConstants;
|
||||||
|
+
|
||||||
|
+@Data
|
||||||
|
+@NoArgsConstructor
|
||||||
|
+@AllArgsConstructor
|
||||||
|
+@EqualsAndHashCode(callSuper = false)
|
||||||
|
+public class PluginMessage extends DefinedPacket
|
||||||
|
+{
|
||||||
|
+
|
||||||
|
+ public static final Function<String, String> MODERNISE = new Function<String, String>()
|
||||||
|
+ {
|
||||||
|
+ @Override
|
||||||
|
+ public String apply(String tag)
|
||||||
|
+ {
|
||||||
|
+ // Transform as per Bukkit
|
||||||
|
+ if ( tag.equals( "BungeeCord" ) )
|
||||||
|
+ {
|
||||||
|
+ return "bungeecord:main";
|
||||||
|
+ }
|
||||||
|
+ if ( tag.equals( "bungeecord:main" ) )
|
||||||
|
+ {
|
||||||
|
+ return "BungeeCord";
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ // Code that gets to here is UNLIKELY to be viable on the Bukkit side of side things,
|
||||||
|
+ // but we keep it anyway. It will eventually be enforced API side.
|
||||||
|
+ if ( tag.indexOf( ':' ) != -1 )
|
||||||
|
+ {
|
||||||
|
+ return tag;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ return "legacy:" + tag.toLowerCase( Locale.ROOT );
|
||||||
|
+ }
|
||||||
|
+ };
|
||||||
|
+
|
||||||
|
+ public PluginMessage(String tag, ByteBuf data, boolean allowExtendedPacket) {
|
||||||
|
+ this(tag, ByteBufUtil.getBytes(data), allowExtendedPacket);
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ private String tag;
|
||||||
|
+ private byte[] data;
|
||||||
|
+
|
||||||
|
+ public void setData(byte[] data) {
|
||||||
|
+ this.data = Preconditions.checkNotNull(data, "Null data");
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ public void setData(ByteBuf buf) {
|
||||||
|
+ Preconditions.checkNotNull(buf, "Null buffer");
|
||||||
|
+ setData(ByteBufUtil.getBytes(buf));
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ /**
|
||||||
|
+ * Allow this packet to be sent as an "extended" packet.
|
||||||
|
+ */
|
||||||
|
+ private boolean allowExtendedPacket = false;
|
||||||
|
+
|
||||||
|
+ @Override
|
||||||
|
+ public void read(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion)
|
||||||
|
+ {
|
||||||
|
+ tag = ( protocolVersion >= ProtocolConstants.MINECRAFT_1_13 ) ? MODERNISE.apply( readString( buf ) ) : readString( buf, 20 );
|
||||||
|
+ int maxSize = ( direction == ProtocolConstants.Direction.TO_SERVER ) ? Short.MAX_VALUE : 0x100000;
|
||||||
|
+ Preconditions.checkArgument( buf.readableBytes() <= maxSize, "Payload too large" );
|
||||||
|
+ data = new byte[ buf.readableBytes() ];
|
||||||
|
+ buf.readBytes( data );
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ @Override
|
||||||
|
+ public void write(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion)
|
||||||
|
+ {
|
||||||
|
+ writeString( ( protocolVersion >= ProtocolConstants.MINECRAFT_1_13 ) ? MODERNISE.apply( tag ) : tag, buf );
|
||||||
|
+ buf.writeBytes( data );
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ @Override
|
||||||
|
+ public void handle(AbstractPacketHandler handler) throws Exception
|
||||||
|
+ {
|
||||||
|
+ handler.handle( this );
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ public DataInput getStream()
|
||||||
|
+ {
|
||||||
|
+ return new DataInputStream( new ByteArrayInputStream( data ) );
|
||||||
|
+ }
|
||||||
|
+}
|
||||||
diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/packet/ScoreboardObjective.java b/protocol/src/main/java/net/md_5/bungee/protocol/packet/ScoreboardObjective.java
|
diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/packet/ScoreboardObjective.java b/protocol/src/main/java/net/md_5/bungee/protocol/packet/ScoreboardObjective.java
|
||||||
index 3c7905d5..75b371e9 100644
|
index 3c7905d5..75b371e9 100644
|
||||||
--- a/protocol/src/main/java/net/md_5/bungee/protocol/packet/ScoreboardObjective.java
|
--- a/protocol/src/main/java/net/md_5/bungee/protocol/packet/ScoreboardObjective.java
|
||||||
@ -915,7 +1021,7 @@ index a5555f6a..09dc67f9 100644
|
|||||||
buf.writeByte( mode );
|
buf.writeByte( mode );
|
||||||
if ( mode == 0 || mode == 2 )
|
if ( mode == 0 || mode == 2 )
|
||||||
diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java
|
diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java
|
||||||
index 28032ae4..d1994a52 100644
|
index 15a639de..0b02ae7d 100644
|
||||||
--- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java
|
--- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java
|
||||||
+++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java
|
+++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java
|
||||||
@@ -170,6 +170,14 @@ public class BungeeCord extends ProxyServer
|
@@ -170,6 +170,14 @@ public class BungeeCord extends ProxyServer
|
||||||
@ -1053,7 +1159,7 @@ index 9e74d158..75028024 100644
|
|||||||
throw CancelSendSignal.INSTANCE;
|
throw CancelSendSignal.INSTANCE;
|
||||||
}
|
}
|
||||||
diff --git a/proxy/src/main/java/net/md_5/bungee/UserConnection.java b/proxy/src/main/java/net/md_5/bungee/UserConnection.java
|
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 4a858f31..adc25165 100644
|
index 7c52ee9a..fe73e6e8 100644
|
||||||
--- a/proxy/src/main/java/net/md_5/bungee/UserConnection.java
|
--- a/proxy/src/main/java/net/md_5/bungee/UserConnection.java
|
||||||
+++ b/proxy/src/main/java/net/md_5/bungee/UserConnection.java
|
+++ b/proxy/src/main/java/net/md_5/bungee/UserConnection.java
|
||||||
@@ -193,6 +193,7 @@ public final class UserConnection implements ProxiedPlayer
|
@@ -193,6 +193,7 @@ public final class UserConnection implements ProxiedPlayer
|
||||||
@ -1064,7 +1170,7 @@ index 4a858f31..adc25165 100644
|
|||||||
displayName = name;
|
displayName = name;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -506,7 +507,7 @@ public final class UserConnection implements ProxiedPlayer
|
@@ -507,7 +508,7 @@ public final class UserConnection implements ProxiedPlayer
|
||||||
// transform score components
|
// transform score components
|
||||||
message = ChatComponentTransformer.getInstance().transform( this, true, message );
|
message = ChatComponentTransformer.getInstance().transform( this, true, message );
|
||||||
|
|
||||||
@ -1073,7 +1179,7 @@ index 4a858f31..adc25165 100644
|
|||||||
{
|
{
|
||||||
// Versions older than 1.11 cannot send the Action bar with the new JSON formattings
|
// Versions older than 1.11 cannot send the Action bar with the new JSON formattings
|
||||||
// Fix by converting to a legacy message, see https://bugs.mojang.com/browse/MC-119145
|
// Fix by converting to a legacy message, see https://bugs.mojang.com/browse/MC-119145
|
||||||
@@ -702,6 +703,7 @@ public final class UserConnection implements ProxiedPlayer
|
@@ -703,6 +704,7 @@ public final class UserConnection implements ProxiedPlayer
|
||||||
@Override
|
@Override
|
||||||
public void setTabHeader(BaseComponent header, BaseComponent footer)
|
public void setTabHeader(BaseComponent header, BaseComponent footer)
|
||||||
{
|
{
|
||||||
@ -1081,7 +1187,7 @@ index 4a858f31..adc25165 100644
|
|||||||
header = ChatComponentTransformer.getInstance().transform( this, true, header )[0];
|
header = ChatComponentTransformer.getInstance().transform( this, true, header )[0];
|
||||||
footer = ChatComponentTransformer.getInstance().transform( this, true, footer )[0];
|
footer = ChatComponentTransformer.getInstance().transform( this, true, footer )[0];
|
||||||
|
|
||||||
@@ -714,6 +716,7 @@ public final class UserConnection implements ProxiedPlayer
|
@@ -715,6 +717,7 @@ public final class UserConnection implements ProxiedPlayer
|
||||||
@Override
|
@Override
|
||||||
public void setTabHeader(BaseComponent[] header, BaseComponent[] footer)
|
public void setTabHeader(BaseComponent[] header, BaseComponent[] footer)
|
||||||
{
|
{
|
||||||
@ -1089,7 +1195,7 @@ index 4a858f31..adc25165 100644
|
|||||||
header = ChatComponentTransformer.getInstance().transform( this, true, header );
|
header = ChatComponentTransformer.getInstance().transform( this, true, header );
|
||||||
footer = ChatComponentTransformer.getInstance().transform( this, true, footer );
|
footer = ChatComponentTransformer.getInstance().transform( this, true, footer );
|
||||||
|
|
||||||
@@ -743,6 +746,7 @@ public final class UserConnection implements ProxiedPlayer
|
@@ -744,6 +747,7 @@ public final class UserConnection implements ProxiedPlayer
|
||||||
|
|
||||||
public void setCompressionThreshold(int compressionThreshold)
|
public void setCompressionThreshold(int compressionThreshold)
|
||||||
{
|
{
|
||||||
@ -1097,6 +1203,784 @@ index 4a858f31..adc25165 100644
|
|||||||
if ( !ch.isClosing() && this.compressionThreshold == -1 && compressionThreshold >= 0 )
|
if ( !ch.isClosing() && this.compressionThreshold == -1 && compressionThreshold >= 0 )
|
||||||
{
|
{
|
||||||
this.compressionThreshold = compressionThreshold;
|
this.compressionThreshold = compressionThreshold;
|
||||||
|
diff --git a/proxy/src/main/java/net/md_5/bungee/UserConnection.java.orig b/proxy/src/main/java/net/md_5/bungee/UserConnection.java.orig
|
||||||
|
new file mode 100644
|
||||||
|
index 00000000..7c52ee9a
|
||||||
|
--- /dev/null
|
||||||
|
+++ b/proxy/src/main/java/net/md_5/bungee/UserConnection.java.orig
|
||||||
|
@@ -0,0 +1,772 @@
|
||||||
|
+package net.md_5.bungee;
|
||||||
|
+
|
||||||
|
+import com.google.common.base.Preconditions;
|
||||||
|
+import com.google.common.collect.HashMultimap;
|
||||||
|
+import com.google.common.collect.ImmutableMap;
|
||||||
|
+import com.google.common.collect.Multimap;
|
||||||
|
+import io.netty.bootstrap.Bootstrap;
|
||||||
|
+import io.netty.channel.Channel;
|
||||||
|
+import io.netty.channel.ChannelFuture;
|
||||||
|
+import io.netty.channel.ChannelFutureListener;
|
||||||
|
+import io.netty.channel.ChannelInitializer;
|
||||||
|
+import io.netty.channel.ChannelOption;
|
||||||
|
+import io.netty.util.internal.PlatformDependent;
|
||||||
|
+import java.net.InetSocketAddress;
|
||||||
|
+import java.net.SocketAddress;
|
||||||
|
+import java.util.Collection;
|
||||||
|
+import java.util.Collections;
|
||||||
|
+import java.util.HashSet;
|
||||||
|
+import java.util.LinkedList;
|
||||||
|
+import java.util.Locale;
|
||||||
|
+import java.util.Map;
|
||||||
|
+import java.util.Objects;
|
||||||
|
+import java.util.Queue;
|
||||||
|
+import java.util.UUID;
|
||||||
|
+import java.util.logging.Level;
|
||||||
|
+import lombok.Getter;
|
||||||
|
+import lombok.NonNull;
|
||||||
|
+import lombok.RequiredArgsConstructor;
|
||||||
|
+import lombok.Setter;
|
||||||
|
+import net.md_5.bungee.api.Callback;
|
||||||
|
+import net.md_5.bungee.api.ChatMessageType;
|
||||||
|
+import net.md_5.bungee.api.ProxyServer;
|
||||||
|
+import net.md_5.bungee.api.ServerConnectRequest;
|
||||||
|
+import net.md_5.bungee.api.SkinConfiguration;
|
||||||
|
+import net.md_5.bungee.api.Title;
|
||||||
|
+import net.md_5.bungee.api.chat.BaseComponent;
|
||||||
|
+import net.md_5.bungee.api.chat.TextComponent;
|
||||||
|
+import net.md_5.bungee.api.config.ServerInfo;
|
||||||
|
+import net.md_5.bungee.api.connection.ProxiedPlayer;
|
||||||
|
+import net.md_5.bungee.api.event.PermissionCheckEvent;
|
||||||
|
+import net.md_5.bungee.api.event.ServerConnectEvent;
|
||||||
|
+import net.md_5.bungee.api.score.Scoreboard;
|
||||||
|
+import net.md_5.bungee.chat.ComponentSerializer;
|
||||||
|
+import net.md_5.bungee.connection.InitialHandler;
|
||||||
|
+import net.md_5.bungee.entitymap.EntityMap;
|
||||||
|
+import net.md_5.bungee.forge.ForgeClientHandler;
|
||||||
|
+import net.md_5.bungee.forge.ForgeConstants;
|
||||||
|
+import net.md_5.bungee.forge.ForgeServerHandler;
|
||||||
|
+import net.md_5.bungee.netty.ChannelWrapper;
|
||||||
|
+import net.md_5.bungee.netty.HandlerBoss;
|
||||||
|
+import net.md_5.bungee.netty.PipelineUtils;
|
||||||
|
+import net.md_5.bungee.protocol.DefinedPacket;
|
||||||
|
+import net.md_5.bungee.protocol.MinecraftDecoder;
|
||||||
|
+import net.md_5.bungee.protocol.MinecraftEncoder;
|
||||||
|
+import net.md_5.bungee.protocol.PacketWrapper;
|
||||||
|
+import net.md_5.bungee.protocol.Protocol;
|
||||||
|
+import net.md_5.bungee.protocol.ProtocolConstants;
|
||||||
|
+import net.md_5.bungee.protocol.packet.Chat;
|
||||||
|
+import net.md_5.bungee.protocol.packet.ClientSettings;
|
||||||
|
+import net.md_5.bungee.protocol.packet.Kick;
|
||||||
|
+import net.md_5.bungee.protocol.packet.PlayerListHeaderFooter;
|
||||||
|
+import net.md_5.bungee.protocol.packet.PluginMessage;
|
||||||
|
+import net.md_5.bungee.protocol.packet.SetCompression;
|
||||||
|
+import net.md_5.bungee.tab.ServerUnique;
|
||||||
|
+import net.md_5.bungee.tab.TabList;
|
||||||
|
+import net.md_5.bungee.util.CaseInsensitiveSet;
|
||||||
|
+import net.md_5.bungee.util.ChatComponentTransformer;
|
||||||
|
+
|
||||||
|
+@RequiredArgsConstructor
|
||||||
|
+public final class UserConnection implements ProxiedPlayer
|
||||||
|
+{
|
||||||
|
+
|
||||||
|
+ /*========================================================================*/
|
||||||
|
+ @NonNull
|
||||||
|
+ private final ProxyServer bungee;
|
||||||
|
+ @NonNull
|
||||||
|
+ @Getter
|
||||||
|
+ private final ChannelWrapper ch;
|
||||||
|
+ @Getter
|
||||||
|
+ @NonNull
|
||||||
|
+ private final String name;
|
||||||
|
+ @Getter
|
||||||
|
+ private final InitialHandler pendingConnection;
|
||||||
|
+ /*========================================================================*/
|
||||||
|
+ @Getter
|
||||||
|
+ @Setter
|
||||||
|
+ private ServerConnection server;
|
||||||
|
+ @Getter
|
||||||
|
+ @Setter
|
||||||
|
+ private Object dimension;
|
||||||
|
+ @Getter
|
||||||
|
+ @Setter
|
||||||
|
+ private boolean dimensionChange = true;
|
||||||
|
+ @Getter
|
||||||
|
+ private final Collection<ServerInfo> pendingConnects = new HashSet<>();
|
||||||
|
+ /*========================================================================*/
|
||||||
|
+ @Getter
|
||||||
|
+ @Setter
|
||||||
|
+ private int ping = 100;
|
||||||
|
+ @Getter
|
||||||
|
+ @Setter
|
||||||
|
+ private ServerInfo reconnectServer;
|
||||||
|
+ @Getter
|
||||||
|
+ private TabList tabListHandler;
|
||||||
|
+ @Getter
|
||||||
|
+ @Setter
|
||||||
|
+ private int gamemode;
|
||||||
|
+ @Getter
|
||||||
|
+ private int compressionThreshold = -1;
|
||||||
|
+ // Used for trying multiple servers in order
|
||||||
|
+ @Setter
|
||||||
|
+ private Queue<String> serverJoinQueue;
|
||||||
|
+ /*========================================================================*/
|
||||||
|
+ private final Collection<String> groups = new CaseInsensitiveSet();
|
||||||
|
+ private final Collection<String> permissions = new CaseInsensitiveSet();
|
||||||
|
+ /*========================================================================*/
|
||||||
|
+ @Getter
|
||||||
|
+ @Setter
|
||||||
|
+ private int clientEntityId;
|
||||||
|
+ @Getter
|
||||||
|
+ @Setter
|
||||||
|
+ private int serverEntityId;
|
||||||
|
+ @Getter
|
||||||
|
+ private ClientSettings settings;
|
||||||
|
+ @Getter
|
||||||
|
+ private final Scoreboard serverSentScoreboard = new Scoreboard();
|
||||||
|
+ @Getter
|
||||||
|
+ private final Collection<UUID> sentBossBars = new HashSet<>();
|
||||||
|
+ // Waterfall start
|
||||||
|
+ @Getter
|
||||||
|
+ private final Multimap<Integer, Integer> potions = HashMultimap.create();
|
||||||
|
+ // Waterfall end
|
||||||
|
+ /*========================================================================*/
|
||||||
|
+ @Getter
|
||||||
|
+ private String displayName;
|
||||||
|
+ @Getter
|
||||||
|
+ private EntityMap entityRewrite;
|
||||||
|
+ private Locale locale;
|
||||||
|
+ /*========================================================================*/
|
||||||
|
+ @Getter
|
||||||
|
+ @Setter
|
||||||
|
+ private ForgeClientHandler forgeClientHandler;
|
||||||
|
+ @Getter
|
||||||
|
+ @Setter
|
||||||
|
+ private ForgeServerHandler forgeServerHandler;
|
||||||
|
+ /*========================================================================*/
|
||||||
|
+ private final Unsafe unsafe = new Unsafe()
|
||||||
|
+ {
|
||||||
|
+ @Override
|
||||||
|
+ public void sendPacket(DefinedPacket packet)
|
||||||
|
+ {
|
||||||
|
+ ch.write( packet );
|
||||||
|
+ }
|
||||||
|
+ };
|
||||||
|
+
|
||||||
|
+ public void init()
|
||||||
|
+ {
|
||||||
|
+ this.entityRewrite = EntityMap.getEntityMap( getPendingConnection().getVersion() );
|
||||||
|
+
|
||||||
|
+ this.displayName = name;
|
||||||
|
+
|
||||||
|
+ tabListHandler = new ServerUnique( this );
|
||||||
|
+
|
||||||
|
+ Collection<String> g = bungee.getConfigurationAdapter().getGroups( name );
|
||||||
|
+ g.addAll( bungee.getConfigurationAdapter().getGroups( getUniqueId().toString() ) );
|
||||||
|
+ for ( String s : g )
|
||||||
|
+ {
|
||||||
|
+ addGroups( s );
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ forgeClientHandler = new ForgeClientHandler( this );
|
||||||
|
+
|
||||||
|
+ // No-config FML handshake marker.
|
||||||
|
+ // Set whether the connection has a 1.8 FML marker in the handshake.
|
||||||
|
+ if (this.getPendingConnection().getExtraDataInHandshake().contains( ForgeConstants.FML_HANDSHAKE_TOKEN ))
|
||||||
|
+ {
|
||||||
|
+ forgeClientHandler.setFmlTokenInHandshake( true );
|
||||||
|
+ }
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ public void sendPacket(PacketWrapper packet)
|
||||||
|
+ {
|
||||||
|
+ ch.write( packet );
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ @Deprecated
|
||||||
|
+ public boolean isActive()
|
||||||
|
+ {
|
||||||
|
+ return !ch.isClosed();
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ @Override
|
||||||
|
+ public void setDisplayName(String name)
|
||||||
|
+ {
|
||||||
|
+ Preconditions.checkNotNull( name, "displayName" );
|
||||||
|
+ displayName = name;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ @Override
|
||||||
|
+ public void connect(ServerInfo target)
|
||||||
|
+ {
|
||||||
|
+ connect( target, null, ServerConnectEvent.Reason.PLUGIN );
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ @Override
|
||||||
|
+ public void connect(ServerInfo target, ServerConnectEvent.Reason reason)
|
||||||
|
+ {
|
||||||
|
+ connect( target, null, false, reason );
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ @Override
|
||||||
|
+ public void connect(ServerInfo target, Callback<Boolean> callback)
|
||||||
|
+ {
|
||||||
|
+ connect( target, callback, false, ServerConnectEvent.Reason.PLUGIN );
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ @Override
|
||||||
|
+ public void connect(ServerInfo target, Callback<Boolean> callback, ServerConnectEvent.Reason reason)
|
||||||
|
+ {
|
||||||
|
+ connect( target, callback, false, reason );
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ @Deprecated
|
||||||
|
+ public void connectNow(ServerInfo target)
|
||||||
|
+ {
|
||||||
|
+ connectNow( target, ServerConnectEvent.Reason.UNKNOWN );
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ public void connectNow(ServerInfo target, ServerConnectEvent.Reason reason)
|
||||||
|
+ {
|
||||||
|
+ dimensionChange = true;
|
||||||
|
+ connect( target, reason );
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ public ServerInfo updateAndGetNextServer(ServerInfo currentTarget)
|
||||||
|
+ {
|
||||||
|
+ if ( serverJoinQueue == null )
|
||||||
|
+ {
|
||||||
|
+ serverJoinQueue = new LinkedList<>( getPendingConnection().getListener().getServerPriority() );
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ ServerInfo next = null;
|
||||||
|
+ while ( !serverJoinQueue.isEmpty() )
|
||||||
|
+ {
|
||||||
|
+ ServerInfo candidate = ProxyServer.getInstance().getServerInfo( serverJoinQueue.remove() );
|
||||||
|
+ if ( !Objects.equals( currentTarget, candidate ) )
|
||||||
|
+ {
|
||||||
|
+ next = candidate;
|
||||||
|
+ break;
|
||||||
|
+ }
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ return next;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ public void connect(ServerInfo info, final Callback<Boolean> callback, final boolean retry)
|
||||||
|
+ {
|
||||||
|
+ connect( info, callback, retry, ServerConnectEvent.Reason.PLUGIN );
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ public void connect(ServerInfo info, final Callback<Boolean> callback, final boolean retry, ServerConnectEvent.Reason reason)
|
||||||
|
+ {
|
||||||
|
+ // Waterfall start
|
||||||
|
+ connect(info, callback, retry, reason, bungee.getConfig().getServerConnectTimeout());
|
||||||
|
+ }
|
||||||
|
+ 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) {
|
||||||
|
+ this.connect(info, callback, retry, reason, timeout, true);
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ public void connect(ServerInfo info, final Callback<Boolean> callback, final boolean retry, ServerConnectEvent.Reason reason, final int timeout, boolean sendFeedback)
|
||||||
|
+ {
|
||||||
|
+ // Waterfall end
|
||||||
|
+ Preconditions.checkNotNull( info, "info" );
|
||||||
|
+
|
||||||
|
+ ServerConnectRequest.Builder builder = ServerConnectRequest.builder().retry( retry ).reason( reason ).target( info ).sendFeedback(sendFeedback); // Waterfall - feedback param
|
||||||
|
+ builder.connectTimeout(timeout); // Waterfall
|
||||||
|
+ if ( callback != null )
|
||||||
|
+ {
|
||||||
|
+ // Convert the Callback<Boolean> to be compatible with Callback<Result> from ServerConnectRequest.
|
||||||
|
+ builder.callback( new Callback<ServerConnectRequest.Result>()
|
||||||
|
+ {
|
||||||
|
+ @Override
|
||||||
|
+ public void done(ServerConnectRequest.Result result, Throwable error)
|
||||||
|
+ {
|
||||||
|
+ callback.done( ( result == ServerConnectRequest.Result.SUCCESS ) ? Boolean.TRUE : Boolean.FALSE, error );
|
||||||
|
+ }
|
||||||
|
+ } );
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ connect( builder.build() );
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ @Override
|
||||||
|
+ public void connect(final ServerConnectRequest request)
|
||||||
|
+ {
|
||||||
|
+ Preconditions.checkNotNull( request, "request" );
|
||||||
|
+
|
||||||
|
+ final Callback<ServerConnectRequest.Result> callback = request.getCallback();
|
||||||
|
+ ServerConnectEvent event = new ServerConnectEvent( this, request.getTarget(), request.getReason(), request );
|
||||||
|
+ if ( bungee.getPluginManager().callEvent( event ).isCancelled() )
|
||||||
|
+ {
|
||||||
|
+ if ( callback != null )
|
||||||
|
+ {
|
||||||
|
+ callback.done( ServerConnectRequest.Result.EVENT_CANCEL, null );
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ if ( getServer() == null && !ch.isClosing() )
|
||||||
|
+ {
|
||||||
|
+ throw new IllegalStateException( "Cancelled ServerConnectEvent with no server or disconnect." );
|
||||||
|
+ }
|
||||||
|
+ return;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ final BungeeServerInfo target = (BungeeServerInfo) event.getTarget(); // Update in case the event changed target
|
||||||
|
+
|
||||||
|
+ if ( getServer() != null && Objects.equals( getServer().getInfo(), target ) )
|
||||||
|
+ {
|
||||||
|
+ if ( callback != null )
|
||||||
|
+ {
|
||||||
|
+ callback.done( ServerConnectRequest.Result.ALREADY_CONNECTED, null );
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ if (request.isSendFeedback()) sendMessage( bungee.getTranslation( "already_connected" ) ); // Waterfall
|
||||||
|
+ return;
|
||||||
|
+ }
|
||||||
|
+ if ( pendingConnects.contains( target ) )
|
||||||
|
+ {
|
||||||
|
+ if ( callback != null )
|
||||||
|
+ {
|
||||||
|
+ callback.done( ServerConnectRequest.Result.ALREADY_CONNECTING, null );
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ if (request.isSendFeedback()) sendMessage( bungee.getTranslation( "already_connecting" ) ); // Waterfall
|
||||||
|
+ return;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ pendingConnects.add( target );
|
||||||
|
+
|
||||||
|
+ ChannelInitializer initializer = new ChannelInitializer()
|
||||||
|
+ {
|
||||||
|
+ @Override
|
||||||
|
+ protected void initChannel(Channel ch) throws Exception
|
||||||
|
+ {
|
||||||
|
+ PipelineUtils.BASE.initChannel( ch );
|
||||||
|
+ ch.pipeline().addAfter( PipelineUtils.FRAME_DECODER, PipelineUtils.PACKET_DECODER, new MinecraftDecoder( Protocol.HANDSHAKE, false, getPendingConnection().getVersion() ) );
|
||||||
|
+ ch.pipeline().addAfter( PipelineUtils.FRAME_PREPENDER, PipelineUtils.PACKET_ENCODER, new MinecraftEncoder( Protocol.HANDSHAKE, false, getPendingConnection().getVersion() ) );
|
||||||
|
+ ch.pipeline().get( HandlerBoss.class ).setHandler( new ServerConnector( bungee, UserConnection.this, target ) );
|
||||||
|
+ }
|
||||||
|
+ };
|
||||||
|
+ ChannelFutureListener listener = new ChannelFutureListener()
|
||||||
|
+ {
|
||||||
|
+ @Override
|
||||||
|
+ @SuppressWarnings("ThrowableResultIgnored")
|
||||||
|
+ public void operationComplete(ChannelFuture future) throws Exception
|
||||||
|
+ {
|
||||||
|
+ if ( callback != null )
|
||||||
|
+ {
|
||||||
|
+ callback.done( ( future.isSuccess() ) ? ServerConnectRequest.Result.SUCCESS : ServerConnectRequest.Result.FAIL, future.cause() );
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ if ( !future.isSuccess() )
|
||||||
|
+ {
|
||||||
|
+ future.channel().close();
|
||||||
|
+ pendingConnects.remove( target );
|
||||||
|
+
|
||||||
|
+ ServerInfo def = updateAndGetNextServer( target );
|
||||||
|
+ if ( request.isRetry() && def != null && ( getServer() == null || def != getServer().getInfo() ) )
|
||||||
|
+ {
|
||||||
|
+ if (request.isSendFeedback()) sendMessage( bungee.getTranslation( "fallback_lobby" ) ); // Waterfall
|
||||||
|
+ connect( def, null, true, ServerConnectEvent.Reason.LOBBY_FALLBACK, request.getConnectTimeout(), request.isSendFeedback() ); // Waterfall
|
||||||
|
+ } else if ( dimensionChange )
|
||||||
|
+ {
|
||||||
|
+ disconnect( bungee.getTranslation( "fallback_kick", connectionFailMessage( future.cause() ) ) );
|
||||||
|
+ } else
|
||||||
|
+ {
|
||||||
|
+ if (request.isSendFeedback()) sendMessage( bungee.getTranslation( "fallback_kick", connectionFailMessage( future.cause() ) ) );
|
||||||
|
+ }
|
||||||
|
+ }
|
||||||
|
+ }
|
||||||
|
+ };
|
||||||
|
+ Bootstrap b = new Bootstrap()
|
||||||
|
+ .channel( PipelineUtils.getChannel( target.getAddress() ) )
|
||||||
|
+ .group( ch.getHandle().eventLoop() )
|
||||||
|
+ .handler( initializer )
|
||||||
|
+ .option( ChannelOption.CONNECT_TIMEOUT_MILLIS, request.getConnectTimeout() )
|
||||||
|
+ .remoteAddress( target.getAddress() );
|
||||||
|
+ // Windows is bugged, multi homed users will just have to live with random connecting IPs
|
||||||
|
+ if ( getPendingConnection().getListener().isSetLocalAddress() && !PlatformDependent.isWindows() && getPendingConnection().getListener().getSocketAddress() instanceof InetSocketAddress )
|
||||||
|
+ {
|
||||||
|
+ b.localAddress( getPendingConnection().getListener().getHost().getHostString(), 0 );
|
||||||
|
+ }
|
||||||
|
+ b.connect().addListener( listener );
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ private String connectionFailMessage(Throwable cause)
|
||||||
|
+ {
|
||||||
|
+ bungee.getLogger().log(Level.WARNING, "Error occurred processing connection for " + this.name + " " + Util.exception( cause, false )); // Waterfall
|
||||||
|
+ return ""; // Waterfall
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ @Override
|
||||||
|
+ public void disconnect(String reason)
|
||||||
|
+ {
|
||||||
|
+ disconnect0( TextComponent.fromLegacyText( reason ) );
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ @Override
|
||||||
|
+ public void disconnect(BaseComponent... reason)
|
||||||
|
+ {
|
||||||
|
+ disconnect0( reason );
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ @Override
|
||||||
|
+ public void disconnect(BaseComponent reason)
|
||||||
|
+ {
|
||||||
|
+ disconnect0( reason );
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ public void disconnect0(final BaseComponent... reason)
|
||||||
|
+ {
|
||||||
|
+ if ( !ch.isClosing() )
|
||||||
|
+ {
|
||||||
|
+ bungee.getLogger().log( Level.INFO, "[{0}] disconnected with: {1}", new Object[]
|
||||||
|
+ {
|
||||||
|
+ getName(), BaseComponent.toLegacyText( reason )
|
||||||
|
+ } );
|
||||||
|
+
|
||||||
|
+ ch.close( new Kick( ComponentSerializer.toString( reason ) ) );
|
||||||
|
+
|
||||||
|
+ if ( server != null )
|
||||||
|
+ {
|
||||||
|
+ server.setObsolete( true );
|
||||||
|
+ server.disconnect( "Quitting" );
|
||||||
|
+ }
|
||||||
|
+ }
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ @Override
|
||||||
|
+ public void chat(String message)
|
||||||
|
+ {
|
||||||
|
+ Preconditions.checkState( server != null, "Not connected to server" );
|
||||||
|
+ server.getCh().write( new Chat( message ) );
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ @Override
|
||||||
|
+ public void sendMessage(String message)
|
||||||
|
+ {
|
||||||
|
+ sendMessage( TextComponent.fromLegacyText( message ) );
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ @Override
|
||||||
|
+ public void sendMessages(String... messages)
|
||||||
|
+ {
|
||||||
|
+ for ( String message : messages )
|
||||||
|
+ {
|
||||||
|
+ sendMessage( message );
|
||||||
|
+ }
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ @Override
|
||||||
|
+ public void sendMessage(BaseComponent... message)
|
||||||
|
+ {
|
||||||
|
+ sendMessage( ChatMessageType.SYSTEM, message );
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ @Override
|
||||||
|
+ public void sendMessage(BaseComponent message)
|
||||||
|
+ {
|
||||||
|
+ sendMessage( ChatMessageType.SYSTEM, message );
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ @Override
|
||||||
|
+ public void sendMessage(ChatMessageType position, BaseComponent... message)
|
||||||
|
+ {
|
||||||
|
+ sendMessage( position, null, message );
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ @Override
|
||||||
|
+ public void sendMessage(ChatMessageType position, BaseComponent message)
|
||||||
|
+ {
|
||||||
|
+ sendMessage( position, (UUID) null, message );
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ @Override
|
||||||
|
+ public void sendMessage(UUID sender, BaseComponent... message)
|
||||||
|
+ {
|
||||||
|
+ sendMessage( ChatMessageType.CHAT, sender, message );
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ @Override
|
||||||
|
+ public void sendMessage(UUID sender, BaseComponent message)
|
||||||
|
+ {
|
||||||
|
+ sendMessage( ChatMessageType.CHAT, sender, message );
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ private void sendMessage(ChatMessageType position, UUID sender, String message)
|
||||||
|
+ {
|
||||||
|
+ unsafe().sendPacket( new Chat( message, (byte) position.ordinal(), sender ) );
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ private void sendMessage(ChatMessageType position, UUID sender, BaseComponent... message)
|
||||||
|
+ {
|
||||||
|
+ // transform score components
|
||||||
|
+ message = ChatComponentTransformer.getInstance().transform( this, true, message );
|
||||||
|
+
|
||||||
|
+ if ( position == ChatMessageType.ACTION_BAR && getPendingConnection().getVersion() < ProtocolConstants.MINECRAFT_1_17 )
|
||||||
|
+ {
|
||||||
|
+ // Versions older than 1.11 cannot send the Action bar with the new JSON formattings
|
||||||
|
+ // Fix by converting to a legacy message, see https://bugs.mojang.com/browse/MC-119145
|
||||||
|
+ if ( getPendingConnection().getVersion() <= ProtocolConstants.MINECRAFT_1_10 )
|
||||||
|
+ {
|
||||||
|
+ sendMessage( position, sender, ComponentSerializer.toString( new TextComponent( BaseComponent.toLegacyText( message ) ) ) );
|
||||||
|
+ } else
|
||||||
|
+ {
|
||||||
|
+ net.md_5.bungee.protocol.packet.Title title = new net.md_5.bungee.protocol.packet.Title();
|
||||||
|
+ title.setAction( net.md_5.bungee.protocol.packet.Title.Action.ACTIONBAR );
|
||||||
|
+ title.setText( ComponentSerializer.toString( message ) );
|
||||||
|
+ unsafe.sendPacket( title );
|
||||||
|
+ }
|
||||||
|
+ } else
|
||||||
|
+ {
|
||||||
|
+ sendMessage( position, sender, ComponentSerializer.toString( message ) );
|
||||||
|
+ }
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ @Override
|
||||||
|
+ public void sendData(String channel, byte[] data)
|
||||||
|
+ {
|
||||||
|
+ unsafe().sendPacket( new PluginMessage( channel, data, forgeClientHandler.isForgeUser() ) );
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ @Override
|
||||||
|
+ public InetSocketAddress getAddress()
|
||||||
|
+ {
|
||||||
|
+ return (InetSocketAddress) getSocketAddress();
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ @Override
|
||||||
|
+ public SocketAddress getSocketAddress()
|
||||||
|
+ {
|
||||||
|
+ return ch.getRemoteAddress();
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ @Override
|
||||||
|
+ public Collection<String> getGroups()
|
||||||
|
+ {
|
||||||
|
+ return Collections.unmodifiableCollection( groups );
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ @Override
|
||||||
|
+ public void addGroups(String... groups)
|
||||||
|
+ {
|
||||||
|
+ for ( String group : groups )
|
||||||
|
+ {
|
||||||
|
+ this.groups.add( group );
|
||||||
|
+ for ( String permission : bungee.getConfigurationAdapter().getPermissions( group ) )
|
||||||
|
+ {
|
||||||
|
+ setPermission( permission, true );
|
||||||
|
+ }
|
||||||
|
+ }
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ @Override
|
||||||
|
+ public void removeGroups(String... groups)
|
||||||
|
+ {
|
||||||
|
+ for ( String group : groups )
|
||||||
|
+ {
|
||||||
|
+ this.groups.remove( group );
|
||||||
|
+ for ( String permission : bungee.getConfigurationAdapter().getPermissions( group ) )
|
||||||
|
+ {
|
||||||
|
+ setPermission( permission, false );
|
||||||
|
+ }
|
||||||
|
+ }
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ @Override
|
||||||
|
+ public boolean hasPermission(String permission)
|
||||||
|
+ {
|
||||||
|
+ return bungee.getPluginManager().callEvent( new PermissionCheckEvent( this, permission, permissions.contains( permission ) ) ).hasPermission();
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ @Override
|
||||||
|
+ public void setPermission(String permission, boolean value)
|
||||||
|
+ {
|
||||||
|
+ if ( value )
|
||||||
|
+ {
|
||||||
|
+ permissions.add( permission );
|
||||||
|
+ } else
|
||||||
|
+ {
|
||||||
|
+ permissions.remove( permission );
|
||||||
|
+ }
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ @Override
|
||||||
|
+ public Collection<String> getPermissions()
|
||||||
|
+ {
|
||||||
|
+ return Collections.unmodifiableCollection( permissions );
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ @Override
|
||||||
|
+ public String toString()
|
||||||
|
+ {
|
||||||
|
+ return name;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ @Override
|
||||||
|
+ public Unsafe unsafe()
|
||||||
|
+ {
|
||||||
|
+ return unsafe;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ @Override
|
||||||
|
+ public String getUUID()
|
||||||
|
+ {
|
||||||
|
+ return getPendingConnection().getUUID();
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ @Override
|
||||||
|
+ public UUID getUniqueId()
|
||||||
|
+ {
|
||||||
|
+ return getPendingConnection().getUniqueId();
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ public void setSettings(ClientSettings settings)
|
||||||
|
+ {
|
||||||
|
+ this.settings = settings;
|
||||||
|
+ this.locale = null;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ @Override
|
||||||
|
+ public Locale getLocale()
|
||||||
|
+ {
|
||||||
|
+ return ( locale == null && settings != null ) ? locale = Locale.forLanguageTag( settings.getLocale().replace( '_', '-' ) ) : locale;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ @Override
|
||||||
|
+ public byte getViewDistance()
|
||||||
|
+ {
|
||||||
|
+ return ( settings != null ) ? settings.getViewDistance() : 10;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ @Override
|
||||||
|
+ public ProxiedPlayer.ChatMode getChatMode()
|
||||||
|
+ {
|
||||||
|
+ if ( settings == null )
|
||||||
|
+ {
|
||||||
|
+ return ProxiedPlayer.ChatMode.SHOWN;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ switch ( settings.getChatFlags() )
|
||||||
|
+ {
|
||||||
|
+ default:
|
||||||
|
+ case 0:
|
||||||
|
+ return ProxiedPlayer.ChatMode.SHOWN;
|
||||||
|
+ case 1:
|
||||||
|
+ return ProxiedPlayer.ChatMode.COMMANDS_ONLY;
|
||||||
|
+ case 2:
|
||||||
|
+ return ProxiedPlayer.ChatMode.HIDDEN;
|
||||||
|
+ }
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ @Override
|
||||||
|
+ public boolean hasChatColors()
|
||||||
|
+ {
|
||||||
|
+ return settings == null || settings.isChatColours();
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ @Override
|
||||||
|
+ public SkinConfiguration getSkinParts()
|
||||||
|
+ {
|
||||||
|
+ return ( settings != null ) ? new PlayerSkinConfiguration( settings.getSkinParts() ) : PlayerSkinConfiguration.SKIN_SHOW_ALL;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ @Override
|
||||||
|
+ public ProxiedPlayer.MainHand getMainHand()
|
||||||
|
+ {
|
||||||
|
+ return ( settings == null || settings.getMainHand() == 1 ) ? ProxiedPlayer.MainHand.RIGHT : ProxiedPlayer.MainHand.LEFT;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ @Override
|
||||||
|
+ public boolean isForgeUser()
|
||||||
|
+ {
|
||||||
|
+ return forgeClientHandler.isForgeUser();
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ @Override
|
||||||
|
+ public Map<String, String> getModList()
|
||||||
|
+ {
|
||||||
|
+ if ( forgeClientHandler.getClientModList() == null )
|
||||||
|
+ {
|
||||||
|
+ // Return an empty map, rather than a null, if the client hasn't got any mods,
|
||||||
|
+ // or is yet to complete a handshake.
|
||||||
|
+ return ImmutableMap.of();
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ return ImmutableMap.copyOf( forgeClientHandler.getClientModList() );
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ @Override
|
||||||
|
+ public void setTabHeader(BaseComponent header, BaseComponent footer)
|
||||||
|
+ {
|
||||||
|
+ header = ChatComponentTransformer.getInstance().transform( this, true, header )[0];
|
||||||
|
+ footer = ChatComponentTransformer.getInstance().transform( this, true, footer )[0];
|
||||||
|
+
|
||||||
|
+ unsafe().sendPacket( new PlayerListHeaderFooter(
|
||||||
|
+ ComponentSerializer.toString( header ),
|
||||||
|
+ ComponentSerializer.toString( footer )
|
||||||
|
+ ) );
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ @Override
|
||||||
|
+ public void setTabHeader(BaseComponent[] header, BaseComponent[] footer)
|
||||||
|
+ {
|
||||||
|
+ header = ChatComponentTransformer.getInstance().transform( this, true, header );
|
||||||
|
+ footer = ChatComponentTransformer.getInstance().transform( this, true, footer );
|
||||||
|
+
|
||||||
|
+ unsafe().sendPacket( new PlayerListHeaderFooter(
|
||||||
|
+ ComponentSerializer.toString( header ),
|
||||||
|
+ ComponentSerializer.toString( footer )
|
||||||
|
+ ) );
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ @Override
|
||||||
|
+ public void resetTabHeader()
|
||||||
|
+ {
|
||||||
|
+ // Mojang did not add a way to remove the header / footer completely, we can only set it to empty
|
||||||
|
+ setTabHeader( (BaseComponent) null, null );
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ @Override
|
||||||
|
+ public void sendTitle(Title title)
|
||||||
|
+ {
|
||||||
|
+ title.send( this );
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ public String getExtraDataInHandshake()
|
||||||
|
+ {
|
||||||
|
+ return this.getPendingConnection().getExtraDataInHandshake();
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ public void setCompressionThreshold(int compressionThreshold)
|
||||||
|
+ {
|
||||||
|
+ if ( !ch.isClosing() && this.compressionThreshold == -1 && compressionThreshold >= 0 )
|
||||||
|
+ {
|
||||||
|
+ this.compressionThreshold = compressionThreshold;
|
||||||
|
+ unsafe.sendPacket( new SetCompression( compressionThreshold ) );
|
||||||
|
+ ch.setCompressionThreshold( compressionThreshold );
|
||||||
|
+ }
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ @Override
|
||||||
|
+ public boolean isConnected()
|
||||||
|
+ {
|
||||||
|
+ return !ch.isClosed();
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ @Override
|
||||||
|
+ public Scoreboard getScoreboard()
|
||||||
|
+ {
|
||||||
|
+ return serverSentScoreboard;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ // Waterfall start
|
||||||
|
+ public boolean isDisableEntityMetadataRewrite() {
|
||||||
|
+ return entityRewrite == net.md_5.bungee.entitymap.EntityMap_Dummy.INSTANCE;
|
||||||
|
+ }
|
||||||
|
+ // Waterfall end
|
||||||
|
+}
|
||||||
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
|
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 97c4b210..a0b03ec1 100644
|
index 97c4b210..a0b03ec1 100644
|
||||||
--- a/proxy/src/main/java/net/md_5/bungee/connection/DownstreamBridge.java
|
--- a/proxy/src/main/java/net/md_5/bungee/connection/DownstreamBridge.java
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
From 4487e175bf2121239ffe3d12bb584c51fddb3e09 Mon Sep 17 00:00:00 2001
|
From fe19c98e455af24d9970a73215de3b651545d919 Mon Sep 17 00:00:00 2001
|
||||||
From: foss-mc <69294560+foss-mc@users.noreply.github.com>
|
From: foss-mc <69294560+foss-mc@users.noreply.github.com>
|
||||||
Date: Wed, 16 Dec 2020 18:06:17 +0800
|
Date: Wed, 16 Dec 2020 18:06:17 +0800
|
||||||
Subject: [PATCH] Close connections & Don't flush if not necessary
|
Subject: [PATCH] Close connections & Don't flush if not necessary
|
||||||
@ -121,7 +121,7 @@ index 6dc5633f..5c05f2b9 100644
|
|||||||
}
|
}
|
||||||
|
|
||||||
diff --git a/proxy/src/main/java/net/md_5/bungee/netty/PipelineUtils.java b/proxy/src/main/java/net/md_5/bungee/netty/PipelineUtils.java
|
diff --git a/proxy/src/main/java/net/md_5/bungee/netty/PipelineUtils.java b/proxy/src/main/java/net/md_5/bungee/netty/PipelineUtils.java
|
||||||
index 96704d5e..654203ab 100644
|
index 2a21243b..a95193ba 100644
|
||||||
--- a/proxy/src/main/java/net/md_5/bungee/netty/PipelineUtils.java
|
--- a/proxy/src/main/java/net/md_5/bungee/netty/PipelineUtils.java
|
||||||
+++ b/proxy/src/main/java/net/md_5/bungee/netty/PipelineUtils.java
|
+++ b/proxy/src/main/java/net/md_5/bungee/netty/PipelineUtils.java
|
||||||
@@ -5,6 +5,7 @@ import io.github.waterfallmc.waterfall.event.ConnectionInitEvent;
|
@@ -5,6 +5,7 @@ import io.github.waterfallmc.waterfall.event.ConnectionInitEvent;
|
||||||
@ -132,7 +132,7 @@ index 96704d5e..654203ab 100644
|
|||||||
import io.netty.channel.ChannelInitializer;
|
import io.netty.channel.ChannelInitializer;
|
||||||
import io.netty.channel.ChannelOption;
|
import io.netty.channel.ChannelOption;
|
||||||
import io.netty.channel.EventLoopGroup;
|
import io.netty.channel.EventLoopGroup;
|
||||||
@@ -102,6 +103,14 @@ public class PipelineUtils
|
@@ -98,6 +99,14 @@ public class PipelineUtils
|
||||||
|
|
||||||
BungeeCord.getInstance().getPluginManager().callEvent(connectionInitEvent);
|
BungeeCord.getInstance().getPluginManager().callEvent(connectionInitEvent);
|
||||||
}
|
}
|
||||||
@ -147,7 +147,7 @@ index 96704d5e..654203ab 100644
|
|||||||
};
|
};
|
||||||
public static final Base BASE = new Base();
|
public static final Base BASE = new Base();
|
||||||
private static final KickStringWriter legacyKicker = new KickStringWriter();
|
private static final KickStringWriter legacyKicker = new KickStringWriter();
|
||||||
@@ -196,5 +205,13 @@ public class PipelineUtils
|
@@ -192,5 +201,13 @@ public class PipelineUtils
|
||||||
|
|
||||||
ch.pipeline().addLast( BOSS_HANDLER, new HandlerBoss() );
|
ch.pipeline().addLast( BOSS_HANDLER, new HandlerBoss() );
|
||||||
}
|
}
|
||||||
@ -162,7 +162,7 @@ index 96704d5e..654203ab 100644
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
diff --git a/query/src/main/java/net/md_5/bungee/query/QueryHandler.java b/query/src/main/java/net/md_5/bungee/query/QueryHandler.java
|
diff --git a/query/src/main/java/net/md_5/bungee/query/QueryHandler.java b/query/src/main/java/net/md_5/bungee/query/QueryHandler.java
|
||||||
index 0c1ecfb8..b3bdfd05 100644
|
index b2b19996..b1ecb7ef 100644
|
||||||
--- a/query/src/main/java/net/md_5/bungee/query/QueryHandler.java
|
--- a/query/src/main/java/net/md_5/bungee/query/QueryHandler.java
|
||||||
+++ b/query/src/main/java/net/md_5/bungee/query/QueryHandler.java
|
+++ b/query/src/main/java/net/md_5/bungee/query/QueryHandler.java
|
||||||
@@ -71,6 +71,8 @@ public class QueryHandler extends SimpleChannelInboundHandler<DatagramPacket>
|
@@ -71,6 +71,8 @@ public class QueryHandler extends SimpleChannelInboundHandler<DatagramPacket>
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
From d22662f6826b0cced8e7cd3c4052fb87b502d0d7 Mon Sep 17 00:00:00 2001
|
From a102b1a867083a5fa6873b59eb015dfdddf651fd Mon Sep 17 00:00:00 2001
|
||||||
From: Juan Cruz Linsalata <LinsaFTW@users.noreply.github.com>
|
From: Juan Cruz Linsalata <LinsaFTW@users.noreply.github.com>
|
||||||
Date: Mon, 12 Oct 2020 15:40:53 -0300
|
Date: Mon, 12 Oct 2020 15:40:53 -0300
|
||||||
Subject: [PATCH] FlameCord General Patch
|
Subject: [PATCH] FlameCord General Patch
|
||||||
@ -205,7 +205,7 @@ index 00000000..91d60bfb
|
|||||||
+ }
|
+ }
|
||||||
+}
|
+}
|
||||||
diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java
|
diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java
|
||||||
index 0de754d5..a09d6baf 100644
|
index 0b02ae7d..774439c5 100644
|
||||||
--- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java
|
--- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java
|
||||||
+++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java
|
+++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java
|
||||||
@@ -9,6 +9,8 @@ import com.google.common.collect.Sets;
|
@@ -9,6 +9,8 @@ import com.google.common.collect.Sets;
|
||||||
@ -251,7 +251,7 @@ index 0de754d5..a09d6baf 100644
|
|||||||
if ( config.isForgeSupport() )
|
if ( config.isForgeSupport() )
|
||||||
{
|
{
|
||||||
registerChannel( ForgeConstants.FML_TAG );
|
registerChannel( ForgeConstants.FML_TAG );
|
||||||
@@ -577,9 +589,7 @@ public class BungeeCord extends ProxyServer
|
@@ -574,9 +586,7 @@ public class BungeeCord extends ProxyServer
|
||||||
String translation = "<translation '" + name + "' missing>";
|
String translation = "<translation '" + name + "' missing>";
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
@ -285,7 +285,7 @@ index 2ee16684..3a41769a 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
|
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 935d2e30..e8eb555c 100644
|
index 5cc50806..ff9fd071 100644
|
||||||
--- a/proxy/src/main/java/net/md_5/bungee/UserConnection.java
|
--- a/proxy/src/main/java/net/md_5/bungee/UserConnection.java
|
||||||
+++ b/proxy/src/main/java/net/md_5/bungee/UserConnection.java
|
+++ b/proxy/src/main/java/net/md_5/bungee/UserConnection.java
|
||||||
@@ -35,6 +35,7 @@ import net.md_5.bungee.api.SkinConfiguration;
|
@@ -35,6 +35,7 @@ import net.md_5.bungee.api.SkinConfiguration;
|
||||||
@ -353,7 +353,7 @@ index a409d440..3503c089 100644
|
|||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import net.md_5.bungee.BungeeCord;
|
import net.md_5.bungee.BungeeCord;
|
||||||
diff --git a/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java b/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java
|
diff --git a/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java b/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java
|
||||||
index 33605007..89a6d14a 100644
|
index 675fa8f1..c8748ce5 100644
|
||||||
--- a/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java
|
--- a/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java
|
||||||
+++ b/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java
|
+++ b/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java
|
||||||
@@ -1,6 +1,8 @@
|
@@ -1,6 +1,8 @@
|
||||||
@ -366,7 +366,7 @@ index 33605007..89a6d14a 100644
|
|||||||
import io.netty.channel.ChannelInboundHandlerAdapter;
|
import io.netty.channel.ChannelInboundHandlerAdapter;
|
||||||
import io.netty.handler.codec.CorruptedFrameException;
|
import io.netty.handler.codec.CorruptedFrameException;
|
||||||
diff --git a/proxy/src/main/java/net/md_5/bungee/netty/PipelineUtils.java b/proxy/src/main/java/net/md_5/bungee/netty/PipelineUtils.java
|
diff --git a/proxy/src/main/java/net/md_5/bungee/netty/PipelineUtils.java b/proxy/src/main/java/net/md_5/bungee/netty/PipelineUtils.java
|
||||||
index 654203ab..a840bc70 100644
|
index a95193ba..a4c3bd71 100644
|
||||||
--- a/proxy/src/main/java/net/md_5/bungee/netty/PipelineUtils.java
|
--- a/proxy/src/main/java/net/md_5/bungee/netty/PipelineUtils.java
|
||||||
+++ b/proxy/src/main/java/net/md_5/bungee/netty/PipelineUtils.java
|
+++ b/proxy/src/main/java/net/md_5/bungee/netty/PipelineUtils.java
|
||||||
@@ -1,6 +1,8 @@
|
@@ -1,6 +1,8 @@
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
From c701401d36a6cee1d4ba6a651eaec3148939b62c Mon Sep 17 00:00:00 2001
|
From 27bc5adef578e2afe6d9d13d9bf6c9869d5af691 Mon Sep 17 00:00:00 2001
|
||||||
From: linsaftw <25271111+linsaftw@users.noreply.github.com>
|
From: linsaftw <25271111+linsaftw@users.noreply.github.com>
|
||||||
Date: Sat, 1 May 2021 14:17:48 -0300
|
Date: Sat, 1 May 2021 14:17:48 -0300
|
||||||
Subject: [PATCH] FlameCord module system
|
Subject: [PATCH] FlameCord module system
|
||||||
@ -87,7 +87,7 @@ index 00000000..6c5bb961
|
|||||||
+ }
|
+ }
|
||||||
+}
|
+}
|
||||||
diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java
|
diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java
|
||||||
index a09d6baf..ed5ce6e6 100644
|
index 774439c5..b6ecffc3 100644
|
||||||
--- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java
|
--- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java
|
||||||
+++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java
|
+++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java
|
||||||
@@ -11,6 +11,8 @@ import com.google.gson.Gson;
|
@@ -11,6 +11,8 @@ import com.google.gson.Gson;
|
||||||
@ -134,7 +134,7 @@ index a09d6baf..ed5ce6e6 100644
|
|||||||
|
|
||||||
saveThread.scheduleAtFixedRate( new TimerTask()
|
saveThread.scheduleAtFixedRate( new TimerTask()
|
||||||
{
|
{
|
||||||
@@ -831,4 +842,53 @@ public class BungeeCord extends ProxyServer
|
@@ -828,4 +839,53 @@ public class BungeeCord extends ProxyServer
|
||||||
{
|
{
|
||||||
return new BungeeTitle();
|
return new BungeeTitle();
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
From a2394941af909d50114567bebc428ee13099578d Mon Sep 17 00:00:00 2001
|
From cb76c6ea58a87229b54a1459474f8d622f970262 Mon Sep 17 00:00:00 2001
|
||||||
From: linsaftw <25271111+linsaftw@users.noreply.github.com>
|
From: linsaftw <25271111+linsaftw@users.noreply.github.com>
|
||||||
Date: Sat, 1 May 2021 13:40:39 -0300
|
Date: Sat, 1 May 2021 13:40:39 -0300
|
||||||
Subject: [PATCH] FlameCord message configuration
|
Subject: [PATCH] FlameCord message configuration
|
||||||
@ -200,10 +200,10 @@ index 91d60bfb..cc76325b 100644
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java
|
diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java
|
||||||
index ed5ce6e6..18c53872 100644
|
index b6ecffc3..62cd066d 100644
|
||||||
--- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java
|
--- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java
|
||||||
+++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java
|
+++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java
|
||||||
@@ -597,14 +597,8 @@ public class BungeeCord extends ProxyServer
|
@@ -594,14 +594,8 @@ public class BungeeCord extends ProxyServer
|
||||||
@Override
|
@Override
|
||||||
public String getTranslation(String name, Object... args)
|
public String getTranslation(String name, Object... args)
|
||||||
{
|
{
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
From d520f9c83d7a5a455fd08bfa57f598140f512024 Mon Sep 17 00:00:00 2001
|
From 4604b7da5875a338c84ebe9d8ed00491178890f6 Mon Sep 17 00:00:00 2001
|
||||||
From: LinsaFTW <25271111+linsaftw@users.noreply.github.com>
|
From: LinsaFTW <25271111+linsaftw@users.noreply.github.com>
|
||||||
Date: Thu, 24 Feb 2022 23:41:57 -0300
|
Date: Thu, 24 Feb 2022 23:41:57 -0300
|
||||||
Subject: [PATCH] TCP Fast Open
|
Subject: [PATCH] TCP Fast Open
|
||||||
@ -28,10 +28,10 @@ index 25716fa7..a77cecf0 100644
|
|||||||
this.loggerInitialhandler = setIfUnexistant("logger.initialhandler", this.loggerInitialhandler, configuration);
|
this.loggerInitialhandler = setIfUnexistant("logger.initialhandler", this.loggerInitialhandler, configuration);
|
||||||
this.loggerExceptions = setIfUnexistant("logger.exceptions", this.loggerExceptions, configuration);
|
this.loggerExceptions = setIfUnexistant("logger.exceptions", this.loggerExceptions, configuration);
|
||||||
diff --git a/proxy/src/main/java/net/md_5/bungee/netty/PipelineUtils.java b/proxy/src/main/java/net/md_5/bungee/netty/PipelineUtils.java
|
diff --git a/proxy/src/main/java/net/md_5/bungee/netty/PipelineUtils.java b/proxy/src/main/java/net/md_5/bungee/netty/PipelineUtils.java
|
||||||
index a840bc70..f4bf745c 100644
|
index a4c3bd71..ffea1599 100644
|
||||||
--- a/proxy/src/main/java/net/md_5/bungee/netty/PipelineUtils.java
|
--- a/proxy/src/main/java/net/md_5/bungee/netty/PipelineUtils.java
|
||||||
+++ b/proxy/src/main/java/net/md_5/bungee/netty/PipelineUtils.java
|
+++ b/proxy/src/main/java/net/md_5/bungee/netty/PipelineUtils.java
|
||||||
@@ -198,6 +198,8 @@ public class PipelineUtils
|
@@ -194,6 +194,8 @@ public class PipelineUtils
|
||||||
// IP_TOS is not supported (Windows XP / Windows Server 2003)
|
// IP_TOS is not supported (Windows XP / Windows Server 2003)
|
||||||
}
|
}
|
||||||
ch.config().setOption( ChannelOption.TCP_NODELAY, true );
|
ch.config().setOption( ChannelOption.TCP_NODELAY, true );
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
From f46da0d9a58d8a72acf3e144b6e59d96ca0c3aca Mon Sep 17 00:00:00 2001
|
From f29028455593a9899431f5cb3631cd176c6c958a Mon Sep 17 00:00:00 2001
|
||||||
From: LinsaFTW <25271111+linsaftw@users.noreply.github.com>
|
From: LinsaFTW <25271111+linsaftw@users.noreply.github.com>
|
||||||
Date: Fri, 4 Mar 2022 13:35:53 -0300
|
Date: Fri, 4 Mar 2022 13:35:53 -0300
|
||||||
Subject: [PATCH] Antibot System
|
Subject: [PATCH] Antibot System
|
||||||
@ -1093,7 +1093,7 @@ index e354032a..976c37e1 100644
|
|||||||
if ( !bungee.getPluginManager().callEvent( chatEvent ).isCancelled() )
|
if ( !bungee.getPluginManager().callEvent( chatEvent ).isCancelled() )
|
||||||
{
|
{
|
||||||
diff --git a/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java b/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java
|
diff --git a/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java b/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java
|
||||||
index cef44d8a..8fe2b37f 100644
|
index 20c4c0a4..a2086b45 100644
|
||||||
--- a/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java
|
--- a/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java
|
||||||
+++ b/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java
|
+++ b/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java
|
||||||
@@ -152,6 +152,13 @@ public class HandlerBoss extends ChannelInboundHandlerAdapter
|
@@ -152,6 +152,13 @@ public class HandlerBoss extends ChannelInboundHandlerAdapter
|
||||||
@ -1111,10 +1111,10 @@ index cef44d8a..8fe2b37f 100644
|
|||||||
logExceptions = FlameCord.getInstance().getFlameCordConfiguration().isLoggerExceptions() ? logExceptions : false;
|
logExceptions = FlameCord.getInstance().getFlameCordConfiguration().isLoggerExceptions() ? logExceptions : false;
|
||||||
|
|
||||||
diff --git a/proxy/src/main/java/net/md_5/bungee/netty/PipelineUtils.java b/proxy/src/main/java/net/md_5/bungee/netty/PipelineUtils.java
|
diff --git a/proxy/src/main/java/net/md_5/bungee/netty/PipelineUtils.java b/proxy/src/main/java/net/md_5/bungee/netty/PipelineUtils.java
|
||||||
index f4bf745c..eaedb459 100644
|
index ffea1599..eacc8aae 100644
|
||||||
--- a/proxy/src/main/java/net/md_5/bungee/netty/PipelineUtils.java
|
--- a/proxy/src/main/java/net/md_5/bungee/netty/PipelineUtils.java
|
||||||
+++ b/proxy/src/main/java/net/md_5/bungee/netty/PipelineUtils.java
|
+++ b/proxy/src/main/java/net/md_5/bungee/netty/PipelineUtils.java
|
||||||
@@ -63,6 +63,14 @@ public class PipelineUtils
|
@@ -59,6 +59,14 @@ public class PipelineUtils
|
||||||
{
|
{
|
||||||
SocketAddress remoteAddress = ( ch.remoteAddress() == null ) ? ch.parent().localAddress() : ch.remoteAddress();
|
SocketAddress remoteAddress = ( ch.remoteAddress() == null ) ? ch.parent().localAddress() : ch.remoteAddress();
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
From 05caaeafd1d30cd331e17dd438d21f8d7505890a Mon Sep 17 00:00:00 2001
|
From 6ea893947c44bc8002a84ca44e31dfc636c0bde0 Mon Sep 17 00:00:00 2001
|
||||||
From: LinsaFTW <25271111+linsaftw@users.noreply.github.com>
|
From: LinsaFTW <25271111+linsaftw@users.noreply.github.com>
|
||||||
Date: Thu, 10 Mar 2022 20:23:55 -0300
|
Date: Thu, 10 Mar 2022 20:23:55 -0300
|
||||||
Subject: [PATCH] Disable entity Metadata Rewrite
|
Subject: [PATCH] Disable entity Metadata Rewrite
|
||||||
@ -324,7 +324,7 @@ index 3a41769a..d2bf095a 100644
|
|||||||
// Waterfall end
|
// Waterfall end
|
||||||
user.unsafe().sendPacket( new Respawn( login.getDimension(), login.getWorldName(), login.getSeed(), login.getDifficulty(), login.getGameMode(), login.getPreviousGameMode(), login.getLevelType(), login.isDebug(), login.isFlat(), false ) );
|
user.unsafe().sendPacket( new Respawn( login.getDimension(), login.getWorldName(), login.getSeed(), login.getDifficulty(), login.getGameMode(), login.getPreviousGameMode(), login.getLevelType(), login.isDebug(), login.isFlat(), false ) );
|
||||||
diff --git a/proxy/src/main/java/net/md_5/bungee/UserConnection.java b/proxy/src/main/java/net/md_5/bungee/UserConnection.java
|
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 e8eb555c..723b004a 100644
|
index ff9fd071..c3e9d24b 100644
|
||||||
--- a/proxy/src/main/java/net/md_5/bungee/UserConnection.java
|
--- a/proxy/src/main/java/net/md_5/bungee/UserConnection.java
|
||||||
+++ b/proxy/src/main/java/net/md_5/bungee/UserConnection.java
|
+++ b/proxy/src/main/java/net/md_5/bungee/UserConnection.java
|
||||||
@@ -43,7 +43,6 @@ import net.md_5.bungee.api.event.ServerConnectEvent;
|
@@ -43,7 +43,6 @@ import net.md_5.bungee.api.event.ServerConnectEvent;
|
||||||
@ -353,7 +353,7 @@ index e8eb555c..723b004a 100644
|
|||||||
this.displayName = name;
|
this.displayName = name;
|
||||||
|
|
||||||
tabListHandler = new ServerUnique( this );
|
tabListHandler = new ServerUnique( this );
|
||||||
@@ -771,10 +766,4 @@ public final class UserConnection implements ProxiedPlayer
|
@@ -772,10 +767,4 @@ public final class UserConnection implements ProxiedPlayer
|
||||||
{
|
{
|
||||||
return serverSentScoreboard;
|
return serverSentScoreboard;
|
||||||
}
|
}
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
From d63d977ab6d6bdb5591bc838fc96fae5394298f5 Mon Sep 17 00:00:00 2001
|
From e5ad77a97d771020af50ba542a3d5563a8bac0ad Mon Sep 17 00:00:00 2001
|
||||||
From: xIsm4 <minelatinsoporte@gmail.com>
|
From: xIsm4 <minelatinsoporte@gmail.com>
|
||||||
Date: Mon, 25 Apr 2022 04:25:32 +0200
|
Date: Mon, 25 Apr 2022 04:25:32 +0200
|
||||||
Subject: [PATCH] Dont show extra info in connect errors
|
Subject: [PATCH] Dont show extra info in connect errors
|
||||||
|
|
||||||
|
|
||||||
diff --git a/api/src/main/java/net/md_5/bungee/Util.java b/api/src/main/java/net/md_5/bungee/Util.java
|
diff --git a/api/src/main/java/net/md_5/bungee/Util.java b/api/src/main/java/net/md_5/bungee/Util.java
|
||||||
index 70bf87f7..df5f33d1 100644
|
index 70bf87f7..fdac341b 100644
|
||||||
--- a/api/src/main/java/net/md_5/bungee/Util.java
|
--- a/api/src/main/java/net/md_5/bungee/Util.java
|
||||||
+++ b/api/src/main/java/net/md_5/bungee/Util.java
|
+++ b/api/src/main/java/net/md_5/bungee/Util.java
|
||||||
@@ -92,23 +92,11 @@ public class Util
|
@@ -92,23 +92,11 @@ public class Util
|
||||||
@ -35,7 +35,7 @@ index 70bf87f7..df5f33d1 100644
|
|||||||
|
|
||||||
public static String csv(Iterable<?> objects)
|
public static String csv(Iterable<?> objects)
|
||||||
diff --git a/proxy/src/main/java/net/md_5/bungee/UserConnection.java b/proxy/src/main/java/net/md_5/bungee/UserConnection.java
|
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 723b004a..725896ff 100644
|
index c3e9d24b..725896ff 100644
|
||||||
--- a/proxy/src/main/java/net/md_5/bungee/UserConnection.java
|
--- a/proxy/src/main/java/net/md_5/bungee/UserConnection.java
|
||||||
+++ b/proxy/src/main/java/net/md_5/bungee/UserConnection.java
|
+++ b/proxy/src/main/java/net/md_5/bungee/UserConnection.java
|
||||||
@@ -6,6 +6,7 @@ import com.google.common.collect.ImmutableMap;
|
@@ -6,6 +6,7 @@ import com.google.common.collect.ImmutableMap;
|
||||||
@ -46,11 +46,12 @@ index 723b004a..725896ff 100644
|
|||||||
import io.netty.channel.ChannelFuture;
|
import io.netty.channel.ChannelFuture;
|
||||||
import io.netty.channel.ChannelFutureListener;
|
import io.netty.channel.ChannelFutureListener;
|
||||||
import io.netty.channel.ChannelInitializer;
|
import io.netty.channel.ChannelInitializer;
|
||||||
@@ -399,7 +400,13 @@ public final class UserConnection implements ProxiedPlayer
|
@@ -399,8 +400,13 @@ public final class UserConnection implements ProxiedPlayer
|
||||||
|
|
||||||
private String connectionFailMessage(Throwable cause)
|
private String connectionFailMessage(Throwable cause)
|
||||||
{
|
{
|
||||||
- return Util.exception( cause, false );
|
- bungee.getLogger().log(Level.WARNING, "Error occurred processing connection for " + this.name + " " + Util.exception( cause, false )); // Waterfall
|
||||||
|
- return ""; // Waterfall
|
||||||
+ if ( cause instanceof ConnectTimeoutException )
|
+ if ( cause instanceof ConnectTimeoutException )
|
||||||
+ {
|
+ {
|
||||||
+ return bungee.getTranslation( "timeout" );
|
+ return bungee.getTranslation( "timeout" );
|
||||||
@ -62,5 +63,5 @@ index 723b004a..725896ff 100644
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
--
|
--
|
||||||
2.34.1.windows.1
|
2.32.0
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user