mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-28 07:20:24 +01:00
Fix preemptive connection dropping during shutdown process (#8546)
This commit is contained in:
parent
e9b9c0b332
commit
2402c125aa
2 changed files with 24 additions and 0 deletions
|
@ -53,4 +53,5 @@ Nick Hensel <nickhensel25@icloud.com>
|
||||||
vytskalt <vytskalt@protonmail.com>
|
vytskalt <vytskalt@protonmail.com>
|
||||||
TheFruxz <cedricspitzer@outlook.de>
|
TheFruxz <cedricspitzer@outlook.de>
|
||||||
Kieran Wallbanks <kieran.wallbanks@gmail.com>
|
Kieran Wallbanks <kieran.wallbanks@gmail.com>
|
||||||
|
Denery <dorofeevij@gmail.com>
|
||||||
```
|
```
|
||||||
|
|
23
patches/server/Fix-player-kick-on-shutdown.patch
Normal file
23
patches/server/Fix-player-kick-on-shutdown.patch
Normal file
|
@ -0,0 +1,23 @@
|
||||||
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Denery <dorofeevij@gmail.com>
|
||||||
|
Date: Sun, 6 Nov 2022 02:02:46 +0300
|
||||||
|
Subject: [PATCH] Fix player kick on shutdown
|
||||||
|
|
||||||
|
Fix preemptive player kick on a server shutdown.
|
||||||
|
If you update minecraft version / upstream and something is changed in this method make sure that a server doesn't disconnect a player preemptively,
|
||||||
|
also check if all packets are ignored during the shutdown process.
|
||||||
|
See net.minecraft.network.Connection#channelRead0(ChannelHandlerContext, Packet) and net.minecraft.util.thread.BlockableEventLoop#executeIfPossible(Runnable)
|
||||||
|
|
||||||
|
diff --git a/src/main/java/net/minecraft/network/protocol/PacketUtils.java b/src/main/java/net/minecraft/network/protocol/PacketUtils.java
|
||||||
|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||||
|
--- a/src/main/java/net/minecraft/network/protocol/PacketUtils.java
|
||||||
|
+++ b/src/main/java/net/minecraft/network/protocol/PacketUtils.java
|
||||||
|
@@ -0,0 +0,0 @@ public class PacketUtils {
|
||||||
|
|
||||||
|
public static <T extends PacketListener> void ensureRunningOnSameThread(Packet<T> packet, T listener, BlockableEventLoop<?> engine) throws RunningOnDifferentThreadException {
|
||||||
|
if (!engine.isSameThread()) {
|
||||||
|
- engine.executeIfPossible(() -> {
|
||||||
|
+ engine.execute(() -> { // Paper - Fix preemptive player kick on a server shutdown.
|
||||||
|
packetProcessing.push(listener); // Paper - detailed watchdog information
|
||||||
|
try { // Paper - detailed watchdog information
|
||||||
|
if (MinecraftServer.getServer().hasStopped() || (listener instanceof ServerGamePacketListenerImpl && ((ServerGamePacketListenerImpl) listener).processedDisconnect)) return; // CraftBukkit, MC-142590
|
Loading…
Reference in a new issue