Compare commits
34 Commits
ab9955af93
...
0106df2fba
Author | SHA1 | Date | |
---|---|---|---|
0106df2fba | |||
a12f99d4b7 | |||
b50cfdd435 | |||
20d6422042 | |||
2367e2240a | |||
8227f8c052 | |||
|
68200133b6 | ||
|
188d502c59 | ||
|
84ac683c1d | ||
|
b418c94215 | ||
|
38e593a698 | ||
|
38028e8e90 | ||
|
3db27052a1 | ||
|
e24f9223df | ||
|
9e5ed82c99 | ||
|
606fa278c4 | ||
|
7dd549ff1e | ||
|
3c12b04c98 | ||
|
5545850f9d | ||
|
2f909b44d7 | ||
|
ff155ebbb4 | ||
|
a0a4fa0e56 | ||
|
1b76a26691 | ||
|
bd7bd2739a | ||
|
a7ad407f4b | ||
|
931ff0fde6 | ||
|
dfd847f705 | ||
|
a1fee720b9 | ||
|
963854f8d5 | ||
|
2ef5e7004b | ||
|
2e6f0dd442 | ||
|
7790783949 | ||
|
f4534c8273 | ||
|
76673f02a4 |
27
.github/dependabot.yml
vendored
Normal file
27
.github/dependabot.yml
vendored
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
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
|
2
.github/workflows/maven.yml
vendored
2
.github/workflows/maven.yml
vendored
@ -4,7 +4,7 @@ on: [push, pull_request]
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
runs-on: ubuntu-20.04
|
runs-on: ubuntu-22.04
|
||||||
|
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
|
13
api/pom.xml
13
api/pom.xml
@ -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.19-R0.1-SNAPSHOT</version>
|
<version>1.20-R0.1-SNAPSHOT</version>
|
||||||
<relativePath>../pom.xml</relativePath>
|
<relativePath>../pom.xml</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<artifactId>bungeecord-api</artifactId>
|
<artifactId>bungeecord-api</artifactId>
|
||||||
<version>1.19-R0.1-SNAPSHOT</version>
|
<version>1.20-R0.1-SNAPSHOT</version>
|
||||||
<packaging>jar</packaging>
|
<packaging>jar</packaging>
|
||||||
|
|
||||||
<name>BungeeCord-API</name>
|
<name>BungeeCord-API</name>
|
||||||
@ -45,34 +45,33 @@
|
|||||||
<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.8.5</version>
|
<version>3.9.2</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.7.3</version>
|
<version>1.9.10</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.7.3</version>
|
<version>1.9.10</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>1.33</version>
|
<version>2.0</version>
|
||||||
<scope>compile</scope>
|
<scope>compile</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
@ -113,6 +113,16 @@ 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 );
|
||||||
|
@ -1,9 +1,10 @@
|
|||||||
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;
|
||||||
@ -26,13 +27,26 @@ public class Favicon
|
|||||||
@Override
|
@Override
|
||||||
public void write(JsonWriter out, Favicon value) throws IOException
|
public void write(JsonWriter out, Favicon value) throws IOException
|
||||||
{
|
{
|
||||||
TypeAdapters.STRING.write( out, value == null ? null : value.getEncoded() );
|
if ( value == null )
|
||||||
|
{
|
||||||
|
out.nullValue();
|
||||||
|
} else
|
||||||
|
{
|
||||||
|
out.value( value.getEncoded() );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Favicon read(JsonReader in) throws IOException
|
public Favicon read(JsonReader in) throws IOException
|
||||||
{
|
{
|
||||||
String enc = TypeAdapters.STRING.read( in );
|
JsonToken peek = in.peek();
|
||||||
|
if ( peek == JsonToken.NULL )
|
||||||
|
{
|
||||||
|
in.nextNull();
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
String enc = in.nextString();
|
||||||
return enc == null ? null : create( enc );
|
return enc == null ? null : create( enc );
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@ -59,6 +73,7 @@ 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 )
|
||||||
{
|
{
|
||||||
|
@ -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.19-R0.1-SNAPSHOT</version>
|
<version>1.20-R0.1-SNAPSHOT</version>
|
||||||
<relativePath>../pom.xml</relativePath>
|
<relativePath>../pom.xml</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<artifactId>bungeecord-bootstrap</artifactId>
|
<artifactId>bungeecord-bootstrap</artifactId>
|
||||||
<version>1.19-R0.1-SNAPSHOT</version>
|
<version>1.20-R0.1-SNAPSHOT</version>
|
||||||
<packaging>jar</packaging>
|
<packaging>jar</packaging>
|
||||||
|
|
||||||
<name>BungeeCord-Bootstrap</name>
|
<name>BungeeCord-Bootstrap</name>
|
||||||
@ -96,5 +96,14 @@
|
|||||||
<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>
|
||||||
|
@ -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.19-R0.1-SNAPSHOT</version>
|
<version>1.20-R0.1-SNAPSHOT</version>
|
||||||
<relativePath>../pom.xml</relativePath>
|
<relativePath>../pom.xml</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<artifactId>bungeecord-chat</artifactId>
|
<artifactId>bungeecord-chat</artifactId>
|
||||||
<version>1.19-R0.1-SNAPSHOT</version>
|
<version>1.20-R0.1-SNAPSHOT</version>
|
||||||
<packaging>jar</packaging>
|
<packaging>jar</packaging>
|
||||||
|
|
||||||
<name>BungeeCord-Chat</name>
|
<name>BungeeCord-Chat</name>
|
||||||
|
@ -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.19-R0.1-SNAPSHOT</version>
|
<version>1.20-R0.1-SNAPSHOT</version>
|
||||||
<relativePath>../pom.xml</relativePath>
|
<relativePath>../pom.xml</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<artifactId>bungeecord-config</artifactId>
|
<artifactId>bungeecord-config</artifactId>
|
||||||
<version>1.19-R0.1-SNAPSHOT</version>
|
<version>1.20-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>1.33</version>
|
<version>2.0</version>
|
||||||
<scope>compile</scope>
|
<scope>compile</scope>
|
||||||
<optional>true</optional>
|
<optional>true</optional>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
@ -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.19-R0.1-SNAPSHOT</version>
|
<version>1.20-R0.1-SNAPSHOT</version>
|
||||||
<relativePath>../pom.xml</relativePath>
|
<relativePath>../pom.xml</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<artifactId>bungeecord-event</artifactId>
|
<artifactId>bungeecord-event</artifactId>
|
||||||
<version>1.19-R0.1-SNAPSHOT</version>
|
<version>1.20-R0.1-SNAPSHOT</version>
|
||||||
<packaging>jar</packaging>
|
<packaging>jar</packaging>
|
||||||
|
|
||||||
<name>BungeeCord-Event</name>
|
<name>BungeeCord-Event</name>
|
||||||
|
@ -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.19-R0.1-SNAPSHOT</version>
|
<version>1.20-R0.1-SNAPSHOT</version>
|
||||||
<relativePath>../pom.xml</relativePath>
|
<relativePath>../pom.xml</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<artifactId>bungeecord-log</artifactId>
|
<artifactId>bungeecord-log</artifactId>
|
||||||
<version>1.19-R0.1-SNAPSHOT</version>
|
<version>1.20-R0.1-SNAPSHOT</version>
|
||||||
<packaging>jar</packaging>
|
<packaging>jar</packaging>
|
||||||
|
|
||||||
<name>BungeeCord-Log</name>
|
<name>BungeeCord-Log</name>
|
||||||
|
@ -1 +1 @@
|
|||||||
Subproject commit 8df2f8e7b9c7bb9390ac74bb7bace27edca81a2b
|
Subproject commit 8c89224991adff88d53cd380f42a2baa36f91454
|
@ -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.19-R0.1-SNAPSHOT</version>
|
<version>1.20-R0.1-SNAPSHOT</version>
|
||||||
<relativePath>../pom.xml</relativePath>
|
<relativePath>../pom.xml</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<artifactId>bungeecord-native</artifactId>
|
<artifactId>bungeecord-native</artifactId>
|
||||||
<version>1.19-R0.1-SNAPSHOT</version>
|
<version>1.20-R0.1-SNAPSHOT</version>
|
||||||
<packaging>jar</packaging>
|
<packaging>jar</packaging>
|
||||||
|
|
||||||
<name>BungeeCord-Native</name>
|
<name>BungeeCord-Native</name>
|
||||||
@ -21,7 +21,6 @@
|
|||||||
<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>
|
||||||
|
Binary file not shown.
Binary file not shown.
@ -1 +1 @@
|
|||||||
Subproject commit 959b4ea305821e753385e873ec4edfaa9a5d49b7
|
Subproject commit 4e4e4c4fbdad9dd034d8f05e2312bf845f0d4d15
|
49
pom.xml
49
pom.xml
@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
<groupId>fr.pandacube.bungeecord</groupId>
|
<groupId>fr.pandacube.bungeecord</groupId>
|
||||||
<artifactId>bungeecord-parent</artifactId>
|
<artifactId>bungeecord-parent</artifactId>
|
||||||
<version>1.19-R0.1-SNAPSHOT</version>
|
<version>1.20-R0.1-SNAPSHOT</version>
|
||||||
<packaging>pom</packaging>
|
<packaging>pom</packaging>
|
||||||
|
|
||||||
<name>BungeeCord-Parent</name>
|
<name>BungeeCord-Parent</name>
|
||||||
@ -71,13 +71,23 @@
|
|||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
<build.number>unknown</build.number>
|
<build.number>unknown</build.number>
|
||||||
<lombok.version>1.18.26</lombok.version>
|
<lombok.version>1.18.28</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>
|
||||||
@ -131,7 +141,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.2.1</version>
|
<version>3.3.0</version>
|
||||||
<executions>
|
<executions>
|
||||||
<execution>
|
<execution>
|
||||||
<phase>process-classes</phase>
|
<phase>process-classes</phase>
|
||||||
@ -156,7 +166,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.22</version>
|
<version>1.23</version>
|
||||||
<executions>
|
<executions>
|
||||||
<execution>
|
<execution>
|
||||||
<phase>process-classes</phase>
|
<phase>process-classes</phase>
|
||||||
@ -173,6 +183,31 @@
|
|||||||
</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>
|
||||||
|
|
||||||
@ -231,7 +266,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.2.1</version>
|
<version>3.3.0</version>
|
||||||
<executions>
|
<executions>
|
||||||
<execution>
|
<execution>
|
||||||
<phase>package</phase>
|
<phase>package</phase>
|
||||||
@ -307,7 +342,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.0.1</version>
|
<version>3.1.0</version>
|
||||||
<executions>
|
<executions>
|
||||||
<execution>
|
<execution>
|
||||||
<phase>verify</phase>
|
<phase>verify</phase>
|
||||||
|
@ -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.19-R0.1-SNAPSHOT</version>
|
<version>1.20-R0.1-SNAPSHOT</version>
|
||||||
<relativePath>../pom.xml</relativePath>
|
<relativePath>../pom.xml</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<artifactId>bungeecord-protocol</artifactId>
|
<artifactId>bungeecord-protocol</artifactId>
|
||||||
<version>1.19-R0.1-SNAPSHOT</version>
|
<version>1.20-R0.1-SNAPSHOT</version>
|
||||||
<packaging>jar</packaging>
|
<packaging>jar</packaging>
|
||||||
|
|
||||||
<name>BungeeCord-Protocol</name>
|
<name>BungeeCord-Protocol</name>
|
||||||
@ -48,7 +48,6 @@
|
|||||||
<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>
|
||||||
|
@ -42,6 +42,7 @@ 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;
|
||||||
|
|
||||||
@ -59,7 +60,8 @@ 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,
|
||||||
@ -96,13 +98,14 @@ 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.19.x" );
|
// supportedVersions.add( "1.20.x" );
|
||||||
// supportedVersionIds.add( ProtocolConstants.MINECRAFT_1_19 );
|
// supportedVersionIds.add( ProtocolConstants.MINECRAFT_1_20 );
|
||||||
}
|
}
|
||||||
|
|
||||||
SUPPORTED_VERSIONS = supportedVersions.build();
|
SUPPORTED_VERSIONS = supportedVersions.build();
|
||||||
|
@ -53,8 +53,7 @@ public class Varint21FrameDecoder extends ByteToMessageDecoder
|
|||||||
{
|
{
|
||||||
if ( in.hasMemoryAddress() )
|
if ( in.hasMemoryAddress() )
|
||||||
{
|
{
|
||||||
out.add( in.slice( in.readerIndex(), length ).retain() );
|
out.add( in.readRetainedSlice( length ) );
|
||||||
in.skipBytes( length );
|
|
||||||
} else
|
} else
|
||||||
{
|
{
|
||||||
if ( !DIRECT_WARNING )
|
if ( !DIRECT_WARNING )
|
||||||
|
@ -0,0 +1,25 @@
|
|||||||
|
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() );
|
||||||
|
}
|
||||||
|
}
|
@ -5,6 +5,9 @@ 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>
|
||||||
{
|
{
|
||||||
@ -20,7 +23,7 @@ public class Varint21LengthFieldPrepender extends MessageToByteEncoder<ByteBuf>
|
|||||||
out.writeBytes( msg );
|
out.writeBytes( msg );
|
||||||
}
|
}
|
||||||
|
|
||||||
private static int varintSize(int paramInt)
|
static int varintSize(int paramInt)
|
||||||
{
|
{
|
||||||
if ( ( paramInt & 0xFFFFFF80 ) == 0 )
|
if ( ( paramInt & 0xFFFFFF80 ) == 0 )
|
||||||
{
|
{
|
||||||
|
@ -651,176 +651,167 @@ 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_legacy", VOID ); // 1.14
|
register( "minecraft:time", 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" ),
|
get( "brigadier:bool", VOID ),
|
||||||
get( "brigadier:float" ),
|
get( "brigadier:float", FLOAT_RANGE ),
|
||||||
get( "brigadier:double" ),
|
get( "brigadier:double", DOUBLE_RANGE ),
|
||||||
get( "brigadier:integer" ),
|
get( "brigadier:integer", INTEGER_RANGE ),
|
||||||
get( "brigadier:long" ),
|
get( "brigadier:long", LONG_RANGE ),
|
||||||
get( "brigadier:string" ),
|
get( "brigadier:string", STRING ),
|
||||||
get( "minecraft:entity" ),
|
get( "minecraft:entity", BYTE ),
|
||||||
get( "minecraft:game_profile" ),
|
get( "minecraft:game_profile", VOID ),
|
||||||
get( "minecraft:block_pos" ),
|
get( "minecraft:block_pos", VOID ),
|
||||||
get( "minecraft:column_pos" ),
|
get( "minecraft:column_pos", VOID ),
|
||||||
get( "minecraft:vec3" ),
|
get( "minecraft:vec3", VOID ),
|
||||||
get( "minecraft:vec2" ),
|
get( "minecraft:vec2", VOID ),
|
||||||
get( "minecraft:block_state" ),
|
get( "minecraft:block_state", VOID ),
|
||||||
get( "minecraft:block_predicate" ),
|
get( "minecraft:block_predicate", VOID ),
|
||||||
get( "minecraft:item_stack" ),
|
get( "minecraft:item_stack", VOID ),
|
||||||
get( "minecraft:item_predicate" ),
|
get( "minecraft:item_predicate", VOID ),
|
||||||
get( "minecraft:color" ),
|
get( "minecraft:color", VOID ),
|
||||||
get( "minecraft:component" ),
|
get( "minecraft:component", VOID ),
|
||||||
get( "minecraft:message" ),
|
get( "minecraft:message", VOID ),
|
||||||
get( "minecraft:nbt_compound_tag" ),
|
get( "minecraft:nbt_compound_tag", VOID ),
|
||||||
get( "minecraft:nbt_tag" ),
|
get( "minecraft:nbt_tag", VOID ),
|
||||||
get( "minecraft:nbt_path" ),
|
get( "minecraft:nbt_path", VOID ),
|
||||||
get( "minecraft:objective" ),
|
get( "minecraft:objective", VOID ),
|
||||||
get( "minecraft:objective_criteria" ),
|
get( "minecraft:objective_criteria", VOID ),
|
||||||
get( "minecraft:operation" ),
|
get( "minecraft:operation", VOID ),
|
||||||
get( "minecraft:particle" ),
|
get( "minecraft:particle", VOID ),
|
||||||
get( "minecraft:angle" ),
|
get( "minecraft:angle", VOID ),
|
||||||
get( "minecraft:rotation" ),
|
get( "minecraft:rotation", VOID ),
|
||||||
get( "minecraft:scoreboard_slot" ),
|
get( "minecraft:scoreboard_slot", VOID ),
|
||||||
get( "minecraft:score_holder" ),
|
get( "minecraft:score_holder", BYTE ),
|
||||||
get( "minecraft:swizzle" ),
|
get( "minecraft:swizzle", VOID ),
|
||||||
get( "minecraft:team" ),
|
get( "minecraft:team", VOID ),
|
||||||
get( "minecraft:item_slot" ),
|
get( "minecraft:item_slot", VOID ),
|
||||||
get( "minecraft:resource_location" ),
|
get( "minecraft:resource_location", VOID ),
|
||||||
get( "minecraft:mob_effect" ),
|
get( "minecraft:mob_effect", VOID ),
|
||||||
get( "minecraft:function" ),
|
get( "minecraft:function", VOID ),
|
||||||
get( "minecraft:entity_anchor" ),
|
get( "minecraft:entity_anchor", VOID ),
|
||||||
get( "minecraft:int_range" ),
|
get( "minecraft:int_range", VOID ),
|
||||||
get( "minecraft:float_range" ),
|
get( "minecraft:float_range", VOID ),
|
||||||
get( "minecraft:item_enchantment" ),
|
get( "minecraft:item_enchantment", VOID ),
|
||||||
get( "minecraft:entity_summon" ),
|
get( "minecraft:entity_summon", VOID ),
|
||||||
get( "minecraft:dimension" ),
|
get( "minecraft:dimension", VOID ),
|
||||||
get( "minecraft:time_legacy" ),
|
get( "minecraft:time", VOID ),
|
||||||
get( "minecraft:resource_or_tag" ),
|
get( "minecraft:resource_or_tag", RAW_STRING ),
|
||||||
get( "minecraft:resource" ),
|
get( "minecraft:resource", RAW_STRING ),
|
||||||
get( "minecraft:template_mirror" ),
|
get( "minecraft:template_mirror", VOID ),
|
||||||
get( "minecraft:template_rotation" ),
|
get( "minecraft:template_rotation", VOID ),
|
||||||
get( "minecraft:uuid" )
|
get( "minecraft:uuid", VOID ),
|
||||||
};
|
};
|
||||||
|
|
||||||
IDS_1_19_3 = new ArgumentSerializer[]
|
IDS_1_19_3 = new ArgumentSerializer[]
|
||||||
{
|
{
|
||||||
get( "brigadier:bool" ),
|
get( "brigadier:bool", VOID ),
|
||||||
get( "brigadier:float" ),
|
get( "brigadier:float", FLOAT_RANGE ),
|
||||||
get( "brigadier:double" ),
|
get( "brigadier:double", DOUBLE_RANGE ),
|
||||||
get( "brigadier:integer" ),
|
get( "brigadier:integer", INTEGER_RANGE ),
|
||||||
get( "brigadier:long" ),
|
get( "brigadier:long", LONG_RANGE ),
|
||||||
get( "brigadier:string" ),
|
get( "brigadier:string", STRING ),
|
||||||
get( "minecraft:entity" ),
|
get( "minecraft:entity", BYTE ),
|
||||||
get( "minecraft:game_profile" ),
|
get( "minecraft:game_profile", VOID ),
|
||||||
get( "minecraft:block_pos" ),
|
get( "minecraft:block_pos", VOID ),
|
||||||
get( "minecraft:column_pos" ),
|
get( "minecraft:column_pos", VOID ),
|
||||||
get( "minecraft:vec3" ),
|
get( "minecraft:vec3", VOID ),
|
||||||
get( "minecraft:vec2" ),
|
get( "minecraft:vec2", VOID ),
|
||||||
get( "minecraft:block_state" ),
|
get( "minecraft:block_state", VOID ),
|
||||||
get( "minecraft:block_predicate" ),
|
get( "minecraft:block_predicate", VOID ),
|
||||||
get( "minecraft:item_stack" ),
|
get( "minecraft:item_stack", VOID ),
|
||||||
get( "minecraft:item_predicate" ),
|
get( "minecraft:item_predicate", VOID ),
|
||||||
get( "minecraft:color" ),
|
get( "minecraft:color", VOID ),
|
||||||
get( "minecraft:component" ),
|
get( "minecraft:component", VOID ),
|
||||||
get( "minecraft:message" ),
|
get( "minecraft:message", VOID ),
|
||||||
get( "minecraft:nbt_compound_tag" ),
|
get( "minecraft:nbt_compound_tag", VOID ),
|
||||||
get( "minecraft:nbt_tag" ),
|
get( "minecraft:nbt_tag", VOID ),
|
||||||
get( "minecraft:nbt_path" ),
|
get( "minecraft:nbt_path", VOID ),
|
||||||
get( "minecraft:objective" ),
|
get( "minecraft:objective", VOID ),
|
||||||
get( "minecraft:objective_criteria" ),
|
get( "minecraft:objective_criteria", VOID ),
|
||||||
get( "minecraft:operation" ),
|
get( "minecraft:operation", VOID ),
|
||||||
get( "minecraft:particle" ),
|
get( "minecraft:particle", VOID ),
|
||||||
get( "minecraft:angle" ),
|
get( "minecraft:angle", VOID ),
|
||||||
get( "minecraft:rotation" ),
|
get( "minecraft:rotation", VOID ),
|
||||||
get( "minecraft:scoreboard_slot" ),
|
get( "minecraft:scoreboard_slot", VOID ),
|
||||||
get( "minecraft:score_holder" ),
|
get( "minecraft:score_holder", BYTE ),
|
||||||
get( "minecraft:swizzle" ),
|
get( "minecraft:swizzle", VOID ),
|
||||||
get( "minecraft:team" ),
|
get( "minecraft:team", VOID ),
|
||||||
get( "minecraft:item_slot" ),
|
get( "minecraft:item_slot", VOID ),
|
||||||
get( "minecraft:resource_location" ),
|
get( "minecraft:resource_location", VOID ),
|
||||||
get( "minecraft:function" ),
|
get( "minecraft:function", VOID ),
|
||||||
get( "minecraft:entity_anchor" ),
|
get( "minecraft:entity_anchor", VOID ),
|
||||||
get( "minecraft:int_range" ),
|
get( "minecraft:int_range", VOID ),
|
||||||
get( "minecraft:float_range" ),
|
get( "minecraft:float_range", VOID ),
|
||||||
get( "minecraft:dimension" ),
|
get( "minecraft:dimension", VOID ),
|
||||||
get( "minecraft:gamemode" ),
|
get( "minecraft:gamemode", VOID ),
|
||||||
get( "minecraft:time_legacy" ),
|
get( "minecraft:time", VOID ),
|
||||||
get( "minecraft:resource_or_tag" ),
|
get( "minecraft:resource_or_tag", RAW_STRING ),
|
||||||
get( "minecraft:resource_or_tag_key" ),
|
get( "minecraft:resource_or_tag_key", RAW_STRING ),
|
||||||
get( "minecraft:resource" ),
|
get( "minecraft:resource", RAW_STRING ),
|
||||||
get( "minecraft:resource_key" ),
|
get( "minecraft:resource_key", RAW_STRING ),
|
||||||
get( "minecraft:template_mirror" ),
|
get( "minecraft:template_mirror", VOID ),
|
||||||
get( "minecraft:template_rotation" ),
|
get( "minecraft:template_rotation", VOID ),
|
||||||
get( "minecraft:uuid" )
|
get( "minecraft:uuid", VOID )
|
||||||
};
|
};
|
||||||
|
|
||||||
IDS_1_19_4 = new ArgumentSerializer[]
|
IDS_1_19_4 = new ArgumentSerializer[]
|
||||||
{
|
{
|
||||||
get( "brigadier:bool" ),
|
get( "brigadier:bool", VOID ),
|
||||||
get( "brigadier:float" ),
|
get( "brigadier:float", FLOAT_RANGE ),
|
||||||
get( "brigadier:double" ),
|
get( "brigadier:double", DOUBLE_RANGE ),
|
||||||
get( "brigadier:integer" ),
|
get( "brigadier:integer", INTEGER_RANGE ),
|
||||||
get( "brigadier:long" ),
|
get( "brigadier:long", LONG_RANGE ),
|
||||||
get( "brigadier:string" ),
|
get( "brigadier:string", STRING ),
|
||||||
get( "minecraft:entity" ),
|
get( "minecraft:entity", BYTE ),
|
||||||
get( "minecraft:game_profile" ),
|
get( "minecraft:game_profile", VOID ),
|
||||||
get( "minecraft:block_pos" ),
|
get( "minecraft:block_pos", VOID ),
|
||||||
get( "minecraft:column_pos" ),
|
get( "minecraft:column_pos", VOID ),
|
||||||
get( "minecraft:vec3" ),
|
get( "minecraft:vec3", VOID ),
|
||||||
get( "minecraft:vec2" ),
|
get( "minecraft:vec2", VOID ),
|
||||||
get( "minecraft:block_state" ),
|
get( "minecraft:block_state", VOID ),
|
||||||
get( "minecraft:block_predicate" ),
|
get( "minecraft:block_predicate", VOID ),
|
||||||
get( "minecraft:item_stack" ),
|
get( "minecraft:item_stack", VOID ),
|
||||||
get( "minecraft:item_predicate" ),
|
get( "minecraft:item_predicate", VOID ),
|
||||||
get( "minecraft:color" ),
|
get( "minecraft:color", VOID ),
|
||||||
get( "minecraft:component" ),
|
get( "minecraft:component", VOID ),
|
||||||
get( "minecraft:message" ),
|
get( "minecraft:message", VOID ),
|
||||||
get( "minecraft:nbt_compound_tag" ),
|
get( "minecraft:nbt_compound_tag", VOID ),
|
||||||
get( "minecraft:nbt_tag" ),
|
get( "minecraft:nbt_tag", VOID ),
|
||||||
get( "minecraft:nbt_path" ),
|
get( "minecraft:nbt_path", VOID ),
|
||||||
get( "minecraft:objective" ),
|
get( "minecraft:objective", VOID ),
|
||||||
get( "minecraft:objective_criteria" ),
|
get( "minecraft:objective_criteria", VOID ),
|
||||||
get( "minecraft:operation" ),
|
get( "minecraft:operation", VOID ),
|
||||||
get( "minecraft:particle" ),
|
get( "minecraft:particle", VOID ),
|
||||||
get( "minecraft:angle" ),
|
get( "minecraft:angle", VOID ),
|
||||||
get( "minecraft:rotation" ),
|
get( "minecraft:rotation", VOID ),
|
||||||
get( "minecraft:scoreboard_slot" ),
|
get( "minecraft:scoreboard_slot", VOID ),
|
||||||
get( "minecraft:score_holder" ),
|
get( "minecraft:score_holder", BYTE ),
|
||||||
get( "minecraft:swizzle" ),
|
get( "minecraft:swizzle", VOID ),
|
||||||
get( "minecraft:team" ),
|
get( "minecraft:team", VOID ),
|
||||||
get( "minecraft:item_slot" ),
|
get( "minecraft:item_slot", VOID ),
|
||||||
get( "minecraft:resource_location" ),
|
get( "minecraft:resource_location", VOID ),
|
||||||
get( "minecraft:function" ),
|
get( "minecraft:function", VOID ),
|
||||||
get( "minecraft:entity_anchor" ),
|
get( "minecraft:entity_anchor", VOID ),
|
||||||
get( "minecraft:int_range" ),
|
get( "minecraft:int_range", VOID ),
|
||||||
get( "minecraft:float_range" ),
|
get( "minecraft:float_range", VOID ),
|
||||||
get( "minecraft:dimension" ),
|
get( "minecraft:dimension", VOID ),
|
||||||
get( "minecraft:gamemode" ),
|
get( "minecraft:gamemode", VOID ),
|
||||||
get( "minecraft:time" ),
|
get( "minecraft:time", INTEGER ),
|
||||||
get( "minecraft:resource_or_tag" ),
|
get( "minecraft:resource_or_tag", RAW_STRING ),
|
||||||
get( "minecraft:resource_or_tag_key" ),
|
get( "minecraft:resource_or_tag_key", RAW_STRING ),
|
||||||
get( "minecraft:resource" ),
|
get( "minecraft:resource", RAW_STRING ),
|
||||||
get( "minecraft:resource_key" ),
|
get( "minecraft:resource_key", RAW_STRING ),
|
||||||
get( "minecraft:template_mirror" ),
|
get( "minecraft:template_mirror", VOID ),
|
||||||
get( "minecraft:template_rotation" ),
|
get( "minecraft:template_rotation", VOID ),
|
||||||
get( "minecraft:uuid" ),
|
get( "minecraft:uuid", VOID ),
|
||||||
get( "minecraft:heightmap" )
|
get( "minecraft:heightmap", VOID )
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -829,9 +820,9 @@ public class Commands extends DefinedPacket
|
|||||||
PROVIDERS.put( name, serializer );
|
PROVIDERS.put( name, serializer );
|
||||||
}
|
}
|
||||||
|
|
||||||
private static ArgumentSerializer get(String name)
|
private static ArgumentSerializer get(String name, ArgumentSerializer serializer)
|
||||||
{
|
{
|
||||||
return PROVIDERS.get( name );
|
return serializer;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -39,6 +39,7 @@ 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)
|
||||||
@ -127,6 +128,10 @@ 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
|
||||||
@ -220,6 +225,10 @@ public class Login extends DefinedPacket
|
|||||||
buf.writeBoolean( false );
|
buf.writeBoolean( false );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if ( protocolVersion >= ProtocolConstants.MINECRAFT_1_20 )
|
||||||
|
{
|
||||||
|
writeVarInt( portalCooldown, buf );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -29,6 +29,7 @@ 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)
|
||||||
@ -73,6 +74,10 @@ 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
|
||||||
@ -123,6 +128,10 @@ public class Respawn extends DefinedPacket
|
|||||||
buf.writeBoolean( false );
|
buf.writeBoolean( false );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if ( protocolVersion >= ProtocolConstants.MINECRAFT_1_20 )
|
||||||
|
{
|
||||||
|
writeVarInt( portalCooldown, buf );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -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.19-R0.1-SNAPSHOT</version>
|
<version>1.20-R0.1-SNAPSHOT</version>
|
||||||
<relativePath>../pom.xml</relativePath>
|
<relativePath>../pom.xml</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<artifactId>bungeecord-proxy</artifactId>
|
<artifactId>bungeecord-proxy</artifactId>
|
||||||
<version>1.19-R0.1-SNAPSHOT</version>
|
<version>1.20-R0.1-SNAPSHOT</version>
|
||||||
<packaging>jar</packaging>
|
<packaging>jar</packaging>
|
||||||
|
|
||||||
<name>BungeeCord-Proxy</name>
|
<name>BungeeCord-Proxy</name>
|
||||||
@ -26,32 +26,27 @@
|
|||||||
<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>
|
||||||
@ -100,26 +95,26 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.mysql</groupId>
|
<groupId>com.mysql</groupId>
|
||||||
<artifactId>mysql-connector-j</artifactId>
|
<artifactId>mysql-connector-j</artifactId>
|
||||||
<version>8.0.32</version>
|
<version>8.0.33</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.8.5</version>
|
<version>3.9.2</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.7.3</version>
|
<version>1.9.10</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.7.3</version>
|
<version>1.9.10</version>
|
||||||
<scope>runtime</scope>
|
<scope>runtime</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
@ -619,12 +619,16 @@ public class BungeeCord extends ProxyServer
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public UserConnection getPlayerByOfflineUUID(UUID name)
|
public UserConnection getPlayerByOfflineUUID(UUID uuid)
|
||||||
{
|
{
|
||||||
|
if ( uuid.version() != 3 )
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
connectionLock.readLock().lock();
|
connectionLock.readLock().lock();
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
return connectionsByOfflineUUID.get( name );
|
return connectionsByOfflineUUID.get( uuid );
|
||||||
} finally
|
} finally
|
||||||
{
|
{
|
||||||
connectionLock.readLock().unlock();
|
connectionLock.readLock().unlock();
|
||||||
@ -681,10 +685,10 @@ public class BungeeCord extends ProxyServer
|
|||||||
{
|
{
|
||||||
if ( protocolVersion >= ProtocolConstants.MINECRAFT_1_13 )
|
if ( protocolVersion >= ProtocolConstants.MINECRAFT_1_13 )
|
||||||
{
|
{
|
||||||
return new PluginMessage( "minecraft:register", Util.format( Iterables.transform( pluginChannels, PluginMessage.MODERNISE ), "\00" ).getBytes( Charsets.UTF_8 ), false );
|
return new PluginMessage( "minecraft:register", String.join( "\00", Iterables.transform( pluginChannels, PluginMessage.MODERNISE ) ).getBytes( Charsets.UTF_8 ), false );
|
||||||
}
|
}
|
||||||
|
|
||||||
return new PluginMessage( "REGISTER", Util.format( pluginChannels, "\00" ).getBytes( Charsets.UTF_8 ), false );
|
return new PluginMessage( "REGISTER", String.join( "\00", pluginChannels ).getBytes( Charsets.UTF_8 ), false );
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -745,12 +749,17 @@ 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( con.getPendingConnection().getOfflineId(), con );
|
connectionsByOfflineUUID.put( offlineId, con );
|
||||||
} finally
|
} finally
|
||||||
{
|
{
|
||||||
connectionLock.writeLock().unlock();
|
connectionLock.writeLock().unlock();
|
||||||
|
@ -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 )
|
.handler( PipelineUtils.BASE_SERVERSIDE )
|
||||||
.option( ChannelOption.CONNECT_TIMEOUT_MILLIS, BungeeCord.getInstance().getConfig().getRemotePingTimeout() )
|
.option( ChannelOption.CONNECT_TIMEOUT_MILLIS, BungeeCord.getInstance().getConfig().getRemotePingTimeout() )
|
||||||
.remoteAddress( socketAddress )
|
.remoteAddress( socketAddress )
|
||||||
.connect()
|
.connect()
|
||||||
|
@ -225,7 +225,8 @@ 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 );
|
||||||
|
|
||||||
@ -243,7 +244,8 @@ 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
|
||||||
{
|
{
|
||||||
@ -292,11 +294,13 @@ 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(), false, login.getDeathLocation() ) );
|
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(), 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(), 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() ) );
|
||||||
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() ) );
|
||||||
|
@ -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.initChannel( ch );
|
PipelineUtils.BASE_SERVERSIDE.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 ) );
|
||||||
|
@ -80,6 +80,7 @@ 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" );
|
||||||
|
@ -30,6 +30,8 @@ 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;
|
||||||
@ -42,6 +44,7 @@ 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
|
||||||
@ -82,9 +85,11 @@ public class PipelineUtils
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
public static final Base BASE = new Base();
|
public static final Base BASE = new Base( false );
|
||||||
|
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";
|
||||||
@ -152,9 +157,13 @@ 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
|
||||||
{
|
{
|
||||||
@ -170,7 +179,9 @@ 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 ) );
|
||||||
ch.pipeline().addLast( FRAME_PREPENDER, framePrepender );
|
// No encryption bungee -> server, therefore use extra buffer to avoid copying everything for length prepending
|
||||||
|
// 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() );
|
||||||
}
|
}
|
||||||
|
@ -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.19-R0.1-SNAPSHOT</version>
|
<version>1.20-R0.1-SNAPSHOT</version>
|
||||||
<relativePath>../pom.xml</relativePath>
|
<relativePath>../pom.xml</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<artifactId>bungeecord-query</artifactId>
|
<artifactId>bungeecord-query</artifactId>
|
||||||
<version>1.19-R0.1-SNAPSHOT</version>
|
<version>1.20-R0.1-SNAPSHOT</version>
|
||||||
<packaging>jar</packaging>
|
<packaging>jar</packaging>
|
||||||
|
|
||||||
<name>BungeeCord-Query</name>
|
<name>BungeeCord-Query</name>
|
||||||
@ -21,7 +21,6 @@
|
|||||||
<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>
|
||||||
|
@ -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.19-R0.1-SNAPSHOT</version>
|
<version>1.20-R0.1-SNAPSHOT</version>
|
||||||
<relativePath>../pom.xml</relativePath>
|
<relativePath>../pom.xml</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<artifactId>bungeecord-slf4j</artifactId>
|
<artifactId>bungeecord-slf4j</artifactId>
|
||||||
<version>1.19-R0.1-SNAPSHOT</version>
|
<version>1.20-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.32</version>
|
<version>1.7.36</version>
|
||||||
<scope>compile</scope>
|
<scope>compile</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
Loading…
Reference in New Issue
Block a user