Skip to content

Commit

Permalink
Fixed errors and false positives
Browse files Browse the repository at this point in the history
  • Loading branch information
funkemunky committed Sep 10, 2020
1 parent 105b5a9 commit 5157ecd
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,6 @@ public void shutdown() {
public List<Log> getLogs(UUID uuid, Check check, int arrayMin, int arrayMax, long timeFrom, long timeTo) {
List<Log> 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 : "")
Expand All @@ -123,8 +122,6 @@ public List<Log> 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;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand Down Expand Up @@ -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()
Expand Down Expand Up @@ -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();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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() + ":@:"
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 5157ecd

Please sign in to comment.