diff options
author | Dinnerbone <dinnerbone@dinnerbone.com> | 2011-03-08 23:18:14 +0000 |
---|---|---|
committer | Dinnerbone <dinnerbone@dinnerbone.com> | 2011-03-08 23:18:14 +0000 |
commit | c607d212d4f264ce6cb0da51caf175af0f0f092d (patch) | |
tree | 1bcee5f5fd16e2fb2c057016f5e0812fd0c2a30b /src/main/java/net/minecraft/server/NetServerHandler.java | |
parent | cdcb9475325e0aec73ffc0138ef7110231b9eec9 (diff) | |
download | craftbukkit-c607d212d4f264ce6cb0da51caf175af0f0f092d.tar craftbukkit-c607d212d4f264ce6cb0da51caf175af0f0f092d.tar.gz craftbukkit-c607d212d4f264ce6cb0da51caf175af0f0f092d.tar.lz craftbukkit-c607d212d4f264ce6cb0da51caf175af0f0f092d.tar.xz craftbukkit-c607d212d4f264ce6cb0da51caf175af0f0f092d.zip |
(Probably) fixed the sign exploit
Diffstat (limited to 'src/main/java/net/minecraft/server/NetServerHandler.java')
-rw-r--r-- | src/main/java/net/minecraft/server/NetServerHandler.java | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/main/java/net/minecraft/server/NetServerHandler.java b/src/main/java/net/minecraft/server/NetServerHandler.java index 8486188b..dc1621ff 100644 --- a/src/main/java/net/minecraft/server/NetServerHandler.java +++ b/src/main/java/net/minecraft/server/NetServerHandler.java @@ -776,6 +776,17 @@ public class NetServerHandler extends NetHandler implements ICommandListener { // CraftBukkit start if (this.e.world.f(packet130updatesign.a, packet130updatesign.b, packet130updatesign.c)) { TileEntity tileentity = this.e.world.getTileEntity(packet130updatesign.a, packet130updatesign.b, packet130updatesign.c); + if (tileentity instanceof TileEntitySign) { + TileEntitySign sign = (TileEntitySign)tileentity; + if (!sign.fresh) { + int x = packet130updatesign.a; + int y = packet130updatesign.b; + int z = packet130updatesign.c; + server.getLogger().severe("Player " + getPlayer().getName() + "/" + getPlayer().getAddress().toString() + " just tried to change the sign text at " + + x + "," + y + "," + z + " - very likely an exploit attempt. Recommend ban."); + return; + } + } // CraftBukkit end int i; @@ -817,6 +828,8 @@ public class NetServerHandler extends NetHandler implements ICommandListener { for (int l = 0; l < 4; ++l) { event.setLine(l, ""); } + } else { + tileentitysign.fresh = false; } // CraftBukkit end |