geforkt von Mirrors/Paper
i love jmp
Dieser Commit ist enthalten in:
Ursprung
e83c74a0a0
Commit
f8d0fdf127
@ -131,14 +131,6 @@ diff --git a/src/main/java/net/minecraft/server/network/ServerLoginPacketListene
|
|||||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||||
--- a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
|
--- a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
|
||||||
+++ b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
|
+++ b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
|
||||||
@@ -0,0 +0,0 @@ import javax.crypto.Cipher;
|
|
||||||
import javax.crypto.SecretKey;
|
|
||||||
import net.minecraft.DefaultUncaughtExceptionHandler;
|
|
||||||
import net.minecraft.network.Connection;
|
|
||||||
+import net.minecraft.network.FriendlyByteBuf;
|
|
||||||
import net.minecraft.network.chat.Component;
|
|
||||||
import net.minecraft.network.chat.TextComponent;
|
|
||||||
import net.minecraft.network.chat.TranslatableComponent;
|
|
||||||
@@ -0,0 +0,0 @@ import org.bukkit.craftbukkit.util.Waitable;
|
@@ -0,0 +0,0 @@ import org.bukkit.craftbukkit.util.Waitable;
|
||||||
import org.bukkit.event.player.AsyncPlayerPreLoginEvent;
|
import org.bukkit.event.player.AsyncPlayerPreLoginEvent;
|
||||||
import org.bukkit.event.player.PlayerPreLoginEvent;
|
import org.bukkit.event.player.PlayerPreLoginEvent;
|
||||||
@ -149,25 +141,25 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
|
|
||||||
@@ -0,0 +0,0 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener
|
@@ -0,0 +0,0 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener
|
||||||
@Nullable
|
@Nullable
|
||||||
private ServerPlayer delayedAcceptPlayer;
|
private ProfilePublicKey playerProfilePublicKey;
|
||||||
public String hostname = ""; // CraftBukkit - add field
|
public String hostname = ""; // CraftBukkit - add field
|
||||||
+ private int velocityLoginMessageId = -1; // Paper - Velocity support
|
+ private int velocityLoginMessageId = -1; // Paper - Velocity support
|
||||||
|
|
||||||
public ServerLoginPacketListenerImpl(MinecraftServer server, Connection connection) {
|
public ServerLoginPacketListenerImpl(MinecraftServer server, Connection connection) {
|
||||||
this.state = ServerLoginPacketListenerImpl.State.HELLO;
|
this.state = ServerLoginPacketListenerImpl.State.HELLO;
|
||||||
@@ -0,0 +0,0 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener
|
@@ -0,0 +0,0 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener
|
||||||
this.state = ServerLoginPacketListenerImpl.State.KEY;
|
this.state = ServerLoginPacketListenerImpl.State.KEY;
|
||||||
this.connection.send(new ClientboundHelloPacket("", this.server.getKeyPair().getPublic().getEncoded(), this.nonce));
|
this.connection.send(new ClientboundHelloPacket("", this.server.getKeyPair().getPublic().getEncoded(), this.nonce));
|
||||||
} else {
|
} else {
|
||||||
+ // Paper start - Velocity support
|
+ // Paper start - Velocity support
|
||||||
+ if (com.destroystokyo.paper.PaperConfig.velocitySupport) {
|
+ if (com.destroystokyo.paper.PaperConfig.velocitySupport) {
|
||||||
+ this.velocityLoginMessageId = java.util.concurrent.ThreadLocalRandom.current().nextInt();
|
+ this.velocityLoginMessageId = java.util.concurrent.ThreadLocalRandom.current().nextInt();
|
||||||
+ net.minecraft.network.protocol.login.ClientboundCustomQueryPacket packet1 = new net.minecraft.network.protocol.login.ClientboundCustomQueryPacket(this.velocityLoginMessageId, com.destroystokyo.paper.proxy.VelocityProxy.PLAYER_INFO_CHANNEL, new FriendlyByteBuf(Unpooled.EMPTY_BUFFER));
|
+ net.minecraft.network.protocol.login.ClientboundCustomQueryPacket packet1 = new net.minecraft.network.protocol.login.ClientboundCustomQueryPacket(this.velocityLoginMessageId, com.destroystokyo.paper.proxy.VelocityProxy.PLAYER_INFO_CHANNEL, new net.minecraft.network.FriendlyByteBuf(Unpooled.EMPTY_BUFFER));
|
||||||
+ this.connection.send(packet1);
|
+ this.connection.send(packet1);
|
||||||
+ return;
|
+ return;
|
||||||
+ }
|
+ }
|
||||||
+ // Paper end
|
+ // Paper end
|
||||||
// Spigot start
|
// Spigot start
|
||||||
// Paper start - Cache authenticator threads
|
// Paper start - Cache authenticator threads
|
||||||
authenticatorPool.execute(new Runnable() {
|
authenticatorPool.execute(new Runnable() {
|
||||||
@@ -0,0 +0,0 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener
|
@@ -0,0 +0,0 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener
|
||||||
@ -189,7 +181,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
public void handleCustomQueryPacket(ServerboundCustomQueryPacket packet) {
|
public void handleCustomQueryPacket(ServerboundCustomQueryPacket packet) {
|
||||||
+ // Paper start - Velocity support
|
+ // Paper start - Velocity support
|
||||||
+ if (com.destroystokyo.paper.PaperConfig.velocitySupport && packet.getTransactionId() == this.velocityLoginMessageId) {
|
+ if (com.destroystokyo.paper.PaperConfig.velocitySupport && packet.getTransactionId() == this.velocityLoginMessageId) {
|
||||||
+ FriendlyByteBuf buf = packet.getData();
|
+ net.minecraft.network.FriendlyByteBuf buf = packet.getData();
|
||||||
+ if (buf == null) {
|
+ if (buf == null) {
|
||||||
+ this.disconnect("This server requires you to connect with Velocity.");
|
+ this.disconnect("This server requires you to connect with Velocity.");
|
||||||
+ return;
|
+ return;
|
||||||
@ -221,7 +213,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
+ return;
|
+ return;
|
||||||
+ }
|
+ }
|
||||||
+ // Paper end
|
+ // Paper end
|
||||||
this.disconnect(new TranslatableComponent("multiplayer.disconnect.unexpected_query_response"));
|
this.disconnect(Component.translatable("multiplayer.disconnect.unexpected_query_response"));
|
||||||
}
|
}
|
||||||
|
|
||||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
@ -28,8 +28,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
synchronized (ServerHandshakePacketListenerImpl.throttleTracker) {
|
synchronized (ServerHandshakePacketListenerImpl.throttleTracker) {
|
||||||
if (ServerHandshakePacketListenerImpl.throttleTracker.containsKey(address) && !"127.0.0.1".equals(address.getHostAddress()) && currentTime - ServerHandshakePacketListenerImpl.throttleTracker.get(address) < connectionThrottle) {
|
if (ServerHandshakePacketListenerImpl.throttleTracker.containsKey(address) && !"127.0.0.1".equals(address.getHostAddress()) && currentTime - ServerHandshakePacketListenerImpl.throttleTracker.get(address) < connectionThrottle) {
|
||||||
ServerHandshakePacketListenerImpl.throttleTracker.put(address, currentTime);
|
ServerHandshakePacketListenerImpl.throttleTracker.put(address, currentTime);
|
||||||
- TranslatableComponent chatmessage = new TranslatableComponent("Connection throttled! Please wait before reconnecting.");
|
- MutableComponent chatmessage = Component.literal("Connection throttled! Please wait before reconnecting.");
|
||||||
+ TranslatableComponent chatmessage = new TranslatableComponent(com.destroystokyo.paper.PaperConfig.connectionThrottleKickMessage); // Paper - Configurable connection throttle kick message
|
+ MutableComponent chatmessage = Component.literal(com.destroystokyo.paper.PaperConfig.connectionThrottleKickMessage); // Paper - Configurable connection throttle kick message
|
||||||
this.connection.send(new ClientboundLoginDisconnectPacket(chatmessage));
|
this.connection.send(new ClientboundLoginDisconnectPacket(chatmessage));
|
||||||
this.connection.disconnect(chatmessage);
|
this.connection.disconnect(chatmessage);
|
||||||
return;
|
return;
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren