Compare commits

..

6 Commits

Author SHA1 Message Date
ab9955af93 new event TabCompleteRequestEvent and deprecate TabCompleteEvent 2023-03-15 10:42:07 +01:00
fc32fc3f83 Add CommandsDeclareEvent to declare commands with brigadier API 2023-03-15 10:42:04 +01:00
2d987260cd Server branding now includes the backend server name 2023-03-14 23:30:13 +01:00
6ed66d9af8 Multi-session with same Minecraft account with specific permission
Players with permission bungeecord.multiple_connect can have multiple connections with the same Minecraft account.
The UUID and player name is altered to avoid collision with other player:
UUID : xxxxxxxx-xxxx-VIxx-xxxx-xxxxxxxxxxxx
- The UUID version (V above) is now the provided version + 8 (for online player, it is 4, so it becomes C).
- The I digit will follow the index of the duplicated player : first duplicated player is 1, second one is 2.
- The name of the player will be the real player name, followed by the character "." (dot) followed by the duplication index.

Bedrock accounts connected using the Floodgate plugin will not be able to connect multiple times due to the risk of xUID collision.
2023-03-14 23:30:13 +01:00
31461d9d88 Change projet configuration and POM for Pandacube 2023-03-14 23:30:13 +01:00
9e84eb399c Remove modules and startup delay
We don’t need them for Pandacube
2023-03-14 23:30:07 +01:00
33 changed files with 231 additions and 382 deletions

View File

@ -1,27 +0,0 @@
version: 2
updates:
- package-ecosystem: "maven"
directory: "/"
schedule:
interval: "daily"
open-pull-requests-limit: 50
ignore:
# Synchronised with Minecraft
- dependency-name: "com.google.code.gson:gson"
# 9.x has performance issues (see, eg, checkstyle/checkstyle#10934) and 10.x is incompatible
- dependency-name: "com.puppycrawl.tools:checkstyle"
# Newer versions have issues, see #1909 and #2050
- dependency-name: "jline:jline"
# Needs to be synchronised with maven-resolver-provider dependencies
- dependency-name: "org.apache.maven.resolver:maven-resolver-connector-basic"
- dependency-name: "org.apache.maven.resolver:maven-resolver-transport-http"
# Used with maven-resolver dependencies; 2.0 update breaks other providers
- dependency-name: "org.slf4j:slf4j-api"
update-types: ["version-update:semver-major"]
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"
open-pull-requests-limit: 50

View File

@ -4,7 +4,7 @@ on: [push, pull_request]
jobs: jobs:
build: build:
runs-on: ubuntu-22.04 runs-on: ubuntu-20.04
strategy: strategy:
fail-fast: false fail-fast: false

View File

@ -6,12 +6,12 @@
<parent> <parent>
<groupId>fr.pandacube.bungeecord</groupId> <groupId>fr.pandacube.bungeecord</groupId>
<artifactId>bungeecord-parent</artifactId> <artifactId>bungeecord-parent</artifactId>
<version>1.20-R0.1-SNAPSHOT</version> <version>1.19-R0.1-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>
<artifactId>bungeecord-api</artifactId> <artifactId>bungeecord-api</artifactId>
<version>1.20-R0.1-SNAPSHOT</version> <version>1.19-R0.1-SNAPSHOT</version>
<packaging>jar</packaging> <packaging>jar</packaging>
<name>BungeeCord-API</name> <name>BungeeCord-API</name>
@ -45,33 +45,34 @@
<dependency> <dependency>
<groupId>io.netty</groupId> <groupId>io.netty</groupId>
<artifactId>netty-transport-native-unix-common</artifactId> <artifactId>netty-transport-native-unix-common</artifactId>
<version>${netty.version}</version>
<scope>compile</scope> <scope>compile</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.apache.maven</groupId> <groupId>org.apache.maven</groupId>
<artifactId>maven-resolver-provider</artifactId> <artifactId>maven-resolver-provider</artifactId>
<version>3.9.2</version> <version>3.8.5</version>
<!-- not part of the API proper --> <!-- not part of the API proper -->
<scope>provided</scope> <scope>provided</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.apache.maven.resolver</groupId> <groupId>org.apache.maven.resolver</groupId>
<artifactId>maven-resolver-connector-basic</artifactId> <artifactId>maven-resolver-connector-basic</artifactId>
<version>1.9.10</version> <version>1.7.3</version>
<!-- not part of the API proper --> <!-- not part of the API proper -->
<scope>provided</scope> <scope>provided</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.apache.maven.resolver</groupId> <groupId>org.apache.maven.resolver</groupId>
<artifactId>maven-resolver-transport-http</artifactId> <artifactId>maven-resolver-transport-http</artifactId>
<version>1.9.10</version> <version>1.7.3</version>
<!-- not part of the API proper --> <!-- not part of the API proper -->
<scope>provided</scope> <scope>provided</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.yaml</groupId> <groupId>org.yaml</groupId>
<artifactId>snakeyaml</artifactId> <artifactId>snakeyaml</artifactId>
<version>2.0</version> <version>1.33</version>
<scope>compile</scope> <scope>compile</scope>
</dependency> </dependency>
</dependencies> </dependencies>

View File

@ -113,16 +113,6 @@ public class Util
return format( objects, ", " ); return format( objects, ", " );
} }
/**
* Returns a string of objects, each separated by a separator.
*
* @param objects the objects to join
* @param separators the separator
* @return joined string
* @see String#join(java.lang.CharSequence, java.lang.Iterable)
* @deprecated use {@link String} join methods
*/
@Deprecated
public static String format(Iterable<?> objects, String separators) public static String format(Iterable<?> objects, String separators)
{ {
return Joiner.on( separators ).join( objects ); return Joiner.on( separators ).join( objects );

View File

@ -1,10 +1,9 @@
package net.md_5.bungee.api; package net.md_5.bungee.api;
import com.google.common.base.Preconditions;
import com.google.common.io.BaseEncoding; import com.google.common.io.BaseEncoding;
import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapter;
import com.google.gson.internal.bind.TypeAdapters;
import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonReader;
import com.google.gson.stream.JsonToken;
import com.google.gson.stream.JsonWriter; import com.google.gson.stream.JsonWriter;
import java.awt.image.BufferedImage; import java.awt.image.BufferedImage;
import java.io.ByteArrayOutputStream; import java.io.ByteArrayOutputStream;
@ -27,26 +26,13 @@ public class Favicon
@Override @Override
public void write(JsonWriter out, Favicon value) throws IOException public void write(JsonWriter out, Favicon value) throws IOException
{ {
if ( value == null ) TypeAdapters.STRING.write( out, value == null ? null : value.getEncoded() );
{
out.nullValue();
} else
{
out.value( value.getEncoded() );
}
} }
@Override @Override
public Favicon read(JsonReader in) throws IOException public Favicon read(JsonReader in) throws IOException
{ {
JsonToken peek = in.peek(); String enc = TypeAdapters.STRING.read( in );
if ( peek == JsonToken.NULL )
{
in.nextNull();
return null;
}
String enc = in.nextString();
return enc == null ? null : create( enc ); return enc == null ? null : create( enc );
} }
}; };
@ -73,7 +59,6 @@ public class Favicon
*/ */
public static Favicon create(BufferedImage image) public static Favicon create(BufferedImage image)
{ {
Preconditions.checkArgument( image != null, "image is null" );
// check size // check size
if ( image.getWidth() != 64 || image.getHeight() != 64 ) if ( image.getWidth() != 64 || image.getHeight() != 64 )
{ {

View File

@ -6,12 +6,12 @@
<parent> <parent>
<groupId>fr.pandacube.bungeecord</groupId> <groupId>fr.pandacube.bungeecord</groupId>
<artifactId>bungeecord-parent</artifactId> <artifactId>bungeecord-parent</artifactId>
<version>1.20-R0.1-SNAPSHOT</version> <version>1.19-R0.1-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>
<artifactId>bungeecord-bootstrap</artifactId> <artifactId>bungeecord-bootstrap</artifactId>
<version>1.20-R0.1-SNAPSHOT</version> <version>1.19-R0.1-SNAPSHOT</version>
<packaging>jar</packaging> <packaging>jar</packaging>
<name>BungeeCord-Bootstrap</name> <name>BungeeCord-Bootstrap</name>
@ -96,14 +96,5 @@
<maven.compiler.release>7</maven.compiler.release> <maven.compiler.release>7</maven.compiler.release>
</properties> </properties>
</profile> </profile>
<profile>
<id>jdk-20-release</id>
<activation>
<jdk>[20,)</jdk>
</activation>
<properties>
<maven.compiler.release>8</maven.compiler.release>
</properties>
</profile>
</profiles> </profiles>
</project> </project>

View File

@ -6,12 +6,12 @@
<parent> <parent>
<groupId>fr.pandacube.bungeecord</groupId> <groupId>fr.pandacube.bungeecord</groupId>
<artifactId>bungeecord-parent</artifactId> <artifactId>bungeecord-parent</artifactId>
<version>1.20-R0.1-SNAPSHOT</version> <version>1.19-R0.1-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>
<artifactId>bungeecord-chat</artifactId> <artifactId>bungeecord-chat</artifactId>
<version>1.20-R0.1-SNAPSHOT</version> <version>1.19-R0.1-SNAPSHOT</version>
<packaging>jar</packaging> <packaging>jar</packaging>
<name>BungeeCord-Chat</name> <name>BungeeCord-Chat</name>

View File

@ -6,12 +6,12 @@
<parent> <parent>
<groupId>fr.pandacube.bungeecord</groupId> <groupId>fr.pandacube.bungeecord</groupId>
<artifactId>bungeecord-parent</artifactId> <artifactId>bungeecord-parent</artifactId>
<version>1.20-R0.1-SNAPSHOT</version> <version>1.19-R0.1-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>
<artifactId>bungeecord-config</artifactId> <artifactId>bungeecord-config</artifactId>
<version>1.20-R0.1-SNAPSHOT</version> <version>1.19-R0.1-SNAPSHOT</version>
<packaging>jar</packaging> <packaging>jar</packaging>
<name>BungeeCord-Config</name> <name>BungeeCord-Config</name>
@ -28,7 +28,7 @@
<dependency> <dependency>
<groupId>org.yaml</groupId> <groupId>org.yaml</groupId>
<artifactId>snakeyaml</artifactId> <artifactId>snakeyaml</artifactId>
<version>2.0</version> <version>1.33</version>
<scope>compile</scope> <scope>compile</scope>
<optional>true</optional> <optional>true</optional>
</dependency> </dependency>

View File

@ -6,12 +6,12 @@
<parent> <parent>
<groupId>fr.pandacube.bungeecord</groupId> <groupId>fr.pandacube.bungeecord</groupId>
<artifactId>bungeecord-parent</artifactId> <artifactId>bungeecord-parent</artifactId>
<version>1.20-R0.1-SNAPSHOT</version> <version>1.19-R0.1-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>
<artifactId>bungeecord-event</artifactId> <artifactId>bungeecord-event</artifactId>
<version>1.20-R0.1-SNAPSHOT</version> <version>1.19-R0.1-SNAPSHOT</version>
<packaging>jar</packaging> <packaging>jar</packaging>
<name>BungeeCord-Event</name> <name>BungeeCord-Event</name>

View File

@ -6,12 +6,12 @@
<parent> <parent>
<groupId>fr.pandacube.bungeecord</groupId> <groupId>fr.pandacube.bungeecord</groupId>
<artifactId>bungeecord-parent</artifactId> <artifactId>bungeecord-parent</artifactId>
<version>1.20-R0.1-SNAPSHOT</version> <version>1.19-R0.1-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>
<artifactId>bungeecord-log</artifactId> <artifactId>bungeecord-log</artifactId>
<version>1.20-R0.1-SNAPSHOT</version> <version>1.19-R0.1-SNAPSHOT</version>
<packaging>jar</packaging> <packaging>jar</packaging>
<name>BungeeCord-Log</name> <name>BungeeCord-Log</name>

@ -1 +1 @@
Subproject commit 8c89224991adff88d53cd380f42a2baa36f91454 Subproject commit 8df2f8e7b9c7bb9390ac74bb7bace27edca81a2b

View File

@ -6,12 +6,12 @@
<parent> <parent>
<groupId>fr.pandacube.bungeecord</groupId> <groupId>fr.pandacube.bungeecord</groupId>
<artifactId>bungeecord-parent</artifactId> <artifactId>bungeecord-parent</artifactId>
<version>1.20-R0.1-SNAPSHOT</version> <version>1.19-R0.1-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>
<artifactId>bungeecord-native</artifactId> <artifactId>bungeecord-native</artifactId>
<version>1.20-R0.1-SNAPSHOT</version> <version>1.19-R0.1-SNAPSHOT</version>
<packaging>jar</packaging> <packaging>jar</packaging>
<name>BungeeCord-Native</name> <name>BungeeCord-Native</name>
@ -21,6 +21,7 @@
<dependency> <dependency>
<groupId>io.netty</groupId> <groupId>io.netty</groupId>
<artifactId>netty-transport</artifactId> <artifactId>netty-transport</artifactId>
<version>${netty.version}</version>
<scope>compile</scope> <scope>compile</scope>
</dependency> </dependency>
</dependencies> </dependencies>

@ -1 +1 @@
Subproject commit 4e4e4c4fbdad9dd034d8f05e2312bf845f0d4d15 Subproject commit 959b4ea305821e753385e873ec4edfaa9a5d49b7

49
pom.xml
View File

@ -5,7 +5,7 @@
<groupId>fr.pandacube.bungeecord</groupId> <groupId>fr.pandacube.bungeecord</groupId>
<artifactId>bungeecord-parent</artifactId> <artifactId>bungeecord-parent</artifactId>
<version>1.20-R0.1-SNAPSHOT</version> <version>1.19-R0.1-SNAPSHOT</version>
<packaging>pom</packaging> <packaging>pom</packaging>
<name>BungeeCord-Parent</name> <name>BungeeCord-Parent</name>
@ -71,23 +71,13 @@
<properties> <properties>
<build.number>unknown</build.number> <build.number>unknown</build.number>
<lombok.version>1.18.28</lombok.version> <lombok.version>1.18.26</lombok.version>
<netty.version>4.1.85.Final</netty.version>
<maven.compiler.source>1.8</maven.compiler.source> <maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target> <maven.compiler.target>1.8</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties> </properties>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-bom</artifactId>
<version>4.1.93.Final</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies> <dependencies>
<dependency> <dependency>
<groupId>junit</groupId> <groupId>junit</groupId>
@ -141,7 +131,7 @@
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId> <artifactId>maven-checkstyle-plugin</artifactId>
<version>3.3.0</version> <version>3.2.1</version>
<executions> <executions>
<execution> <execution>
<phase>process-classes</phase> <phase>process-classes</phase>
@ -166,7 +156,7 @@
<plugin> <plugin>
<groupId>org.codehaus.mojo</groupId> <groupId>org.codehaus.mojo</groupId>
<artifactId>animal-sniffer-maven-plugin</artifactId> <artifactId>animal-sniffer-maven-plugin</artifactId>
<version>1.23</version> <version>1.22</version>
<executions> <executions>
<execution> <execution>
<phase>process-classes</phase> <phase>process-classes</phase>
@ -183,31 +173,6 @@
</signature> </signature>
</configuration> </configuration>
</plugin> </plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-enforcer-plugin</artifactId>
<version>3.3.0</version>
<executions>
<execution>
<id>enforce</id>
<configuration>
<rules>
<dependencyConvergence>
<excludes>
<!-- org.apache.maven:maven-resolver-provider is inconsistent -->
<exclude>org.apache.commons:commons-lang3</exclude>
<!-- org.apache.maven:maven-resolver-transport-http is inconsistent -->
<exclude>org.apache.httpcomponents:httpcore</exclude>
</excludes>
</dependencyConvergence>
</rules>
</configuration>
<goals>
<goal>enforce</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins> </plugins>
</build> </build>
@ -266,7 +231,7 @@
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId> <artifactId>maven-source-plugin</artifactId>
<version>3.3.0</version> <version>3.2.1</version>
<executions> <executions>
<execution> <execution>
<phase>package</phase> <phase>package</phase>
@ -342,7 +307,7 @@
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId> <artifactId>maven-gpg-plugin</artifactId>
<version>3.1.0</version> <version>3.0.1</version>
<executions> <executions>
<execution> <execution>
<phase>verify</phase> <phase>verify</phase>

View File

@ -6,12 +6,12 @@
<parent> <parent>
<groupId>fr.pandacube.bungeecord</groupId> <groupId>fr.pandacube.bungeecord</groupId>
<artifactId>bungeecord-parent</artifactId> <artifactId>bungeecord-parent</artifactId>
<version>1.20-R0.1-SNAPSHOT</version> <version>1.19-R0.1-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>
<artifactId>bungeecord-protocol</artifactId> <artifactId>bungeecord-protocol</artifactId>
<version>1.20-R0.1-SNAPSHOT</version> <version>1.19-R0.1-SNAPSHOT</version>
<packaging>jar</packaging> <packaging>jar</packaging>
<name>BungeeCord-Protocol</name> <name>BungeeCord-Protocol</name>
@ -48,6 +48,7 @@
<dependency> <dependency>
<groupId>io.netty</groupId> <groupId>io.netty</groupId>
<artifactId>netty-codec</artifactId> <artifactId>netty-codec</artifactId>
<version>${netty.version}</version>
<scope>compile</scope> <scope>compile</scope>
</dependency> </dependency>
<dependency> <dependency>

View File

@ -42,7 +42,6 @@ public class ProtocolConstants
public static final int MINECRAFT_1_19_1 = 760; public static final int MINECRAFT_1_19_1 = 760;
public static final int MINECRAFT_1_19_3 = 761; public static final int MINECRAFT_1_19_3 = 761;
public static final int MINECRAFT_1_19_4 = 762; public static final int MINECRAFT_1_19_4 = 762;
public static final int MINECRAFT_1_20 = 763;
public static final List<String> SUPPORTED_VERSIONS; public static final List<String> SUPPORTED_VERSIONS;
public static final List<Integer> SUPPORTED_VERSION_IDS; public static final List<Integer> SUPPORTED_VERSION_IDS;
@ -60,8 +59,7 @@ public class ProtocolConstants
"1.16.x", "1.16.x",
"1.17.x", "1.17.x",
"1.18.x", "1.18.x",
"1.19.x", "1.19.x"
"1.20.x"
); );
ImmutableList.Builder<Integer> supportedVersionIds = ImmutableList.<Integer>builder().add( ImmutableList.Builder<Integer> supportedVersionIds = ImmutableList.<Integer>builder().add(
ProtocolConstants.MINECRAFT_1_8, ProtocolConstants.MINECRAFT_1_8,
@ -98,14 +96,13 @@ public class ProtocolConstants
ProtocolConstants.MINECRAFT_1_19, ProtocolConstants.MINECRAFT_1_19,
ProtocolConstants.MINECRAFT_1_19_1, ProtocolConstants.MINECRAFT_1_19_1,
ProtocolConstants.MINECRAFT_1_19_3, ProtocolConstants.MINECRAFT_1_19_3,
ProtocolConstants.MINECRAFT_1_19_4, ProtocolConstants.MINECRAFT_1_19_4
ProtocolConstants.MINECRAFT_1_20
); );
if ( SNAPSHOT_SUPPORT ) if ( SNAPSHOT_SUPPORT )
{ {
// supportedVersions.add( "1.20.x" ); // supportedVersions.add( "1.19.x" );
// supportedVersionIds.add( ProtocolConstants.MINECRAFT_1_20 ); // supportedVersionIds.add( ProtocolConstants.MINECRAFT_1_19 );
} }
SUPPORTED_VERSIONS = supportedVersions.build(); SUPPORTED_VERSIONS = supportedVersions.build();

View File

@ -53,7 +53,8 @@ public class Varint21FrameDecoder extends ByteToMessageDecoder
{ {
if ( in.hasMemoryAddress() ) if ( in.hasMemoryAddress() )
{ {
out.add( in.readRetainedSlice( length ) ); out.add( in.slice( in.readerIndex(), length ).retain() );
in.skipBytes( length );
} else } else
{ {
if ( !DIRECT_WARNING ) if ( !DIRECT_WARNING )

View File

@ -1,25 +0,0 @@
package net.md_5.bungee.protocol;
import io.netty.buffer.ByteBuf;
import io.netty.channel.ChannelHandler;
import io.netty.channel.ChannelHandlerContext;
import io.netty.handler.codec.MessageToMessageEncoder;
import java.util.List;
/**
* Prepend length of the message as a Varint21 using an extra buffer for the length, avoiding copying packet data
*/
@ChannelHandler.Sharable
public class Varint21LengthFieldExtraBufPrepender extends MessageToMessageEncoder<ByteBuf>
{
@Override
protected void encode(ChannelHandlerContext ctx, ByteBuf msg, List<Object> out) throws Exception
{
int bodyLen = msg.readableBytes();
ByteBuf lenBuf = ctx.alloc().ioBuffer( Varint21LengthFieldPrepender.varintSize( bodyLen ) );
DefinedPacket.writeVarInt( bodyLen, lenBuf );
out.add( lenBuf );
out.add( msg.retain() );
}
}

View File

@ -5,9 +5,6 @@ import io.netty.channel.ChannelHandler;
import io.netty.channel.ChannelHandlerContext; import io.netty.channel.ChannelHandlerContext;
import io.netty.handler.codec.MessageToByteEncoder; import io.netty.handler.codec.MessageToByteEncoder;
/**
* Prepend length of the message as a Varint21 by writing length and data to a new buffer
*/
@ChannelHandler.Sharable @ChannelHandler.Sharable
public class Varint21LengthFieldPrepender extends MessageToByteEncoder<ByteBuf> public class Varint21LengthFieldPrepender extends MessageToByteEncoder<ByteBuf>
{ {
@ -23,7 +20,7 @@ public class Varint21LengthFieldPrepender extends MessageToByteEncoder<ByteBuf>
out.writeBytes( msg ); out.writeBytes( msg );
} }
static int varintSize(int paramInt) private static int varintSize(int paramInt)
{ {
if ( ( paramInt & 0xFFFFFF80 ) == 0 ) if ( ( paramInt & 0xFFFFFF80 ) == 0 )
{ {

View File

@ -651,167 +651,176 @@ public class Commands extends DefinedPacket
register( "minecraft:item_enchantment", VOID ); register( "minecraft:item_enchantment", VOID );
register( "minecraft:entity_summon", VOID ); register( "minecraft:entity_summon", VOID );
register( "minecraft:dimension", VOID ); register( "minecraft:dimension", VOID );
register( "minecraft:time", VOID ); // 1.14 register( "minecraft:time_legacy", VOID ); // 1.14
register( "minecraft:resource_or_tag", RAW_STRING ); // 1.18.2 register( "minecraft:resource_or_tag", RAW_STRING ); // 1.18.2
register( "minecraft:resource", RAW_STRING ); // 1.18.2 register( "minecraft:resource", RAW_STRING ); // 1.18.2
register( "minecraft:template_mirror", VOID ); // 1.19
register( "minecraft:template_rotation", VOID ); // 1.19
register( "minecraft:uuid", VOID ); // 1.16 register( "minecraft:uuid", VOID ); // 1.16
register( "minecraft:gamemode", VOID ); // 1.19.3
register( "minecraft:resource_or_tag_key", RAW_STRING ); // 1.19.3
register( "minecraft:resource_key", RAW_STRING ); // 1.19.3
register( "minecraft:heightmap", VOID ); // 1.19.4
register( "minecraft:time", INTEGER ); // 1.19.4
register( "minecraft:nbt", VOID ); // 1.13 // removed register( "minecraft:nbt", VOID ); // 1.13 // removed
IDS_1_19 = new ArgumentSerializer[] IDS_1_19 = new ArgumentSerializer[]
{ {
get( "brigadier:bool", VOID ), get( "brigadier:bool" ),
get( "brigadier:float", FLOAT_RANGE ), get( "brigadier:float" ),
get( "brigadier:double", DOUBLE_RANGE ), get( "brigadier:double" ),
get( "brigadier:integer", INTEGER_RANGE ), get( "brigadier:integer" ),
get( "brigadier:long", LONG_RANGE ), get( "brigadier:long" ),
get( "brigadier:string", STRING ), get( "brigadier:string" ),
get( "minecraft:entity", BYTE ), get( "minecraft:entity" ),
get( "minecraft:game_profile", VOID ), get( "minecraft:game_profile" ),
get( "minecraft:block_pos", VOID ), get( "minecraft:block_pos" ),
get( "minecraft:column_pos", VOID ), get( "minecraft:column_pos" ),
get( "minecraft:vec3", VOID ), get( "minecraft:vec3" ),
get( "minecraft:vec2", VOID ), get( "minecraft:vec2" ),
get( "minecraft:block_state", VOID ), get( "minecraft:block_state" ),
get( "minecraft:block_predicate", VOID ), get( "minecraft:block_predicate" ),
get( "minecraft:item_stack", VOID ), get( "minecraft:item_stack" ),
get( "minecraft:item_predicate", VOID ), get( "minecraft:item_predicate" ),
get( "minecraft:color", VOID ), get( "minecraft:color" ),
get( "minecraft:component", VOID ), get( "minecraft:component" ),
get( "minecraft:message", VOID ), get( "minecraft:message" ),
get( "minecraft:nbt_compound_tag", VOID ), get( "minecraft:nbt_compound_tag" ),
get( "minecraft:nbt_tag", VOID ), get( "minecraft:nbt_tag" ),
get( "minecraft:nbt_path", VOID ), get( "minecraft:nbt_path" ),
get( "minecraft:objective", VOID ), get( "minecraft:objective" ),
get( "minecraft:objective_criteria", VOID ), get( "minecraft:objective_criteria" ),
get( "minecraft:operation", VOID ), get( "minecraft:operation" ),
get( "minecraft:particle", VOID ), get( "minecraft:particle" ),
get( "minecraft:angle", VOID ), get( "minecraft:angle" ),
get( "minecraft:rotation", VOID ), get( "minecraft:rotation" ),
get( "minecraft:scoreboard_slot", VOID ), get( "minecraft:scoreboard_slot" ),
get( "minecraft:score_holder", BYTE ), get( "minecraft:score_holder" ),
get( "minecraft:swizzle", VOID ), get( "minecraft:swizzle" ),
get( "minecraft:team", VOID ), get( "minecraft:team" ),
get( "minecraft:item_slot", VOID ), get( "minecraft:item_slot" ),
get( "minecraft:resource_location", VOID ), get( "minecraft:resource_location" ),
get( "minecraft:mob_effect", VOID ), get( "minecraft:mob_effect" ),
get( "minecraft:function", VOID ), get( "minecraft:function" ),
get( "minecraft:entity_anchor", VOID ), get( "minecraft:entity_anchor" ),
get( "minecraft:int_range", VOID ), get( "minecraft:int_range" ),
get( "minecraft:float_range", VOID ), get( "minecraft:float_range" ),
get( "minecraft:item_enchantment", VOID ), get( "minecraft:item_enchantment" ),
get( "minecraft:entity_summon", VOID ), get( "minecraft:entity_summon" ),
get( "minecraft:dimension", VOID ), get( "minecraft:dimension" ),
get( "minecraft:time", VOID ), get( "minecraft:time_legacy" ),
get( "minecraft:resource_or_tag", RAW_STRING ), get( "minecraft:resource_or_tag" ),
get( "minecraft:resource", RAW_STRING ), get( "minecraft:resource" ),
get( "minecraft:template_mirror", VOID ), get( "minecraft:template_mirror" ),
get( "minecraft:template_rotation", VOID ), get( "minecraft:template_rotation" ),
get( "minecraft:uuid", VOID ), get( "minecraft:uuid" )
}; };
IDS_1_19_3 = new ArgumentSerializer[] IDS_1_19_3 = new ArgumentSerializer[]
{ {
get( "brigadier:bool", VOID ), get( "brigadier:bool" ),
get( "brigadier:float", FLOAT_RANGE ), get( "brigadier:float" ),
get( "brigadier:double", DOUBLE_RANGE ), get( "brigadier:double" ),
get( "brigadier:integer", INTEGER_RANGE ), get( "brigadier:integer" ),
get( "brigadier:long", LONG_RANGE ), get( "brigadier:long" ),
get( "brigadier:string", STRING ), get( "brigadier:string" ),
get( "minecraft:entity", BYTE ), get( "minecraft:entity" ),
get( "minecraft:game_profile", VOID ), get( "minecraft:game_profile" ),
get( "minecraft:block_pos", VOID ), get( "minecraft:block_pos" ),
get( "minecraft:column_pos", VOID ), get( "minecraft:column_pos" ),
get( "minecraft:vec3", VOID ), get( "minecraft:vec3" ),
get( "minecraft:vec2", VOID ), get( "minecraft:vec2" ),
get( "minecraft:block_state", VOID ), get( "minecraft:block_state" ),
get( "minecraft:block_predicate", VOID ), get( "minecraft:block_predicate" ),
get( "minecraft:item_stack", VOID ), get( "minecraft:item_stack" ),
get( "minecraft:item_predicate", VOID ), get( "minecraft:item_predicate" ),
get( "minecraft:color", VOID ), get( "minecraft:color" ),
get( "minecraft:component", VOID ), get( "minecraft:component" ),
get( "minecraft:message", VOID ), get( "minecraft:message" ),
get( "minecraft:nbt_compound_tag", VOID ), get( "minecraft:nbt_compound_tag" ),
get( "minecraft:nbt_tag", VOID ), get( "minecraft:nbt_tag" ),
get( "minecraft:nbt_path", VOID ), get( "minecraft:nbt_path" ),
get( "minecraft:objective", VOID ), get( "minecraft:objective" ),
get( "minecraft:objective_criteria", VOID ), get( "minecraft:objective_criteria" ),
get( "minecraft:operation", VOID ), get( "minecraft:operation" ),
get( "minecraft:particle", VOID ), get( "minecraft:particle" ),
get( "minecraft:angle", VOID ), get( "minecraft:angle" ),
get( "minecraft:rotation", VOID ), get( "minecraft:rotation" ),
get( "minecraft:scoreboard_slot", VOID ), get( "minecraft:scoreboard_slot" ),
get( "minecraft:score_holder", BYTE ), get( "minecraft:score_holder" ),
get( "minecraft:swizzle", VOID ), get( "minecraft:swizzle" ),
get( "minecraft:team", VOID ), get( "minecraft:team" ),
get( "minecraft:item_slot", VOID ), get( "minecraft:item_slot" ),
get( "minecraft:resource_location", VOID ), get( "minecraft:resource_location" ),
get( "minecraft:function", VOID ), get( "minecraft:function" ),
get( "minecraft:entity_anchor", VOID ), get( "minecraft:entity_anchor" ),
get( "minecraft:int_range", VOID ), get( "minecraft:int_range" ),
get( "minecraft:float_range", VOID ), get( "minecraft:float_range" ),
get( "minecraft:dimension", VOID ), get( "minecraft:dimension" ),
get( "minecraft:gamemode", VOID ), get( "minecraft:gamemode" ),
get( "minecraft:time", VOID ), get( "minecraft:time_legacy" ),
get( "minecraft:resource_or_tag", RAW_STRING ), get( "minecraft:resource_or_tag" ),
get( "minecraft:resource_or_tag_key", RAW_STRING ), get( "minecraft:resource_or_tag_key" ),
get( "minecraft:resource", RAW_STRING ), get( "minecraft:resource" ),
get( "minecraft:resource_key", RAW_STRING ), get( "minecraft:resource_key" ),
get( "minecraft:template_mirror", VOID ), get( "minecraft:template_mirror" ),
get( "minecraft:template_rotation", VOID ), get( "minecraft:template_rotation" ),
get( "minecraft:uuid", VOID ) get( "minecraft:uuid" )
}; };
IDS_1_19_4 = new ArgumentSerializer[] IDS_1_19_4 = new ArgumentSerializer[]
{ {
get( "brigadier:bool", VOID ), get( "brigadier:bool" ),
get( "brigadier:float", FLOAT_RANGE ), get( "brigadier:float" ),
get( "brigadier:double", DOUBLE_RANGE ), get( "brigadier:double" ),
get( "brigadier:integer", INTEGER_RANGE ), get( "brigadier:integer" ),
get( "brigadier:long", LONG_RANGE ), get( "brigadier:long" ),
get( "brigadier:string", STRING ), get( "brigadier:string" ),
get( "minecraft:entity", BYTE ), get( "minecraft:entity" ),
get( "minecraft:game_profile", VOID ), get( "minecraft:game_profile" ),
get( "minecraft:block_pos", VOID ), get( "minecraft:block_pos" ),
get( "minecraft:column_pos", VOID ), get( "minecraft:column_pos" ),
get( "minecraft:vec3", VOID ), get( "minecraft:vec3" ),
get( "minecraft:vec2", VOID ), get( "minecraft:vec2" ),
get( "minecraft:block_state", VOID ), get( "minecraft:block_state" ),
get( "minecraft:block_predicate", VOID ), get( "minecraft:block_predicate" ),
get( "minecraft:item_stack", VOID ), get( "minecraft:item_stack" ),
get( "minecraft:item_predicate", VOID ), get( "minecraft:item_predicate" ),
get( "minecraft:color", VOID ), get( "minecraft:color" ),
get( "minecraft:component", VOID ), get( "minecraft:component" ),
get( "minecraft:message", VOID ), get( "minecraft:message" ),
get( "minecraft:nbt_compound_tag", VOID ), get( "minecraft:nbt_compound_tag" ),
get( "minecraft:nbt_tag", VOID ), get( "minecraft:nbt_tag" ),
get( "minecraft:nbt_path", VOID ), get( "minecraft:nbt_path" ),
get( "minecraft:objective", VOID ), get( "minecraft:objective" ),
get( "minecraft:objective_criteria", VOID ), get( "minecraft:objective_criteria" ),
get( "minecraft:operation", VOID ), get( "minecraft:operation" ),
get( "minecraft:particle", VOID ), get( "minecraft:particle" ),
get( "minecraft:angle", VOID ), get( "minecraft:angle" ),
get( "minecraft:rotation", VOID ), get( "minecraft:rotation" ),
get( "minecraft:scoreboard_slot", VOID ), get( "minecraft:scoreboard_slot" ),
get( "minecraft:score_holder", BYTE ), get( "minecraft:score_holder" ),
get( "minecraft:swizzle", VOID ), get( "minecraft:swizzle" ),
get( "minecraft:team", VOID ), get( "minecraft:team" ),
get( "minecraft:item_slot", VOID ), get( "minecraft:item_slot" ),
get( "minecraft:resource_location", VOID ), get( "minecraft:resource_location" ),
get( "minecraft:function", VOID ), get( "minecraft:function" ),
get( "minecraft:entity_anchor", VOID ), get( "minecraft:entity_anchor" ),
get( "minecraft:int_range", VOID ), get( "minecraft:int_range" ),
get( "minecraft:float_range", VOID ), get( "minecraft:float_range" ),
get( "minecraft:dimension", VOID ), get( "minecraft:dimension" ),
get( "minecraft:gamemode", VOID ), get( "minecraft:gamemode" ),
get( "minecraft:time", INTEGER ), get( "minecraft:time" ),
get( "minecraft:resource_or_tag", RAW_STRING ), get( "minecraft:resource_or_tag" ),
get( "minecraft:resource_or_tag_key", RAW_STRING ), get( "minecraft:resource_or_tag_key" ),
get( "minecraft:resource", RAW_STRING ), get( "minecraft:resource" ),
get( "minecraft:resource_key", RAW_STRING ), get( "minecraft:resource_key" ),
get( "minecraft:template_mirror", VOID ), get( "minecraft:template_mirror" ),
get( "minecraft:template_rotation", VOID ), get( "minecraft:template_rotation" ),
get( "minecraft:uuid", VOID ), get( "minecraft:uuid" ),
get( "minecraft:heightmap", VOID ) get( "minecraft:heightmap" )
}; };
} }
@ -820,9 +829,9 @@ public class Commands extends DefinedPacket
PROVIDERS.put( name, serializer ); PROVIDERS.put( name, serializer );
} }
private static ArgumentSerializer get(String name, ArgumentSerializer serializer) private static ArgumentSerializer get(String name)
{ {
return serializer; return PROVIDERS.get( name );
} }
/** /**

View File

@ -39,7 +39,6 @@ public class Login extends DefinedPacket
private boolean debug; private boolean debug;
private boolean flat; private boolean flat;
private Location deathLocation; private Location deathLocation;
private int portalCooldown;
@Override @Override
public void read(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion) public void read(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion)
@ -128,10 +127,6 @@ public class Login extends DefinedPacket
deathLocation = new Location( readString( buf ), buf.readLong() ); deathLocation = new Location( readString( buf ), buf.readLong() );
} }
} }
if ( protocolVersion >= ProtocolConstants.MINECRAFT_1_20 )
{
portalCooldown = readVarInt( buf );
}
} }
@Override @Override
@ -225,10 +220,6 @@ public class Login extends DefinedPacket
buf.writeBoolean( false ); buf.writeBoolean( false );
} }
} }
if ( protocolVersion >= ProtocolConstants.MINECRAFT_1_20 )
{
writeVarInt( portalCooldown, buf );
}
} }
@Override @Override

View File

@ -29,7 +29,6 @@ public class Respawn extends DefinedPacket
private boolean flat; private boolean flat;
private boolean copyMeta; private boolean copyMeta;
private Location deathLocation; private Location deathLocation;
private int portalCooldown;
@Override @Override
public void read(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion) public void read(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion)
@ -74,10 +73,6 @@ public class Respawn extends DefinedPacket
deathLocation = new Location( readString( buf ), buf.readLong() ); deathLocation = new Location( readString( buf ), buf.readLong() );
} }
} }
if ( protocolVersion >= ProtocolConstants.MINECRAFT_1_20 )
{
portalCooldown = readVarInt( buf );
}
} }
@Override @Override
@ -128,10 +123,6 @@ public class Respawn extends DefinedPacket
buf.writeBoolean( false ); buf.writeBoolean( false );
} }
} }
if ( protocolVersion >= ProtocolConstants.MINECRAFT_1_20 )
{
writeVarInt( portalCooldown, buf );
}
} }
@Override @Override

View File

@ -6,12 +6,12 @@
<parent> <parent>
<groupId>fr.pandacube.bungeecord</groupId> <groupId>fr.pandacube.bungeecord</groupId>
<artifactId>bungeecord-parent</artifactId> <artifactId>bungeecord-parent</artifactId>
<version>1.20-R0.1-SNAPSHOT</version> <version>1.19-R0.1-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>
<artifactId>bungeecord-proxy</artifactId> <artifactId>bungeecord-proxy</artifactId>
<version>1.20-R0.1-SNAPSHOT</version> <version>1.19-R0.1-SNAPSHOT</version>
<packaging>jar</packaging> <packaging>jar</packaging>
<name>BungeeCord-Proxy</name> <name>BungeeCord-Proxy</name>
@ -26,27 +26,32 @@
<dependency> <dependency>
<groupId>io.netty</groupId> <groupId>io.netty</groupId>
<artifactId>netty-codec-haproxy</artifactId> <artifactId>netty-codec-haproxy</artifactId>
<version>${netty.version}</version>
<scope>compile</scope> <scope>compile</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>io.netty</groupId> <groupId>io.netty</groupId>
<artifactId>netty-codec-http</artifactId> <artifactId>netty-codec-http</artifactId>
<version>${netty.version}</version>
<scope>compile</scope> <scope>compile</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>io.netty</groupId> <groupId>io.netty</groupId>
<artifactId>netty-handler</artifactId> <artifactId>netty-handler</artifactId>
<version>${netty.version}</version>
<scope>compile</scope> <scope>compile</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>io.netty</groupId> <groupId>io.netty</groupId>
<artifactId>netty-transport-native-epoll</artifactId> <artifactId>netty-transport-native-epoll</artifactId>
<version>${netty.version}</version>
<classifier>linux-x86_64</classifier> <classifier>linux-x86_64</classifier>
<scope>compile</scope> <scope>compile</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>io.netty</groupId> <groupId>io.netty</groupId>
<artifactId>netty-transport-native-epoll</artifactId> <artifactId>netty-transport-native-epoll</artifactId>
<version>${netty.version}</version>
<classifier>linux-aarch_64</classifier> <classifier>linux-aarch_64</classifier>
<scope>compile</scope> <scope>compile</scope>
</dependency> </dependency>
@ -95,26 +100,26 @@
<dependency> <dependency>
<groupId>com.mysql</groupId> <groupId>com.mysql</groupId>
<artifactId>mysql-connector-j</artifactId> <artifactId>mysql-connector-j</artifactId>
<version>8.0.33</version> <version>8.0.32</version>
<scope>runtime</scope> <scope>runtime</scope>
</dependency> </dependency>
<!-- add these back in as they are not exposed by the API --> <!-- add these back in as they are not exposed by the API -->
<dependency> <dependency>
<groupId>org.apache.maven</groupId> <groupId>org.apache.maven</groupId>
<artifactId>maven-resolver-provider</artifactId> <artifactId>maven-resolver-provider</artifactId>
<version>3.9.2</version> <version>3.8.5</version>
<scope>runtime</scope> <scope>runtime</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.apache.maven.resolver</groupId> <groupId>org.apache.maven.resolver</groupId>
<artifactId>maven-resolver-connector-basic</artifactId> <artifactId>maven-resolver-connector-basic</artifactId>
<version>1.9.10</version> <version>1.7.3</version>
<scope>runtime</scope> <scope>runtime</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.apache.maven.resolver</groupId> <groupId>org.apache.maven.resolver</groupId>
<artifactId>maven-resolver-transport-http</artifactId> <artifactId>maven-resolver-transport-http</artifactId>
<version>1.9.10</version> <version>1.7.3</version>
<scope>runtime</scope> <scope>runtime</scope>
</dependency> </dependency>
</dependencies> </dependencies>

View File

@ -619,16 +619,12 @@ public class BungeeCord extends ProxyServer
} }
} }
public UserConnection getPlayerByOfflineUUID(UUID uuid) public UserConnection getPlayerByOfflineUUID(UUID name)
{ {
if ( uuid.version() != 3 )
{
return null;
}
connectionLock.readLock().lock(); connectionLock.readLock().lock();
try try
{ {
return connectionsByOfflineUUID.get( uuid ); return connectionsByOfflineUUID.get( name );
} finally } finally
{ {
connectionLock.readLock().unlock(); connectionLock.readLock().unlock();
@ -685,10 +681,10 @@ public class BungeeCord extends ProxyServer
{ {
if ( protocolVersion >= ProtocolConstants.MINECRAFT_1_13 ) if ( protocolVersion >= ProtocolConstants.MINECRAFT_1_13 )
{ {
return new PluginMessage( "minecraft:register", String.join( "\00", Iterables.transform( pluginChannels, PluginMessage.MODERNISE ) ).getBytes( Charsets.UTF_8 ), false ); return new PluginMessage( "minecraft:register", Util.format( Iterables.transform( pluginChannels, PluginMessage.MODERNISE ), "\00" ).getBytes( Charsets.UTF_8 ), false );
} }
return new PluginMessage( "REGISTER", String.join( "\00", pluginChannels ).getBytes( Charsets.UTF_8 ), false ); return new PluginMessage( "REGISTER", Util.format( pluginChannels, "\00" ).getBytes( Charsets.UTF_8 ), false );
} }
@Override @Override
@ -749,17 +745,12 @@ public class BungeeCord extends ProxyServer
public void addConnection(UserConnection con) public void addConnection(UserConnection con)
{ {
UUID offlineId = con.getPendingConnection().getOfflineId();
if ( offlineId != null && offlineId.version() != 3 )
{
throw new IllegalArgumentException( "Offline UUID must be a name-based UUID" );
}
connectionLock.writeLock().lock(); connectionLock.writeLock().lock();
try try
{ {
connections.put( con.getName(), con ); connections.put( con.getName(), con );
connectionsByUUID.put( con.getUniqueId(), con ); connectionsByUUID.put( con.getUniqueId(), con );
connectionsByOfflineUUID.put( offlineId, con ); connectionsByOfflineUUID.put( con.getPendingConnection().getOfflineId(), con );
} finally } finally
{ {
connectionLock.writeLock().unlock(); connectionLock.writeLock().unlock();

View File

@ -182,7 +182,7 @@ public class BungeeServerInfo implements ServerInfo
new Bootstrap() new Bootstrap()
.channel( PipelineUtils.getChannel( socketAddress ) ) .channel( PipelineUtils.getChannel( socketAddress ) )
.group( BungeeCord.getInstance().eventLoops ) .group( BungeeCord.getInstance().eventLoops )
.handler( PipelineUtils.BASE_SERVERSIDE ) .handler( PipelineUtils.BASE )
.option( ChannelOption.CONNECT_TIMEOUT_MILLIS, BungeeCord.getInstance().getConfig().getRemotePingTimeout() ) .option( ChannelOption.CONNECT_TIMEOUT_MILLIS, BungeeCord.getInstance().getConfig().getRemotePingTimeout() )
.remoteAddress( socketAddress ) .remoteAddress( socketAddress )
.connect() .connect()

View File

@ -225,8 +225,7 @@ public class ServerConnector extends PacketHandler
// Set tab list size, TODO: what shall we do about packet mutability // Set tab list size, TODO: what shall we do about packet mutability
Login modLogin = new Login( login.getEntityId(), login.isHardcore(), login.getGameMode(), login.getPreviousGameMode(), login.getWorldNames(), login.getDimensions(), login.getDimension(), login.getWorldName(), login.getSeed(), login.getDifficulty(), Login modLogin = new Login( login.getEntityId(), login.isHardcore(), login.getGameMode(), login.getPreviousGameMode(), login.getWorldNames(), login.getDimensions(), login.getDimension(), login.getWorldName(), login.getSeed(), login.getDifficulty(),
(byte) user.getPendingConnection().getListener().getTabListSize(), login.getLevelType(), login.getViewDistance(), login.getSimulationDistance(), login.isReducedDebugInfo(), login.isNormalRespawn(), login.isDebug(), login.isFlat(), login.getDeathLocation(), (byte) user.getPendingConnection().getListener().getTabListSize(), login.getLevelType(), login.getViewDistance(), login.getSimulationDistance(), login.isReducedDebugInfo(), login.isNormalRespawn(), login.isDebug(), login.isFlat(), login.getDeathLocation() );
login.getPortalCooldown() );
user.unsafe().sendPacket( modLogin ); user.unsafe().sendPacket( modLogin );
@ -244,8 +243,7 @@ public class ServerConnector extends PacketHandler
} }
user.getSentBossBars().clear(); user.getSentBossBars().clear();
user.unsafe().sendPacket( new Respawn( login.getDimension(), login.getWorldName(), login.getSeed(), login.getDifficulty(), login.getGameMode(), login.getPreviousGameMode(), login.getLevelType(), login.isDebug(), login.isFlat(), false, login.getDeathLocation(), user.unsafe().sendPacket( new Respawn( login.getDimension(), login.getWorldName(), login.getSeed(), login.getDifficulty(), login.getGameMode(), login.getPreviousGameMode(), login.getLevelType(), login.isDebug(), login.isFlat(), false, login.getDeathLocation() ) );
login.getPortalCooldown() ) );
user.getServer().disconnect( "Quitting" ); user.getServer().disconnect( "Quitting" );
} else } else
{ {
@ -294,13 +292,11 @@ public class ServerConnector extends PacketHandler
user.setDimensionChange( true ); user.setDimensionChange( true );
if ( login.getDimension() == user.getDimension() ) if ( login.getDimension() == user.getDimension() )
{ {
user.unsafe().sendPacket( new Respawn( (Integer) login.getDimension() >= 0 ? -1 : 0, login.getWorldName(), login.getSeed(), login.getDifficulty(), login.getGameMode(), login.getPreviousGameMode(), login.getLevelType(), login.isDebug(), login.isFlat(), user.unsafe().sendPacket( new Respawn( (Integer) login.getDimension() >= 0 ? -1 : 0, login.getWorldName(), login.getSeed(), login.getDifficulty(), login.getGameMode(), login.getPreviousGameMode(), login.getLevelType(), login.isDebug(), login.isFlat(), false, login.getDeathLocation() ) );
false, login.getDeathLocation(), login.getPortalCooldown() ) );
} }
user.setServerEntityId( login.getEntityId() ); user.setServerEntityId( login.getEntityId() );
user.unsafe().sendPacket( new Respawn( login.getDimension(), login.getWorldName(), login.getSeed(), login.getDifficulty(), login.getGameMode(), login.getPreviousGameMode(), login.getLevelType(), login.isDebug(), login.isFlat(), user.unsafe().sendPacket( new Respawn( login.getDimension(), login.getWorldName(), login.getSeed(), login.getDifficulty(), login.getGameMode(), login.getPreviousGameMode(), login.getLevelType(), login.isDebug(), login.isFlat(), false, login.getDeathLocation() ) );
false, login.getDeathLocation(), login.getPortalCooldown() ) );
if ( user.getPendingConnection().getVersion() >= ProtocolConstants.MINECRAFT_1_14 ) if ( user.getPendingConnection().getVersion() >= ProtocolConstants.MINECRAFT_1_14 )
{ {
user.unsafe().sendPacket( new ViewDistance( login.getViewDistance() ) ); user.unsafe().sendPacket( new ViewDistance( login.getViewDistance() ) );

View File

@ -320,7 +320,7 @@ public final class UserConnection implements ProxiedPlayer
@Override @Override
protected void initChannel(Channel ch) throws Exception protected void initChannel(Channel ch) throws Exception
{ {
PipelineUtils.BASE_SERVERSIDE.initChannel( ch ); 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_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().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 ) ); ch.pipeline().get( HandlerBoss.class ).setHandler( new ServerConnector( bungee, UserConnection.this, target ) );

View File

@ -80,7 +80,6 @@ public abstract class EntityMap
case ProtocolConstants.MINECRAFT_1_19_3: case ProtocolConstants.MINECRAFT_1_19_3:
return EntityMap_1_16_2.INSTANCE_1_19_1; return EntityMap_1_16_2.INSTANCE_1_19_1;
case ProtocolConstants.MINECRAFT_1_19_4: case ProtocolConstants.MINECRAFT_1_19_4:
case ProtocolConstants.MINECRAFT_1_20:
return EntityMap_1_16_2.INSTANCE_1_19_4; return EntityMap_1_16_2.INSTANCE_1_19_4;
} }
throw new RuntimeException( "Version " + version + " has no entity map" ); throw new RuntimeException( "Version " + version + " has no entity map" );

View File

@ -30,8 +30,6 @@ import java.net.SocketAddress;
import java.util.concurrent.ThreadFactory; import java.util.concurrent.ThreadFactory;
import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeUnit;
import java.util.logging.Level; import java.util.logging.Level;
import lombok.AllArgsConstructor;
import lombok.NoArgsConstructor;
import net.md_5.bungee.BungeeCord; import net.md_5.bungee.BungeeCord;
import net.md_5.bungee.Util; import net.md_5.bungee.Util;
import net.md_5.bungee.api.ProxyServer; import net.md_5.bungee.api.ProxyServer;
@ -44,7 +42,6 @@ import net.md_5.bungee.protocol.MinecraftDecoder;
import net.md_5.bungee.protocol.MinecraftEncoder; import net.md_5.bungee.protocol.MinecraftEncoder;
import net.md_5.bungee.protocol.Protocol; import net.md_5.bungee.protocol.Protocol;
import net.md_5.bungee.protocol.Varint21FrameDecoder; import net.md_5.bungee.protocol.Varint21FrameDecoder;
import net.md_5.bungee.protocol.Varint21LengthFieldExtraBufPrepender;
import net.md_5.bungee.protocol.Varint21LengthFieldPrepender; import net.md_5.bungee.protocol.Varint21LengthFieldPrepender;
public class PipelineUtils public class PipelineUtils
@ -85,11 +82,9 @@ public class PipelineUtils
} }
} }
}; };
public static final Base BASE = new Base( false ); public static final Base BASE = new Base();
public static final Base BASE_SERVERSIDE = new Base( true );
private static final KickStringWriter legacyKicker = new KickStringWriter(); private static final KickStringWriter legacyKicker = new KickStringWriter();
private static final Varint21LengthFieldPrepender framePrepender = new Varint21LengthFieldPrepender(); private static final Varint21LengthFieldPrepender framePrepender = new Varint21LengthFieldPrepender();
private static final Varint21LengthFieldExtraBufPrepender serverFramePrepender = new Varint21LengthFieldExtraBufPrepender();
public static final String TIMEOUT_HANDLER = "timeout"; public static final String TIMEOUT_HANDLER = "timeout";
public static final String PACKET_DECODER = "packet-decoder"; public static final String PACKET_DECODER = "packet-decoder";
public static final String PACKET_ENCODER = "packet-encoder"; public static final String PACKET_ENCODER = "packet-encoder";
@ -157,13 +152,9 @@ public class PipelineUtils
private static final int HIGH_MARK = Integer.getInteger( "net.md_5.bungee.high_mark", 2 << 20 ); // 2 mb private static final int HIGH_MARK = Integer.getInteger( "net.md_5.bungee.high_mark", 2 << 20 ); // 2 mb
private static final WriteBufferWaterMark MARK = new WriteBufferWaterMark( LOW_MARK, HIGH_MARK ); private static final WriteBufferWaterMark MARK = new WriteBufferWaterMark( LOW_MARK, HIGH_MARK );
@NoArgsConstructor // for backwards compatibility
@AllArgsConstructor
public static final class Base extends ChannelInitializer<Channel> public static final class Base extends ChannelInitializer<Channel>
{ {
private boolean toServer = false;
@Override @Override
public void initChannel(Channel ch) throws Exception public void initChannel(Channel ch) throws Exception
{ {
@ -179,9 +170,7 @@ public class PipelineUtils
ch.pipeline().addLast( FRAME_DECODER, new Varint21FrameDecoder() ); ch.pipeline().addLast( FRAME_DECODER, new Varint21FrameDecoder() );
ch.pipeline().addLast( TIMEOUT_HANDLER, new ReadTimeoutHandler( BungeeCord.getInstance().config.getTimeout(), TimeUnit.MILLISECONDS ) ); ch.pipeline().addLast( TIMEOUT_HANDLER, new ReadTimeoutHandler( BungeeCord.getInstance().config.getTimeout(), TimeUnit.MILLISECONDS ) );
// No encryption bungee -> server, therefore use extra buffer to avoid copying everything for length prepending ch.pipeline().addLast( FRAME_PREPENDER, framePrepender );
// Not used bungee -> client as header would need to be encrypted separately through expensive JNI call
ch.pipeline().addLast( FRAME_PREPENDER, ( toServer ) ? serverFramePrepender : framePrepender );
ch.pipeline().addLast( BOSS_HANDLER, new HandlerBoss() ); ch.pipeline().addLast( BOSS_HANDLER, new HandlerBoss() );
} }

View File

@ -6,12 +6,12 @@
<parent> <parent>
<groupId>fr.pandacube.bungeecord</groupId> <groupId>fr.pandacube.bungeecord</groupId>
<artifactId>bungeecord-parent</artifactId> <artifactId>bungeecord-parent</artifactId>
<version>1.20-R0.1-SNAPSHOT</version> <version>1.19-R0.1-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>
<artifactId>bungeecord-query</artifactId> <artifactId>bungeecord-query</artifactId>
<version>1.20-R0.1-SNAPSHOT</version> <version>1.19-R0.1-SNAPSHOT</version>
<packaging>jar</packaging> <packaging>jar</packaging>
<name>BungeeCord-Query</name> <name>BungeeCord-Query</name>
@ -21,6 +21,7 @@
<dependency> <dependency>
<groupId>io.netty</groupId> <groupId>io.netty</groupId>
<artifactId>netty-transport</artifactId> <artifactId>netty-transport</artifactId>
<version>${netty.version}</version>
<scope>compile</scope> <scope>compile</scope>
</dependency> </dependency>
<dependency> <dependency>

View File

@ -6,12 +6,12 @@
<parent> <parent>
<groupId>fr.pandacube.bungeecord</groupId> <groupId>fr.pandacube.bungeecord</groupId>
<artifactId>bungeecord-parent</artifactId> <artifactId>bungeecord-parent</artifactId>
<version>1.20-R0.1-SNAPSHOT</version> <version>1.19-R0.1-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>
<artifactId>bungeecord-slf4j</artifactId> <artifactId>bungeecord-slf4j</artifactId>
<version>1.20-R0.1-SNAPSHOT</version> <version>1.19-R0.1-SNAPSHOT</version>
<packaging>jar</packaging> <packaging>jar</packaging>
<name>BungeeCord-SLF4J</name> <name>BungeeCord-SLF4J</name>
@ -27,7 +27,7 @@
<dependency> <dependency>
<groupId>org.slf4j</groupId> <groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId> <artifactId>slf4j-api</artifactId>
<version>1.7.36</version> <version>1.7.32</version>
<scope>compile</scope> <scope>compile</scope>
</dependency> </dependency>
</dependencies> </dependencies>