From 9624451ffd9f9db8840f538e1a926e02d64dce48 Mon Sep 17 00:00:00 2001 From: Jason Penilla <11360596+jpenilla@users.noreply.github.com> Date: Sat, 23 Sep 2023 08:50:32 -0700 Subject: [PATCH] Add missing kick event cause --- patches/server/0610-Add-PlayerKickEvent-causes.patch | 11 ++++++++++- ...ixes-kick-event-leave-message-not-being-sent.patch | 2 +- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/patches/server/0610-Add-PlayerKickEvent-causes.patch b/patches/server/0610-Add-PlayerKickEvent-causes.patch index 9a1e7dcbd9..4e0f81ed6e 100644 --- a/patches/server/0610-Add-PlayerKickEvent-causes.patch +++ b/patches/server/0610-Add-PlayerKickEvent-causes.patch @@ -88,7 +88,7 @@ index c68bac4727f6b2ca95fc8c438303097af14286f2..bb629ec263959c8268de88ca807bddb6 return Component.translatable("commands.kick.success", serverPlayer.getDisplayName(), reason); }, true); diff --git a/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java -index a38ad79aaf4ef5a928370152bdc5c0cc4c59d93e..877dd962a689c016668d1144ad2fef850fdbc31e 100644 +index a38ad79aaf4ef5a928370152bdc5c0cc4c59d93e..2f39206c85dbf4e34dca591d1e0ab9f372730013 100644 --- a/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java @@ -95,7 +95,7 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack @@ -136,6 +136,15 @@ index a38ad79aaf4ef5a928370152bdc5c0cc4c59d93e..877dd962a689c016668d1144ad2fef85 } // Paper start PlayerResourcePackStatusEvent.Status packStatus = PlayerResourcePackStatusEvent.Status.values()[packet.getAction().ordinal()]; +@@ -197,7 +197,7 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack + if (this.keepAlivePending) { + if (!this.processedDisconnect && elapsedTime >= KEEPALIVE_LIMIT) { // check keepalive limit, don't fire if already disconnected + ServerGamePacketListenerImpl.LOGGER.warn("{} was kicked due to keepalive timeout!", this.player.getScoreboardName()); // more info +- this.disconnect(ServerCommonPacketListenerImpl.TIMEOUT_DISCONNECTION_MESSAGE); ++ this.disconnect(ServerCommonPacketListenerImpl.TIMEOUT_DISCONNECTION_MESSAGE, org.bukkit.event.player.PlayerKickEvent.Cause.TIMEOUT); // Paper - kick event cause + } + } else { + if (elapsedTime >= 15000L) { // 15 seconds @@ -250,18 +250,28 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack } diff --git a/patches/server/0632-Fixes-kick-event-leave-message-not-being-sent.patch b/patches/server/0632-Fixes-kick-event-leave-message-not-being-sent.patch index 9a22e33ce9..c0df3e2eed 100644 --- a/patches/server/0632-Fixes-kick-event-leave-message-not-being-sent.patch +++ b/patches/server/0632-Fixes-kick-event-leave-message-not-being-sent.patch @@ -17,7 +17,7 @@ index 2265259b24ae27a85beea1d47ec2c1bae6baa2a7..552d64e47f17d916a4e374b877d12ff7 public boolean isRealPlayer; // Paper public final com.destroystokyo.paper.util.misc.PooledLinkedHashSets.PooledObjectLinkedOpenHashSet cachedSingleHashSet; // Paper diff --git a/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java -index 877dd962a689c016668d1144ad2fef850fdbc31e..2a1cf4ff3d0cc062b593f5c58ee80b00395b097e 100644 +index 2f39206c85dbf4e34dca591d1e0ab9f372730013..ff01c0e7f1d84a4a6e2684446ef1172754ddc570 100644 --- a/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java @@ -77,6 +77,11 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack