diff options
author | Aikar <[email protected]> | 2018-01-15 22:13:17 -0500 |
---|---|---|
committer | Aikar <[email protected]> | 2018-01-18 23:19:30 -0500 |
commit | 71c18fd5c9e3520fd8ebc3029be7a56487c77475 (patch) | |
tree | a93e34963ea8c0fb036dbb252a61046ff26efa81 /Spigot-Server-Patches/0241-handle-PacketPlayInKeepAlive-async.patch | |
parent | 2f0e48c89a5ad16ab1479e73188c87b67123673a (diff) | |
download | Paper-71c18fd5c9e3520fd8ebc3029be7a56487c77475.tar.gz Paper-71c18fd5c9e3520fd8ebc3029be7a56487c77475.zip |
Add PlayerProfile API to replace GameProfile
This simply provides the base API to create the objects. Further commits will come that adds
adds usage of this API to existing GameProfile based API's, as well as new API's.
Diffstat (limited to 'Spigot-Server-Patches/0241-handle-PacketPlayInKeepAlive-async.patch')
-rw-r--r-- | Spigot-Server-Patches/0241-handle-PacketPlayInKeepAlive-async.patch | 46 |
1 files changed, 0 insertions, 46 deletions
diff --git a/Spigot-Server-Patches/0241-handle-PacketPlayInKeepAlive-async.patch b/Spigot-Server-Patches/0241-handle-PacketPlayInKeepAlive-async.patch deleted file mode 100644 index 5e6e21a552..0000000000 --- a/Spigot-Server-Patches/0241-handle-PacketPlayInKeepAlive-async.patch +++ /dev/null @@ -1,46 +0,0 @@ -From 563bdc4c1166fc9fb05d51a82119b6f260859ef5 Mon Sep 17 00:00:00 2001 -From: Shane Freeder <[email protected]> -Date: Thu, 5 Oct 2017 01:54:07 +0100 -Subject: [PATCH] handle PacketPlayInKeepAlive async - -In 1.12.2, Mojang moved the processing of PacketPlayInKeepAlive off the main -thread, while entirely correct for the server, this causes issues with -plugins which are expecting the PlayerQuitEvent on the main thread. - -In order to counteract some bad behavior, we will post handling of the -disconnection to the main thread, but leave the actual processing of the packet -off the main thread. - -also adding some additional logging in order to help work out what is causing -random disconnections for clients. - -diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java -index cc58a4a9..a92bf896 100644 ---- a/src/main/java/net/minecraft/server/PlayerConnection.java -+++ b/src/main/java/net/minecraft/server/PlayerConnection.java -@@ -2230,14 +2230,20 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable { - } - - public void a(PacketPlayInKeepAlive packetplayinkeepalive) { -- PlayerConnectionUtils.ensureMainThread(packetplayinkeepalive, this, this.player.x()); // CraftBukkit -+ //PlayerConnectionUtils.ensureMainThread(packetplayinkeepalive, this, this.player.x()); // CraftBukkit // Paper - This shouldn't be on the main thread - if (this.g && packetplayinkeepalive.a() == this.h) { - int i = (int) (this.d() - this.f); - - this.player.ping = (this.player.ping * 3 + i) / 4; - this.g = false; - } else if (!this.player.getName().equals(this.minecraftServer.Q())) { -- this.disconnect(new ChatMessage("disconnect.timeout", new Object[0])); -+ // Paper start - This needs to be handled on the main thread for plugins -+ PlayerConnection.LOGGER.warn("{} sent an invalid keepalive! pending keepalive: {} got id: {} expected id: {}", -+ this.player.getName(), this.isPendingPing(), packetplayinkeepalive.a(), this.getKeepAliveID()); -+ minecraftServer.postToMainThread(() -> { -+ this.disconnect(new ChatMessage("disconnect.timeout", new Object[0])); -+ }); -+ // Paper end - } - - } --- -2.14.3 - |