mirror of
https://github.com/darksaid98/AntiCheatReloaded.git
synced 2026-12-02 22:16:03 +00:00
Quick fix for alt-freeze exploit, more soon.
This commit is contained in:
1 parent
c76b462199
commit
32a762298f
2 files changed
+26
-2
No files matched your search
@@ -292,7 +292,11 @@ public class PlayerListener extends EventListener
|
|||||||
Distance distance = new Distance(from, to);
|
Distance distance = new Distance(from, to);
|
||||||
double y = distance.getYDifference();
|
double y = distance.getYDifference();
|
||||||
backend.logAscension(player, from.getY(), to.getY());
|
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);
|
||||||
|
}
|
||||||
if (checkManager.willCheck(player, CheckType.SPRINT))
|
if (checkManager.willCheck(player, CheckType.SPRINT))
|
||||||
{
|
{
|
||||||
if (backend.checkSprintStill(player, from, to))
|
if (backend.checkSprintStill(player, from, to))
|
||||||
|
|||||||
@@ -92,6 +92,7 @@ public class Backend
|
|||||||
private Map<String, Integer> steps = new HashMap<String, Integer>();
|
private Map<String, Integer> steps = new HashMap<String, Integer>();
|
||||||
private Map<String, Long> stepTime = new HashMap<String, Long>();
|
private Map<String, Long> stepTime = new HashMap<String, Long>();
|
||||||
private HashSet<Byte> transparent = new HashSet<Byte>();
|
private HashSet<Byte> transparent = new HashSet<Byte>();
|
||||||
|
private Map<String, Long> lastFallPacket = new HashMap<String, Long>();
|
||||||
|
|
||||||
private Magic magic;
|
private Magic magic;
|
||||||
private AnticheatManager micromanage = null;
|
private AnticheatManager micromanage = null;
|
||||||
@@ -167,6 +168,25 @@ public class Backend
|
|||||||
inventoryChanges.remove(pN);
|
inventoryChanges.remove(pN);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean checkFreeze(Player player, double from, double to)
|
||||||
|
{
|
||||||
|
if((from-to) > 0)
|
||||||
|
{
|
||||||
|
boolean flag = false;
|
||||||
|
if(lastFallPacket.containsKey(player.getName()) && lastFallPacket.get(player.getName()) > 0)
|
||||||
|
{
|
||||||
|
flag = (System.currentTimeMillis()-lastFallPacket.get(player.getName())) > 1000;
|
||||||
|
}
|
||||||
|
lastFallPacket.put(player.getName(), System.currentTimeMillis());
|
||||||
|
return flag;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
lastFallPacket.put(player.getName(), -1L);
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
public boolean checkFastBow(Player player, float force)
|
public boolean checkFastBow(Player player, float force)
|
||||||
{
|
{
|
||||||
// Ignore magic numbers here, they are minecrafty vanilla stuff.
|
// Ignore magic numbers here, they are minecrafty vanilla stuff.
|
||||||
@@ -705,7 +725,7 @@ public class Backend
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
isAscending.remove(player.getName());
|
isAscending.remove(name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user