Skip to content
This repository has been archived by the owner on Aug 23, 2022. It is now read-only.

Commit

Permalink
Fixed a few false flags
Browse files Browse the repository at this point in the history
  • Loading branch information
MSWS committed Mar 17, 2019
1 parent f956c7c commit 3fd51e4
Show file tree
Hide file tree
Showing 8 changed files with 26 additions and 23 deletions.
6 changes: 3 additions & 3 deletions dependency-reduced-pom.xml
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>AntiCheat</groupId>
<artifactId>AntiCheat</artifactId>
<groupId>NOPE</groupId>
<artifactId>NOPE</artifactId>
<version>0.0.1-SNAPSHOT</version>
<build>
<sourceDirectory>src</sourceDirectory>
Expand All @@ -19,7 +19,7 @@
</includes>
</resource>
</resources>
<finalName>AntiCheat</finalName>
<finalName>NOPE</finalName>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion plugin.yml
@@ -1,6 +1,6 @@
name: NOPE
main: org.mswsplex.anticheat.msws.NOPE
version: 1.1.1
version: 1.1.3
description: 1.8 Minecraft Anticheat
commands:
nope:
Expand Down
6 changes: 3 additions & 3 deletions pom.xml
Expand Up @@ -2,11 +2,11 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>AntiCheat</groupId>
<artifactId>AntiCheat</artifactId>
<groupId>NOPE</groupId>
<artifactId>NOPE</artifactId>
<version>0.0.1-SNAPSHOT</version>
<build>
<finalName>AntiCheat</finalName>
<finalName>NOPE</finalName>
<sourceDirectory>src</sourceDirectory>
<resources>
<resource>
Expand Down
7 changes: 6 additions & 1 deletion src/org/mswsplex/anticheat/checks/combat/AntiKB1.java
Expand Up @@ -57,13 +57,18 @@ public void onEntityDamageByEntity(EntityDamageByEntityEvent event) {

Location origin = player.getLocation();

if (plugin.getTPS() < 18)
return;

new BukkitRunnable() {
@Override
public void run() {
double dist = player.getLocation().distanceSquared(origin);
if (dist > 0)
return;
cp.flagHack(AntiKB1.this, 10);
if (plugin.getTPS() < 15)
return;
cp.flagHack(AntiKB1.this, 10, "TPS: &e" + plugin.getTPS());
}
}.runTaskLater(plugin, 5);
}
Expand Down
6 changes: 4 additions & 2 deletions src/org/mswsplex/anticheat/checks/combat/KillAura5.java
Expand Up @@ -48,7 +48,10 @@ public void onEntityDamgedByEntity(EntityDamageByEntityEvent event) {

if (diff == 0)
return;


if (plugin.getTPS() < 18)
return;

cp.flagHack(this, (int) Math.round(diff * 5) + 20, "Invalid Packet Diff: &e" + diff);
}

Expand All @@ -69,7 +72,6 @@ public boolean lagBack() {

@Override
public boolean onlyLegacy() {
// TODO Auto-generated method stub
return false;
}
}
6 changes: 3 additions & 3 deletions src/org/mswsplex/anticheat/checks/tick/Timer1.java
Expand Up @@ -67,8 +67,8 @@ public void onMove(PlayerMoveEvent event) {
avg += time;
avg /= averageTimings.size();

if (Math.round(lagTicks - avg) > 5) {
cp.flagHack(this, (int) (Math.round(lagTicks - avg) - 5) * 3, "&7Lag\n&7 Avg: &e" + avg
if (Math.round(lagTicks - avg) > 6) {
cp.flagHack(this, (int) (Math.round(lagTicks - avg) - 5) * 2, "&7Lag\n&7 Avg: &e" + avg
+ "\n&7 Current: &e" + lagTicks + "\n\n&7TPS: &e" + plugin.getTPS());
}
}
Expand Down Expand Up @@ -98,7 +98,7 @@ public String getDebugName() {

@Override
public boolean lagBack() {
return true;
return false;
}

@Override
Expand Down
8 changes: 4 additions & 4 deletions src/org/mswsplex/anticheat/data/CPlayer.java
Expand Up @@ -355,17 +355,17 @@ public void flagHack(Check check, int vl, String debug) {
MSG.tell("nope.message.banwave", message);
MSG.sendPluginMessage(null, "perm:anticheat.message.banwave " + message);
addLogMessage("");
addLogMessage("BANWAVE check:" + check.getDebugName() + " VL: " + (nVl - vl) + " (+" + vl + ") time:"
+ System.currentTimeMillis());
addLogMessage("BANWAVE check:" + check.getDebugName() + " VL: " + (nVl - vl) + " (+" + vl + ") TPS: "
+ plugin.getTPS() + " time:" + System.currentTimeMillis());
String token = MSG.genUUID(16);
saveLog(check.getCategory(), Timing.BANWAVE, token);
setSaveData("isBanwaved", check.getCategory());
MSG.sendPluginMessage(null, "banwave:" + player.getName() + " " + check.getCategory());
addLogMessage("BANWAVE Log ID: " + token);
addLogMessage("");
} else {
addLogMessage("Flagged check:" + check.getDebugName() + " VL: " + (nVl - vl) + " (+" + vl + ") time:"
+ System.currentTimeMillis());
addLogMessage("Flagged check:" + check.getDebugName() + " VL: " + (nVl - vl) + " (+" + vl + ") TPS: "
+ plugin.getTPS() + " time:" + System.currentTimeMillis());
}

if (nVl >= plugin.config.getInt("VlForInstaBan"))
Expand Down
8 changes: 2 additions & 6 deletions src/org/mswsplex/anticheat/scoreboard/SBoard.java
Expand Up @@ -31,14 +31,14 @@ public SBoard(NOPE plugin) {

vlRankings = new ArrayList<>();

name = "&4&lNOPE&c&l Violations";
name = "&c&lViolations";

register();
}

private List<String> vlRankings;

public static <K, V extends Comparable<? super V>> Map<K, V> sortByValue(Map<K, V> map) {
public <K, V extends Comparable<? super V>> Map<K, V> sortByValue(Map<K, V> map) {
List<Entry<K, V>> list = new ArrayList<>(map.entrySet());
list.sort(Entry.comparingByValue());

Expand Down Expand Up @@ -172,10 +172,6 @@ private void refresh(Player player) {
boolean keep = false;
if (vlRankings.contains(res))
keep = true;
// for (String line : vlRankings) {
// if (parse(player, res).equals(parse(player, line)))
// keep = true;
// }
if (!keep)
board.resetScores(res);
}
Expand Down

0 comments on commit 3fd51e4

Please sign in to comment.