aboutsummaryrefslogtreecommitdiffhomepage
path: root/patches/removed
diff options
context:
space:
mode:
authorJake Potrebic <[email protected]>2023-12-08 15:14:42 -0800
committerJake Potrebic <[email protected]>2023-12-08 15:14:42 -0800
commit9051fc347c428500090e814c98e9d8503dc7a205 (patch)
treeba8b6fcda92d46b0d145b812684a980d93789c77 /patches/removed
parentf17622cc3d227cf260d2b3a378830f34b73d7368 (diff)
downloadPaper-9051fc347c428500090e814c98e9d8503dc7a205.tar.gz
Paper-9051fc347c428500090e814c98e9d8503dc7a205.zip
remove redundant patch
Diffstat (limited to 'patches/removed')
-rw-r--r--patches/removed/1.20.3/0748-Kick-on-main-for-illegal-chat.patch45
1 files changed, 45 insertions, 0 deletions
diff --git a/patches/removed/1.20.3/0748-Kick-on-main-for-illegal-chat.patch b/patches/removed/1.20.3/0748-Kick-on-main-for-illegal-chat.patch
new file mode 100644
index 0000000000..6c8e0a4cba
--- /dev/null
+++ b/patches/removed/1.20.3/0748-Kick-on-main-for-illegal-chat.patch
@@ -0,0 +1,45 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Nassim Jahnke <[email protected]>
+Date: Mon, 17 Jan 2022 19:47:19 +0100
+Subject: [PATCH] Kick on main for illegal chat
+
+Makes the PlayerKickEvent fire on the main thread for
+illegal characters or chat out-of-order errors.
+
+TODO: Check all the missing schedule on mains? (1.20.3)
+ - not needed anymore, there is a check inside disconnect if off main
+
+diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+index b650e7b53bea147be0b5d88449d41f03a971ca97..09465bee578a440c0da6961dde66083cd097f5e5 100644
+--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
++++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+@@ -2049,7 +2049,9 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
+ }
+ // CraftBukkit end
+ if (ServerGamePacketListenerImpl.isChatMessageIllegal(packet.message())) {
++ this.server.scheduleOnMain(() -> { // Paper - push to main for event firing
+ this.disconnect(Component.translatable("multiplayer.disconnect.illegal_characters"), org.bukkit.event.player.PlayerKickEvent.Cause.ILLEGAL_CHARACTERS); // Paper - add cause
++ }); // Paper - push to main for event firing
+ } else {
+ Optional<LastSeenMessages> optional = this.tryHandleChat(packet.lastSeenMessages());
+
+@@ -2081,7 +2083,9 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
+ @Override
+ public void handleChatCommand(ServerboundChatCommandPacket packet) {
+ if (ServerGamePacketListenerImpl.isChatMessageIllegal(packet.command())) {
++ this.server.scheduleOnMain(() -> { // Paper - push to main for event firing
+ this.disconnect(Component.translatable("multiplayer.disconnect.illegal_characters"), org.bukkit.event.player.PlayerKickEvent.Cause.ILLEGAL_CHARACTERS); // Paper
++ }); // Paper - push to main for event firing
+ } else {
+ Optional<LastSeenMessages> optional = this.tryHandleChat(packet.lastSeenMessages());
+
+@@ -2137,7 +2141,9 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
+ private void handleMessageDecodeFailure(SignedMessageChain.DecodeException exception) {
+ ServerGamePacketListenerImpl.LOGGER.warn("Failed to update secure chat state for {}: '{}'", this.player.getGameProfile().getName(), exception.getComponent().getString());
+ if (exception.shouldDisconnect()) {
++ this.server.scheduleOnMain(() -> { // Paper - push to main
+ this.disconnect(exception.getComponent(), exception.kickCause); // Paper - kick event causes
++ }); // Paper - push to main
+ } else {
+ this.player.sendSystemMessage(exception.getComponent().copy().withStyle(ChatFormatting.RED));
+ }