mirror of
https://github.com/darksaid98/AntiCheatReloaded.git
synced 2026-12-04 14:38:47 +00:00
Re-add timer check for testing
This commit is contained in:
1 parent
2fc17b87ca
commit
38deac94d4
3 files changed
+18
-8
No files matched your search
@@ -88,6 +88,8 @@ public class Backend
|
||||
private Map<String, Long> inventoryTime = new HashMap<String, Long>();
|
||||
private Map<String, Integer> inventoryChanges = new HashMap<String, Integer>();
|
||||
private Map<String, Material> itemInHand = new HashMap<String, Material>();
|
||||
private Map<String, Integer> steps = new HashMap<String, Integer>();
|
||||
private Map<String, Long> stepTime = new HashMap<String, Long>();
|
||||
|
||||
private Magic magic;
|
||||
private AnticheatManager micromanage = null;
|
||||
@@ -556,7 +558,6 @@ public class Backend
|
||||
|
||||
public boolean checkTimer(Player player)
|
||||
{
|
||||
/*
|
||||
String name = player.getName();
|
||||
int step = 1;
|
||||
if(steps.containsKey(name))
|
||||
@@ -565,18 +566,15 @@ public class Backend
|
||||
}
|
||||
if(step == 1)
|
||||
{
|
||||
lastTime.put(name,System.currentTimeMillis());
|
||||
stepTime.put(name,System.currentTimeMillis());
|
||||
}
|
||||
increment(player, steps, step);
|
||||
if(step >= STEP_CHECK)
|
||||
if(step == magic.TIMER_STEP_CHECK)
|
||||
{
|
||||
long time = System.currentTimeMillis()-lastTime.get(name);
|
||||
long time = System.currentTimeMillis()-stepTime.get(name);
|
||||
steps.put(name, 0);
|
||||
if(time < TIME_MIN)
|
||||
{
|
||||
return true;
|
||||
return time < magic.TIMER_TIMEMIN;
|
||||
}
|
||||
}*/
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -332,6 +332,14 @@ public class Magic
|
||||
* Time between inventory changes that triggers inventory violations; Type=integer; +Leniency=Decrease.
|
||||
*/
|
||||
public final int INVENTORY_TIMEMAX;
|
||||
/**
|
||||
* The number of steps we should wait before checking if the player has used timer cheating; Type=integer; +Leniency=Increase.
|
||||
*/
|
||||
public final int TIMER_STEP_CHECK;
|
||||
/**
|
||||
* The minimum time it should have taken for the player to travel X steps; Type=system; +Leniency=Decrease.
|
||||
*/
|
||||
public final long TIMER_TIMEMIN;
|
||||
|
||||
private FileConfiguration defaults;
|
||||
private FileConfiguration magic;
|
||||
@@ -417,6 +425,8 @@ public class Magic
|
||||
INVENTORY_MAXVIOLATIONS = getInt("INVENTORY_MAXVIOLATIONS");
|
||||
INVENTORY_MAXVIOLATIONTIME = getInt("INVENTORY_MAXVIOLATIONTIME");
|
||||
INVENTORY_TIMEMAX = getInt("INVENTORY_TIMEMAX");
|
||||
TIMER_STEP_CHECK = getInt("TIMER_STEP_CHECK");
|
||||
TIMER_TIMEMIN = getLong("TIMER_TIMEMIN");
|
||||
}
|
||||
|
||||
private int getInt(String path)
|
||||
|
||||
@@ -74,3 +74,5 @@ SPEED_MAX: 3
|
||||
INVENTORY_MAXVIOLATIONS: 2
|
||||
INVENTORY_MAXVIOLATIONTIME: 10000
|
||||
INVENTORY_TIMEMAX: 50
|
||||
TIMER_STEP_CHECK: 50
|
||||
TIMER_TIMEMIN: 2000
|
||||
Reference in new issue
Block a user