Push illegal char kick to main thread (#7363)
Dieser Commit ist enthalten in:
Ursprung
048e030914
Commit
919e59494c
20
patches/server/0853-Kick-on-main-for-illegal-chars.patch
Normale Datei
20
patches/server/0853-Kick-on-main-for-illegal-chars.patch
Normale Datei
@ -0,0 +1,20 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Nassim Jahnke <jahnke.nassim@gmail.com>
|
||||
Date: Mon, 17 Jan 2022 19:47:19 +0100
|
||||
Subject: [PATCH] Kick on main for illegal chars
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
index 926d0a80cbb55184955ac6720948d2e86683cc57..5c9310fe424943a7256f6f77c414147384bad0aa 100644
|
||||
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
@@ -2067,7 +2067,9 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
|
||||
|
||||
for (int i = 0; i < s.length(); ++i) {
|
||||
if (!SharedConstants.isAllowedChatCharacter(s.charAt(i))) {
|
||||
+ this.server.scheduleOnMain(() -> { // Paper - push to main for event firing
|
||||
this.disconnect(new TranslatableComponent("multiplayer.disconnect.illegal_characters"), org.bukkit.event.player.PlayerKickEvent.Cause.ILLEGAL_CHARACTERS); // Paper - add cause
|
||||
+ }); // Paper - push to main for event firing
|
||||
return;
|
||||
}
|
||||
}
|
In neuem Issue referenzieren
Einen Benutzer sperren