diff --git a/patches/server/Add-PlayerKickEvent-causes.patch b/patches/server/Add-PlayerKickEvent-causes.patch index 6731f86881..a92d3bedda 100644 --- a/patches/server/Add-PlayerKickEvent-causes.patch +++ b/patches/server/Add-PlayerKickEvent-causes.patch @@ -259,7 +259,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 if (this.tryHandleChat(packet.command(), packet.timeStamp(), packet.lastSeenMessages())) { this.server.submit(() -> { @@ -0,0 +0,0 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic - private boolean tryHandleChat(String message, Instant timestamp, LastSeenMessages.Update acknowledgment) { + // Paper end if (!this.updateChatOrder(timestamp)) { ServerGamePacketListenerImpl.LOGGER.warn("{} sent out-of-order chat: '{}'", this.player.getName().getString(), message); - this.disconnect(Component.translatable("multiplayer.disconnect.out_of_order_chat")); diff --git a/patches/server/Add-some-minimal-debug-information-to-chat-packet-er.patch b/patches/server/Add-some-minimal-debug-information-to-chat-packet-er.patch index a9c9fe2ef8..977592cdb6 100644 --- a/patches/server/Add-some-minimal-debug-information-to-chat-packet-er.patch +++ b/patches/server/Add-some-minimal-debug-information-to-chat-packet-er.patch @@ -10,8 +10,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java @@ -0,0 +0,0 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic - - private boolean tryHandleChat(String message, Instant timestamp, LastSeenMessages.Update acknowledgment) { + } + // Paper end if (!this.updateChatOrder(timestamp)) { - ServerGamePacketListenerImpl.LOGGER.warn("{} sent out-of-order chat: '{}'", this.player.getName().getString(), message); + ServerGamePacketListenerImpl.LOGGER.warn("{} sent out-of-order chat: '{}': {} > {}", this.player.getName().getString(), message, this.lastChatTimeStamp.get().getEpochSecond(), timestamp.getEpochSecond()); // Paper diff --git a/patches/server/Basic-PlayerProfile-API.patch b/patches/server/Basic-PlayerProfile-API.patch index de9324fede..57e1a0926e 100644 --- a/patches/server/Basic-PlayerProfile-API.patch +++ b/patches/server/Basic-PlayerProfile-API.patch @@ -598,6 +598,24 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 // CraftBukkit start String s = (String) Optional.ofNullable((String) optionset.valueOf("world")).orElse(dedicatedserversettings.getProperties().levelName); LevelStorageSource convertable = LevelStorageSource.createDefault(file.toPath()); +diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 +--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java ++++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +@@ -0,0 +0,0 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic + } + + private boolean tryHandleChat(String message, Instant timestamp, LastSeenMessages.Update acknowledgment) { ++ // Paper start ++ final ProfilePublicKey key = this.player.getProfilePublicKey(); ++ if (key != null && key.data().hasExpired()) { ++ this.disconnect(Component.translatable("multiplayer.disconnect.missing_public_key"), org.bukkit.event.player.PlayerKickEvent.Cause.CHAT_VALIDATION_FAILED); ++ return false; ++ } ++ // Paper end + if (!this.updateChatOrder(timestamp)) { + ServerGamePacketListenerImpl.LOGGER.warn("{} sent out-of-order chat: '{}'", this.player.getName().getString(), message); + this.disconnect(Component.translatable("multiplayer.disconnect.out_of_order_chat")); diff --git a/src/main/java/net/minecraft/server/players/GameProfileCache.java b/src/main/java/net/minecraft/server/players/GameProfileCache.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/server/players/GameProfileCache.java diff --git a/patches/server/Kick-on-main-for-illegal-chat.patch b/patches/server/Kick-on-main-for-illegal-chat.patch index a195ae0ffd..c4aef2beab 100644 --- a/patches/server/Kick-on-main-for-illegal-chat.patch +++ b/patches/server/Kick-on-main-for-illegal-chat.patch @@ -31,7 +31,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 if (this.tryHandleChat(packet.command(), packet.timeStamp(), packet.lastSeenMessages())) { this.server.submit(() -> { @@ -0,0 +0,0 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic - private boolean tryHandleChat(String message, Instant timestamp, LastSeenMessages.Update acknowledgment) { + // Paper end if (!this.updateChatOrder(timestamp)) { ServerGamePacketListenerImpl.LOGGER.warn("{} sent out-of-order chat: '{}'", this.player.getName().getString(), message); + this.server.scheduleOnMain(() -> { // Paper - push to main