Skip to content

Commit

Permalink
Fixed false positives and errors. changed version to 2.10.0
Browse files Browse the repository at this point in the history
  • Loading branch information
funkemunky committed Sep 8, 2020
1 parent d544248 commit 4f30561
Show file tree
Hide file tree
Showing 10 changed files with 51 additions and 28 deletions.
2 changes: 1 addition & 1 deletion API/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>Kauri</artifactId>
<groupId>dev.brighten.anticheat</groupId>
<version>2.9.2</version>
<version>2.10.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion Free/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>Kauri</artifactId>
<groupId>dev.brighten.anticheat</groupId>
<version>2.9.2</version>
<version>2.10.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion Impl/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>Kauri</artifactId>
<groupId>dev.brighten.anticheat</groupId>
<version>2.9.2</version>
<version>2.10.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
4 changes: 2 additions & 2 deletions Premium/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>Kauri</artifactId>
<groupId>dev.brighten.anticheat</groupId>
<version>2.9.2</version>
<version>2.10.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down Expand Up @@ -59,7 +59,7 @@
<groupId>dev.brighten.anticheat</groupId>
<artifactId>Impl</artifactId>
<version>${parent.version}</version>
<scope>provided</scope>
<scope>compile</scope>
</dependency>
</dependencies>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,15 @@ public void registerChecks() {
Check.register(new ReachB());
//Check.register(new ReachC());
//Check.register(new Motion());
Check.register(new AimG());
Check.register(new AimH());
Check.register(new AimI());
//Check.register(new AimG());
//Check.register(new AimH());
//Check.register(new AimI());
Check.register(new HealthSpoof());
Check.register(new AutoclickerD());
Check.register(new AutoclickerF());
Check.register(new AutoclickerE());
Check.register(new InventoryB());
Check.register(new InventoryC());
//Check.register(new AutoclickerE());
// Check.register(new InventoryB());
// Check.register(new InventoryC());
Check.register(new AutoclickerH());
Check.register(new AutoclickerI());
Check.register(new AutoclickerJ());
Expand Down
2 changes: 1 addition & 1 deletion Regular/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>Kauri</artifactId>
<groupId>dev.brighten.anticheat</groupId>
<version>2.9.2</version>
<version>2.10.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public void onFlying(WrappedInFlyingPacket packet) {
&& Math.abs(data.playerInfo.deltaPitch) > 1E-5) {
if(data.playerInfo.pitchGCD < 100000
&& !data.playerInfo.cinematicMode
&& data.moveProcessor.sensitivityX < 0.44) {
&& Math.abs(data.playerInfo.to.pitch) < 80) {
if(++vl > 28) {
flag("offset=%v deltaPitch=%v", data.playerInfo.pitchGCD, data.playerInfo.deltaPitch);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package dev.brighten.anticheat.check.impl.combat.killaura;

import cc.funkemunky.api.tinyprotocol.packet.in.WrappedInFlyingPacket;
import cc.funkemunky.api.tinyprotocol.packet.in.WrappedInUseEntityPacket;
import cc.funkemunky.api.utils.Color;
import cc.funkemunky.api.utils.KLocation;
import cc.funkemunky.api.utils.MathUtils;
import cc.funkemunky.api.utils.math.cond.MaxInteger;
Expand All @@ -10,10 +12,13 @@
import cc.funkemunky.api.utils.world.types.SimpleCollisionBox;
import dev.brighten.anticheat.check.api.*;
import dev.brighten.api.check.CheckType;
import org.bukkit.Location;
import org.bukkit.util.Vector;

import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
import java.util.Optional;

@CheckInfo(name = "Killaura (A)", description = "Checks for block collisions on player hits.",
checkType = CheckType.KILLAURA, developer = true)
Expand All @@ -22,26 +27,44 @@ public class KillauraA extends Check {

private MaxInteger verbose = new MaxInteger(10);

private int lastAttack;

@Packet
public void onUse(WrappedInUseEntityPacket packet, int current) {
if(data.target == null || packet.getAction() != WrappedInUseEntityPacket.EnumEntityUseAction.ATTACK) return;

lastAttack = current;
}

@Packet
public void onUse(WrappedInUseEntityPacket packet, long current) {
if(data.target == null) return;
KLocation origin = data.playerInfo.to.clone();
origin.y+= data.playerInfo.sneaking ? 1.54f : 1.62f;
public void onFlying(WrappedInFlyingPacket packet, int current) {
if(current - lastAttack == 0) {
Location toLoc = data.playerInfo.to.toLocation(data.getPlayer().getWorld())
.add(0, data.playerInfo.sneaking ? 1.54f : 1.62f, 0);

RayCollision ray = new RayCollision(origin.toVector(), MathUtils.getDirection(origin));
RayCollision from = new RayCollision(data.getPlayer().getEyeLocation().toVector(),
data.getPlayer().getEyeLocation().getDirection()),
to = new RayCollision(toLoc.toVector(), toLoc.getDirection());

List<SimpleCollisionBox> targetBoxes = new ArrayList<>();
Vector sixNineVector = toLoc.toVector().subtract(new Vector(69, 69, 69));

data.targetPastLocation.getEstimatedLocation(data.lagInfo.transPing + 50, 150)
.forEach(loc -> EntityData.getEntityBox(loc, data.target).downCast(targetBoxes));
double distance = data.targetPastLocation.getEstimatedLocation(System.currentTimeMillis(),
(data.lagInfo.transPing + 3) * 50, 100L).stream().mapToDouble(loc -> {
SimpleCollisionBox box = (SimpleCollisionBox) EntityData.getEntityBox(loc, data.target);

double distance = targetBoxes.stream().map(ray::collisionPoint)
.filter(Objects::nonNull).mapToDouble(vec -> vec.distance(origin.toVector())).min().orElse(-1);
return Math.min(Optional.ofNullable(from.collisionPoint(box)).orElse(sixNineVector)
.distance(data.getPlayer().getEyeLocation().toVector()),
Optional.ofNullable(to.collisionPoint(box)).orElse(sixNineVector)
.distance(toLoc.toVector()));
}).min().orElse(0);

if(distance == -1) return;

List<CollisionBox> boxes = ray.boxesOnRay(packet.getPlayer().getWorld(), distance);
int fromBox = from.boxesOnRay(data.getPlayer().getWorld(), distance).size()
, toBox = to.boxesOnRay(data.getPlayer().getWorld(), distance).size();

debug("boxSize=%v", boxes.size());
if(fromBox > 0 && toBox > 0) {
debug(Color.Green + "Flag");
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public void onFlying(WrappedInFlyingPacket packet, long timeStamp) {
&& (!data.playerInfo.clientGround || data.playerInfo.deltaY < predicted)
&& data.playerInfo.blockAboveTimer.hasPassed(5)
&& deltaPredict > 0.016) {
if(++buffer > 2 || (deltaPredict > 0.3 && !data.blockInfo.blocksNear)) {
if(++buffer > 2) {
++vl;
flag("dY=%v.3 p=%v.3 dx=%v.3", data.playerInfo.deltaY, predicted, data.playerInfo.deltaXZ);
}
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<groupId>dev.brighten.anticheat</groupId>
<artifactId>Kauri</artifactId>
<packaging>pom</packaging>
<version>2.9.2</version>
<version>2.10.0</version>
<modules>
<module>API</module>
<module>Impl</module>
Expand Down

0 comments on commit 4f30561

Please sign in to comment.