From 76c595e2559fa6e81a7b336d104847cd836d764a Mon Sep 17 00:00:00 2001 From: Rammelkast Date: Mon, 20 Apr 2020 15:34:45 +0200 Subject: [PATCH] Removed unused timer check --- .../anticheatreloaded/check/Backend.java | 22 +------------------ .../check/movement/GlideCheck.java | 4 +++- .../config/providers/Magic.java | 8 ------- src/main/resources/magic.yml | 6 ----- 4 files changed, 4 insertions(+), 36 deletions(-) diff --git a/src/main/java/com/rammelkast/anticheatreloaded/check/Backend.java b/src/main/java/com/rammelkast/anticheatreloaded/check/Backend.java index a8bb276..25c763f 100644 --- a/src/main/java/com/rammelkast/anticheatreloaded/check/Backend.java +++ b/src/main/java/com/rammelkast/anticheatreloaded/check/Backend.java @@ -372,27 +372,6 @@ public class Backend { return PASS; } - public CheckResult checkTimer(Player player) { - UUID uuid = player.getUniqueId(); - int step = 1; - if (steps.containsKey(uuid)) { - step = steps.get(uuid) + 1; - } - if (step == 1) { - stepTime.put(uuid, System.currentTimeMillis()); - } - incrementOld(player, steps, step); - if (step == magic.TIMER_STEP_CHECK()) { - long time = System.currentTimeMillis() - stepTime.get(uuid); - steps.put(uuid, 0); - if (time < magic.TIMER_TIMEMIN()) { - return new CheckResult(CheckResult.Result.FAILED, "tried to alter their timer, took " + step - + " steps in " + time + " ms (min = " + magic.TIMER_TIMEMIN() + " ms)"); - } - } - return PASS; - } - public void logAscension(Player player, double y1, double y2) { UUID name = player.getUniqueId(); if (y1 < y2 && !isAscending.contains(name)) { @@ -414,6 +393,7 @@ public class Backend { && !justBroke(player) && !Utilities.isClimbableBlock(player.getLocation().getBlock()) && !player.isInsideVehicle() && !YAxisCheck.isMoveUpBlock(player.getLocation().add(0, -1, 0).getBlock()) && !YAxisCheck.isMoveUpBlock(player.getLocation().add(0, -1.5, 0).getBlock())) { + // TODO isMoveUpBlock does not seem to be a success with stairs if (y1 < y2) { if (!block.getRelative(BlockFace.NORTH).isLiquid() && !block.getRelative(BlockFace.SOUTH).isLiquid() && !block.getRelative(BlockFace.EAST).isLiquid() diff --git a/src/main/java/com/rammelkast/anticheatreloaded/check/movement/GlideCheck.java b/src/main/java/com/rammelkast/anticheatreloaded/check/movement/GlideCheck.java index f3e3354..1a3dd5b 100644 --- a/src/main/java/com/rammelkast/anticheatreloaded/check/movement/GlideCheck.java +++ b/src/main/java/com/rammelkast/anticheatreloaded/check/movement/GlideCheck.java @@ -80,7 +80,9 @@ public class GlideCheck { } } } else { - // TODO more sophisticated check + if (fallDistance > LAST_FALL_DISTANCE.get(player.getUniqueId()) && !player.isOnGround()) { + // TODO check gravity + } } LAST_DIFFERENCE.put(player.getUniqueId(), distance.getYDifference()); LAST_FALL_DISTANCE.put(player.getUniqueId(), player.getFallDistance()); diff --git a/src/main/java/com/rammelkast/anticheatreloaded/config/providers/Magic.java b/src/main/java/com/rammelkast/anticheatreloaded/config/providers/Magic.java index a260caf..553c403 100644 --- a/src/main/java/com/rammelkast/anticheatreloaded/config/providers/Magic.java +++ b/src/main/java/com/rammelkast/anticheatreloaded/config/providers/Magic.java @@ -350,14 +350,6 @@ public interface Magic { * The minimum time it should have taken for the player to click X times; Type=INTEGER; Leniency=INCREASE. */ public int INVENTORY_TIMEMIN(); - /** - * The number of steps we should wait before checking if the player has used timer cheating; Type=INTEGER; Leniency=INCREASE. - */ - public int TIMER_STEP_CHECK(); - /** - * The minimum time it should have taken for the player to travel X steps; Type=SYSTEM; Leniency=DECREASE. - */ - public int TIMER_TIMEMIN(); /** * Minimum travel distance for move to be considered a teleport and subsequently be ignored; Type=INTEGER, Leniency=INCREASE. */ diff --git a/src/main/resources/magic.yml b/src/main/resources/magic.yml index 780ed38..70aa925 100644 --- a/src/main/resources/magic.yml +++ b/src/main/resources/magic.yml @@ -166,12 +166,6 @@ TELEPORT_MIN: 400 # Time to exempt a player from moving because of teleporting # Increase in case of false positives TELEPORT_TIME: 1000 -# The number of steps we should wait before checking if the player has used timer cheating -# Increase in case of false positives -TIMER_STEP_CHECK: 50 -# The minimum time it should have taken for the player to travel X steps -# Decrease in case of false positives -TIMER_TIMEMIN: 2000 # Maximum time a player is considered to have a change in velocity # This is a set value and shouldn't be changed unless you know what you're doing VELOCITY_CHECKTIME: 2100