Reset player's last packet time when they leave the server, and kick after logging so things actually log.

This commit is contained in:
h31ix committed 2012-12-18 19:54:53 -05:00
1 parent 5d9f29fc41
commit 089c9fce5d
2 files changed
+6 -2

No files matched your search

@@ -294,9 +294,9 @@ public class PlayerListener extends EventListener
backend.logAscension(player, from.getY(), to.getY());
if (checkManager.willCheck(player, CheckType.SPEED) && backend.checkFreeze(player, from.getY(), to.getY()))
{
player.kickPlayer("Freezing client");
log("tried to freeze in mid-air.", player, CheckType.SPEED);
}
player.kickPlayer("Freezing client");
}
if (checkManager.willCheck(player, CheckType.SPRINT))
{
if (backend.checkSprintStill(player, from, to))
@@ -166,6 +166,7 @@ public class Backend
lastInventoryTime.remove(pN);
inventoryTime.remove(pN);
inventoryClicks.remove(pN);
lastFallPacket.remove(pN);
}
public boolean checkFreeze(Player player, double from, double to)
@@ -242,6 +243,9 @@ public class Backend
}
else
{
if(x > y && x > z) System.out.println(Math.ceil(x));
if(y > x && y > z) System.out.println(Math.ceil(y));
if(z > y && z > x) System.out.println(Math.ceil(z));
return (x >= magic.BLOCK_MAX_DISTANCE || y > magic.BLOCK_MAX_DISTANCE || z > magic.BLOCK_MAX_DISTANCE);
}
}