From 5157ecd01d1c85436bf9a859ab9d2c742f997a55 Mon Sep 17 00:00:00 2001 From: Dawson Hessler Date: Thu, 10 Sep 2020 12:30:34 -0400 Subject: [PATCH] Fixed errors and false positives --- .../brighten/anticheat/check/FreeChecks.java | 2 +- .../check/impl/combat/hitbox/ReachA.java | 2 +- .../anticheat/logs/data/impl/MySQLStorage.java | 3 --- .../anticheat/processing/MovementProcessor.java | 17 +++++++---------- .../anticheat/processing/PacketProcessor.java | 2 -- 5 files changed, 9 insertions(+), 17 deletions(-) diff --git a/Free/src/main/java/dev/brighten/anticheat/check/FreeChecks.java b/Free/src/main/java/dev/brighten/anticheat/check/FreeChecks.java index 8250ebc00..9636d9b58 100644 --- a/Free/src/main/java/dev/brighten/anticheat/check/FreeChecks.java +++ b/Free/src/main/java/dev/brighten/anticheat/check/FreeChecks.java @@ -29,7 +29,7 @@ public void registerChecks() { Check.register(new BadPacketsB()); Check.register(new BadPacketsC()); Check.register(new BadPacketsD()); - Check.register(new BadPacketsE()); + //Check.register(new BadPacketsE()); Check.register(new BadPacketsF()); Check.register(new BadPacketsG()); Check.register(new BadPacketsH()); diff --git a/Free/src/main/java/dev/brighten/anticheat/check/impl/combat/hitbox/ReachA.java b/Free/src/main/java/dev/brighten/anticheat/check/impl/combat/hitbox/ReachA.java index 000e8f1f1..75a9667d2 100644 --- a/Free/src/main/java/dev/brighten/anticheat/check/impl/combat/hitbox/ReachA.java +++ b/Free/src/main/java/dev/brighten/anticheat/check/impl/combat/hitbox/ReachA.java @@ -53,7 +53,7 @@ public void onFlying(WrappedInUseEntityPacket packet, long timeStamp) { } if(data.lagInfo.lastPacketDrop.hasPassed(3)) { - if (distance > 3.15 && distance != 69) { + if (distance > 3.3 && distance != 69) { if (++buffer > 6) { vl++; flag("distance=%v.2 buffer=%v", distance, buffer); diff --git a/Impl/src/main/java/dev/brighten/anticheat/logs/data/impl/MySQLStorage.java b/Impl/src/main/java/dev/brighten/anticheat/logs/data/impl/MySQLStorage.java index f93c64e15..9442ced01 100644 --- a/Impl/src/main/java/dev/brighten/anticheat/logs/data/impl/MySQLStorage.java +++ b/Impl/src/main/java/dev/brighten/anticheat/logs/data/impl/MySQLStorage.java @@ -100,7 +100,6 @@ public void shutdown() { public List getLogs(UUID uuid, Check check, int arrayMin, int arrayMax, long timeFrom, long timeTo) { List logs = new ArrayList<>(); - long start = System.nanoTime(); if(uuid != null) { Query.prepare("SELECT `TIME`, `VL`, `CHECK`, `PING`, `TPS`, `INFO` " + "FROM `VIOLATIONS` WHERE `UUID` = ?"+ (check != null ? " AND WHERE `CHECK` = " + check.name : "") @@ -123,8 +122,6 @@ public List getLogs(UUID uuid, Check check, int arrayMin, int arrayMax, lon rs.getLong("TIME"), rs.getDouble("TPS"))); }); } - long elapsed = System.nanoTime() - start; - System.out.println(String.format("Grabbed logs in %.3fms", elapsed / 1E6D)); return logs; } diff --git a/Impl/src/main/java/dev/brighten/anticheat/processing/MovementProcessor.java b/Impl/src/main/java/dev/brighten/anticheat/processing/MovementProcessor.java index e8cbd09c8..336c7442d 100644 --- a/Impl/src/main/java/dev/brighten/anticheat/processing/MovementProcessor.java +++ b/Impl/src/main/java/dev/brighten/anticheat/processing/MovementProcessor.java @@ -102,11 +102,11 @@ public void process(WrappedInFlyingPacket packet, long timeStamp) { .findFirst(); if (optional.isPresent()) { - //data.playerInfo.serverPos = true; - //data.playerInfo.lastServerPos = timeStamp; - //data.playerInfo.lastTeleportTimer.reset(); - //data.playerInfo.inventoryOpen = false; - //data.playerInfo.posLocs.remove(optional.get()); + data.playerInfo.serverPos = true; + data.playerInfo.lastServerPos = timeStamp; + data.playerInfo.lastTeleportTimer.reset(); + data.playerInfo.inventoryOpen = false; + data.playerInfo.posLocs.remove(optional.get()); } } if (data.playerInfo.serverPos && data.playerInfo.lastTeleportTimer.hasPassed(0)) { @@ -151,9 +151,6 @@ public void process(WrappedInFlyingPacket packet, long timeStamp) { if(timeStamp - data.creation > 400L) data.blockInfo.runCollisionCheck(); //run b4 everything else for use below. } - if(MathUtils.getDelta(deltaY, -0.098) < 0.001) { - data.playerInfo.worldLoaded = false; - } data.playerInfo.inVehicle = data.getPlayer().getVehicle() != null; data.playerInfo.gliding = PlayerUtils.isGliding(data.getPlayer()); data.playerInfo.riptiding = Atlas.getInstance().getBlockBoxManager() @@ -269,8 +266,8 @@ public void process(WrappedInFlyingPacket packet, long timeStamp) { float yaccel = Math.abs(data.playerInfo.deltaYaw) - Math.abs(data.playerInfo.lDeltaYaw), pAccel = Math.abs(data.playerInfo.deltaPitch) - Math.abs(data.playerInfo.lDeltaPitch); - if (MathUtils.getDelta(smoothYaw, data.playerInfo.from.yaw) > (yaccel > 0 ? (yaccel > 10 ? 3 : 1) : 0.1) - || MathUtils.getDelta(smoothPitch, data.playerInfo.from.pitch) > (pAccel > 0 ? (yaccel > 10 ? 3 : 1) : 0.1)) { + if (MathUtils.getDelta(smoothYaw, data.playerInfo.from.yaw) > (yaccel > 0 ? (yaccel > 10 ? 3 : 2) : 0.1) + || MathUtils.getDelta(smoothPitch, data.playerInfo.from.pitch) > (pAccel > 0 ? (yaccel > 10 ? 3 : 2) : 0.1)) { smoothCamYaw = smoothCamPitch = 0; data.playerInfo.cinematicMode = false; mxaxis.reset(); diff --git a/Impl/src/main/java/dev/brighten/anticheat/processing/PacketProcessor.java b/Impl/src/main/java/dev/brighten/anticheat/processing/PacketProcessor.java index 1edd193d6..4f016603e 100644 --- a/Impl/src/main/java/dev/brighten/anticheat/processing/PacketProcessor.java +++ b/Impl/src/main/java/dev/brighten/anticheat/processing/PacketProcessor.java @@ -36,7 +36,6 @@ public synchronized void processClient(PacketReceiveEvent event, ObjectData data data.predictionService.fly = packet.isAllowedFlight(); data.predictionService.walkSpeed = packet.getWalkSpeed(); - data.playerInfo.canFly = packet.isAllowedFlight(); data.checkManager.runPacket(packet, timeStamp); if(data.sniffing) { data.sniffedPackets.add(event.getType() + ":@:" @@ -355,7 +354,6 @@ public synchronized void processServer(PacketSendEvent event, ObjectData data, O data.playerInfo.lastToggleFlight.reset(); } - data.playerInfo.canFly = packet.isAllowedFlight(); data.playerInfo.flying = packet.isFlying(); data.predictionService.fly = packet.isAllowedFlight(); data.checkManager.runPacket(packet, timeStamp);