summaryrefslogtreecommitdiffstats
path: root/src/main/java/net/minecraft/server/NetServerHandler.java
diff options
context:
space:
mode:
authorEvilSeph <evilseph@unaligned.org>2011-04-13 20:57:43 -0400
committerEvilSeph <evilseph@unaligned.org>2011-04-13 21:14:04 -0400
commit2c1f336e97e51c96c26803064eee8a32dd55cae2 (patch)
tree80aa8cdefb7987da6ed502d5e02e85f510c12732 /src/main/java/net/minecraft/server/NetServerHandler.java
parentf34f41a471715395a30e113c740eac239247e8be (diff)
downloadcraftbukkit-2c1f336e97e51c96c26803064eee8a32dd55cae2.tar
craftbukkit-2c1f336e97e51c96c26803064eee8a32dd55cae2.tar.gz
craftbukkit-2c1f336e97e51c96c26803064eee8a32dd55cae2.tar.lz
craftbukkit-2c1f336e97e51c96c26803064eee8a32dd55cae2.tar.xz
craftbukkit-2c1f336e97e51c96c26803064eee8a32dd55cae2.zip
Fixed an oversight allowing players to set invalid positions.
Diffstat (limited to 'src/main/java/net/minecraft/server/NetServerHandler.java')
-rw-r--r--src/main/java/net/minecraft/server/NetServerHandler.java24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/main/java/net/minecraft/server/NetServerHandler.java b/src/main/java/net/minecraft/server/NetServerHandler.java
index 512b3791..0951937b 100644
--- a/src/main/java/net/minecraft/server/NetServerHandler.java
+++ b/src/main/java/net/minecraft/server/NetServerHandler.java
@@ -149,6 +149,30 @@ public class NetServerHandler extends NetHandler implements ICommandListener {
player.kickPlayer("Nope!");
return;
}
+
+ if (Double.isNaN(packet10flying.a) || packet10flying.a == Double.POSITIVE_INFINITY || packet10flying.a == Double.NEGATIVE_INFINITY) {
+ System.err.println(player.getName() + " was caught trying to set an invalid position.");
+ player.kickPlayer("Nope!");
+ return;
+ }
+
+ if (Double.isNaN(packet10flying.b) || packet10flying.b == Double.POSITIVE_INFINITY || packet10flying.b == Double.NEGATIVE_INFINITY) {
+ System.err.println(player.getName() + " was caught trying to set an invalid position.");
+ player.kickPlayer("Nope!");
+ return;
+ }
+
+ if (Double.isNaN(packet10flying.c) || packet10flying.c == Double.POSITIVE_INFINITY || packet10flying.c == Double.NEGATIVE_INFINITY) {
+ System.err.println(player.getName() + " was caught trying to set an invalid position.");
+ player.kickPlayer("Nope!");
+ return;
+ }
+
+ if (Double.isNaN(packet10flying.d) || packet10flying.d == Double.POSITIVE_INFINITY || packet10flying.d == Double.NEGATIVE_INFINITY) {
+ System.err.println(player.getName() + " was caught trying to set an invalid position.");
+ player.kickPlayer("Nope!");
+ return;
+ }
// CraftBukkit end
if (this.l) {