mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-15 07:01:36 +08:00
Don't send keepalive logger message if we've already disconnected
This commit is contained in:
parent
1f2e01ba79
commit
cdce4486d8
@ -1,4 +1,4 @@
|
|||||||
From 584178f424f4af724835fd985b7c841bde8a3998 Mon Sep 17 00:00:00 2001
|
From 721eff99f0e560a9ce738bdd80183a7ca74d75fe Mon Sep 17 00:00:00 2001
|
||||||
From: Shane Freeder <theboyetronic@gmail.com>
|
From: Shane Freeder <theboyetronic@gmail.com>
|
||||||
Date: Sun, 15 Oct 2017 00:29:07 +0100
|
Date: Sun, 15 Oct 2017 00:29:07 +0100
|
||||||
Subject: [PATCH] Increase time allowed for a keepalive reply
|
Subject: [PATCH] Increase time allowed for a keepalive reply
|
||||||
@ -10,7 +10,7 @@ tempermental due to lag spikes on the network thread, e.g. that caused
|
|||||||
by plugins that are interacting with netty.
|
by plugins that are interacting with netty.
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java
|
diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java
|
||||||
index 26fbb30f9..5bb6d9fac 100644
|
index 26fbb30f9..71fae9450 100644
|
||||||
--- a/src/main/java/net/minecraft/server/PlayerConnection.java
|
--- a/src/main/java/net/minecraft/server/PlayerConnection.java
|
||||||
+++ b/src/main/java/net/minecraft/server/PlayerConnection.java
|
+++ b/src/main/java/net/minecraft/server/PlayerConnection.java
|
||||||
@@ -179,18 +179,25 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable {
|
@@ -179,18 +179,25 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable {
|
||||||
@ -33,7 +33,7 @@ index 26fbb30f9..5bb6d9fac 100644
|
|||||||
+ long elapsedTime = currentTime - this.getLastPing();
|
+ long elapsedTime = currentTime - this.getLastPing();
|
||||||
+ if (this.isPendingPing()) {
|
+ if (this.isPendingPing()) {
|
||||||
+ // We're pending a ping from the client
|
+ // We're pending a ping from the client
|
||||||
+ if (elapsedTime >= 30000L) { // 30 seconds for a ping reply
|
+ if (!this.processedDisconnect && elapsedTime >= 30000L) { // 30 seconds for a ping reply also, don't fire if already disconnected
|
||||||
+ PlayerConnection.LOGGER.warn("{} was kicked due to keepalive timeout!", this.player.getName()); // more info
|
+ PlayerConnection.LOGGER.warn("{} was kicked due to keepalive timeout!", this.player.getName()); // more info
|
||||||
+ this.disconnect(new ChatMessage("disconnect.timeout"));
|
+ this.disconnect(new ChatMessage("disconnect.timeout"));
|
||||||
+ }
|
+ }
|
Loading…
Reference in New Issue
Block a user