13
0
geforkt von Mirrors/Paper
Paper/CraftBukkit-Patches/0030-Kick-player-on-exception-for-built-in-PluginChannels.patch
Aikar e9950b70d3 Overhaul to Timings and Entity Activation Range
This greatly extends the timings improvements I've done in recent commits, and brings timings to fully cover the entire tick.
The timings system also now tracks when specific timings causes the server to lose TPS.
The timings are also able to be turned on "on demand", meaning you do not need to restart the server to enable them.

This commit also overhauls the Entity Activation Range feature, fixing bugs, adding more immunities, and improving the performance of it.
It also fixes a regression with a recent Spigot commit that broke the entire Entity Activation Range feature.

This commit had to move the Tick Loop patch before timings because there was a change done there to time the entire tick, so lots of renames.

These 2 commits had to be bundled together to simplify applying them and reduce redundant conflict resolution.
2013-02-27 07:29:33 +11:00

78 Zeilen
4.0 KiB
Diff

From f79f9c8a4b8dea443b5477c742d76f4ca8a780bb Mon Sep 17 00:00:00 2001
From: Eimref <me@eimref.com>
Date: Wed, 6 Feb 2013 18:59:07 -0500
Subject: [PATCH] Kick player on exception for built-in PluginChannels; Fixes
BUKKIT-3583
---
src/main/java/net/minecraft/server/PlayerConnection.java | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java
index d2c2305..b960a87 100644
--- a/src/main/java/net/minecraft/server/PlayerConnection.java
+++ b/src/main/java/net/minecraft/server/PlayerConnection.java
@@ -1481,6 +1481,7 @@ public class PlayerConnection extends Connection {
}
} catch (Exception exception) {
exception.printStackTrace();
+ this.disconnect("Invalid book data!"); // CraftBukkit - prevent exception spam
}
} else if ("MC|BSign".equals(packet250custompayload.tag)) {
try {
@@ -1498,9 +1499,8 @@ public class PlayerConnection extends Connection {
itemstack1.id = Item.WRITTEN_BOOK.id;
}
} catch (Exception exception1) {
- // CraftBukkit start
- // exception1.printStackTrace();
- // CraftBukkit end
+ exception1.printStackTrace();
+ this.disconnect("Invalid book data!"); // CraftBukkit - prevent exception spam
}
} else {
int i;
@@ -1516,6 +1516,7 @@ public class PlayerConnection extends Connection {
}
} catch (Exception exception2) {
exception2.printStackTrace();
+ this.disconnect("Invalid trade data!"); // CraftBukkit - prevent exception spam
}
} else {
int j;
@@ -1539,6 +1540,7 @@ public class PlayerConnection extends Connection {
}
} catch (Exception exception3) {
exception3.printStackTrace();
+ this.disconnect("Invalid CommandBlock data!"); // CraftBukkit - prevent exception spam
}
} else {
this.player.sendMessage(this.player.a("advMode.notAllowed", new Object[0]));
@@ -1562,6 +1564,7 @@ public class PlayerConnection extends Connection {
}
} catch (Exception exception4) {
exception4.printStackTrace();
+ this.disconnect("Invalid beacon data!"); // CraftBukkit - prevent exception spam
}
}
} else if ("MC|ItemName".equals(packet250custompayload.tag) && this.player.activeContainer instanceof ContainerAnvil) {
@@ -1586,6 +1589,7 @@ public class PlayerConnection extends Connection {
}
} catch (UnsupportedEncodingException ex) {
Logger.getLogger(PlayerConnection.class.getName()).log(Level.SEVERE, "Could not parse REGISTER payload in plugin message packet", ex);
+ throw new AssertionError("UTF-8 is an unknown encoding");
}
} else if (packet250custompayload.tag.equals("UNREGISTER")) {
try {
@@ -1595,6 +1599,7 @@ public class PlayerConnection extends Connection {
}
} catch (UnsupportedEncodingException ex) {
Logger.getLogger(PlayerConnection.class.getName()).log(Level.SEVERE, "Could not parse UNREGISTER payload in plugin message packet", ex);
+ throw new AssertionError("UTF-8 is an unknown encoding");
}
} else {
server.getMessenger().dispatchIncomingMessage(player.getBukkitEntity(), packet250custompayload.tag, packet250custompayload.data);
--
1.8.1.1