From 22dcde52c9b2e20ae5cb3339f8a2c0ce78b0f929 Mon Sep 17 00:00:00 2001 From: Thinkofname Date: Sun, 24 Apr 2016 17:35:59 +0100 Subject: Ignore movement packets from dead players. As funny as the idea sounds of having corpses sliding around it shouldn't really be allowed. Due to other checks added by CB previously this was mostly harmless anyway. --- nms-patches/PlayerConnection.patch | 29 +++++++++++++++++++++++------ 1 file changed, 23 insertions(+), 6 deletions(-) diff --git a/nms-patches/PlayerConnection.patch b/nms-patches/PlayerConnection.patch index f7329729..da3ef692 100644 --- a/nms-patches/PlayerConnection.patch +++ b/nms-patches/PlayerConnection.patch @@ -273,6 +273,15 @@ this.minecraftServer.getPlayerList().d(this.player); this.player.checkMovement(this.player.locX - d0, this.player.locY - d1, this.player.locZ - d2); this.D = d11 >= -0.03125D && !this.minecraftServer.getAllowFlight() && !worldserver.d(entity.getBoundingBox().g(0.0625D).a(0.0D, -0.55D, 0.0D)); +@@ -263,7 +441,7 @@ + } else { + WorldServer worldserver = this.minecraftServer.getWorldServer(this.player.dimension); + +- if (!this.player.viewingCredits) { ++ if (!this.player.viewingCredits && !this.player.dead) { // CraftBukkit - Added ' && !this.player.dead' + if (this.e == 0) { + this.d(); + } @@ -273,13 +451,21 @@ this.A = this.e; this.a(this.teleportPos.x, this.teleportPos.y, this.teleportPos.z, this.player.yaw, this.player.pitch); @@ -1460,7 +1469,15 @@ if (ItemStack.matches(packetplayinwindowclick.e(), itemstack)) { this.player.playerConnection.sendPacket(new PacketPlayOutTransaction(packetplayinwindowclick.a(), packetplayinwindowclick.d(), true)); this.player.f = true; -@@ -915,8 +1914,48 @@ +@@ -881,6 +1880,7 @@ + + public void a(PacketPlayInEnchantItem packetplayinenchantitem) { + PlayerConnectionUtils.ensureMainThread(packetplayinenchantitem, this, this.player.x()); ++ if (this.player.dead) return; // CraftBukkit + this.player.resetIdleTimer(); + if (this.player.activeContainer.windowId == packetplayinenchantitem.a() && this.player.activeContainer.c(this.player) && !this.player.isSpectator()) { + this.player.activeContainer.a(this.player, packetplayinenchantitem.b()); +@@ -915,8 +1915,48 @@ } boolean flag1 = packetplayinsetcreativeslot.a() >= 1 && packetplayinsetcreativeslot.a() <= 45; @@ -1510,7 +1527,7 @@ if (flag1 && flag2 && flag3) { if (itemstack == null) { -@@ -940,6 +1979,7 @@ +@@ -940,6 +1980,7 @@ public void a(PacketPlayInTransaction packetplayintransaction) { PlayerConnectionUtils.ensureMainThread(packetplayintransaction, this, this.player.x()); @@ -1518,7 +1535,7 @@ Short oshort = (Short) this.k.get(this.player.activeContainer.windowId); if (oshort != null && packetplayintransaction.b() == oshort.shortValue() && this.player.activeContainer.windowId == packetplayintransaction.a() && !this.player.activeContainer.c(this.player) && !this.player.isSpectator()) { -@@ -950,6 +1990,7 @@ +@@ -950,6 +1991,7 @@ public void a(PacketPlayInUpdateSign packetplayinupdatesign) { PlayerConnectionUtils.ensureMainThread(packetplayinupdatesign, this, this.player.x()); @@ -1526,7 +1543,7 @@ this.player.resetIdleTimer(); WorldServer worldserver = this.minecraftServer.getWorldServer(this.player.dimension); BlockPosition blockposition = packetplayinupdatesign.a(); -@@ -966,14 +2007,30 @@ +@@ -966,14 +2008,30 @@ if (!tileentitysign.b() || tileentitysign.c() != this.player) { this.minecraftServer.warning("Player " + this.player.getName() + " just tried to change non-editable sign"); @@ -1558,7 +1575,7 @@ tileentitysign.update(); worldserver.notify(blockposition, iblockdata, iblockdata, 3); -@@ -996,11 +2053,27 @@ +@@ -996,11 +2054,27 @@ public void a(PacketPlayInAbilities packetplayinabilities) { PlayerConnectionUtils.ensureMainThread(packetplayinabilities, this, this.player.x()); @@ -1587,7 +1604,7 @@ ArrayList arraylist = Lists.newArrayList(); Iterator iterator = this.minecraftServer.tabCompleteCommand(this.player, packetplayintabcomplete.a(), packetplayintabcomplete.b(), packetplayintabcomplete.c()).iterator(); -@@ -1334,12 +2407,34 @@ +@@ -1334,12 +2408,34 @@ packetdataserializer.release(); } } -- cgit v1.2.3