mirror of
https://github.com/darksaid98/AntiCheatReloaded.git
synced 2026-12-01 14:38:56 +00:00
Fix error with temporary players, continue work on BoatFly
This commit is contained in:
1 parent
09c42905d0
commit
3b9b39c49a
9 files changed
+21
-50
No files matched your search
@@ -18,10 +18,8 @@
|
||||
*/
|
||||
package com.rammelkast.anticheatreloaded.check;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.UUID;
|
||||
|
||||
@@ -56,7 +54,6 @@ import com.rammelkast.anticheatreloaded.util.VersionUtil;
|
||||
public class Backend {
|
||||
public Map<UUID, Long> velocitized = new HashMap<UUID, Long>();
|
||||
private Map<UUID, Long> levitatingEnd = new HashMap<UUID, Long>();
|
||||
private List<UUID> isAscending = new ArrayList<UUID>();
|
||||
private Map<UUID, Integer> chatLevel = new HashMap<UUID, Integer>();
|
||||
private Map<UUID, Integer> commandLevel = new HashMap<UUID, Integer>();
|
||||
private Map<UUID, Integer> nofallViolation = new HashMap<UUID, Integer>();
|
||||
@@ -122,7 +119,6 @@ public class Backend {
|
||||
startEat.remove(uuid);
|
||||
lastHeal.remove(uuid);
|
||||
sprinted.remove(uuid);
|
||||
isAscending.remove(uuid);
|
||||
nofallViolation.remove(uuid);
|
||||
blockBreakHolder.remove(uuid);
|
||||
fastPlaceViolation.remove(uuid);
|
||||
@@ -311,15 +307,6 @@ public class Backend {
|
||||
return PASS;
|
||||
}
|
||||
|
||||
public void logAscension(Player player, double y1, double y2) {
|
||||
UUID name = player.getUniqueId();
|
||||
if (y1 < y2 && !isAscending.contains(name)) {
|
||||
isAscending.add(name);
|
||||
} else {
|
||||
isAscending.remove(name);
|
||||
}
|
||||
}
|
||||
|
||||
public CheckResult checkFastPlace(Player player) {
|
||||
int vlBeforeFlagSurvival = checksConfig.getInteger(CheckType.FAST_PLACE, "vlBeforeFlagSurvival");
|
||||
int vlBeforeFlagCreative = checksConfig.getInteger(CheckType.FAST_PLACE, "vlBeforeFlagCreative");
|
||||
@@ -634,10 +621,6 @@ public class Backend {
|
||||
return isDoing(player, FlightCheck.MOVING_EXEMPT, -1);
|
||||
}
|
||||
|
||||
public boolean isAscending(Player player) {
|
||||
return isAscending.contains(player.getUniqueId());
|
||||
}
|
||||
|
||||
public boolean isDoing(Player player, Map<UUID, Long> map, double max) {
|
||||
if (map.containsKey(player.getUniqueId())) {
|
||||
if (max != -1) {
|
||||
|
||||
@@ -64,7 +64,8 @@ public enum CheckType {
|
||||
FASTLADDER(Permission.CHECK_FASTLADDER, "FastLadder"),
|
||||
AIMBOT(Permission.CHECK_AIMBOT, "Aimbot"),
|
||||
STRAFE(Permission.CHECK_STRAFE, "Strafe"),
|
||||
NOSLOW(Permission.CHECK_NOSLOW, "NoSlow");
|
||||
NOSLOW(Permission.CHECK_NOSLOW, "NoSlow"),
|
||||
BOATFLY(Permission.CHECK_BOATFLY, "BoatFly");
|
||||
|
||||
private final Permission permission;
|
||||
private final String displayName;
|
||||
|
||||
@@ -176,31 +176,4 @@ public class FlightCheck {
|
||||
return PASS;
|
||||
}
|
||||
|
||||
public static boolean isMovingExempt(Player player) {
|
||||
return isDoing(player, MOVING_EXEMPT, -1) || player.isInsideVehicle();
|
||||
}
|
||||
|
||||
private static boolean isDoing(Player player, Map<UUID, Long> map, double max) {
|
||||
if (map.containsKey(player.getUniqueId())) {
|
||||
if (max != -1) {
|
||||
if (((System.currentTimeMillis() - map.get(player.getUniqueId())) / 1000) > max) {
|
||||
map.remove(player.getUniqueId());
|
||||
return false;
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
} else {
|
||||
// Termination time has already been calculated
|
||||
if (map.get(player.getUniqueId()) < System.currentTimeMillis()) {
|
||||
map.remove(player.getUniqueId());
|
||||
return false;
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -60,6 +60,7 @@ import com.rammelkast.anticheatreloaded.check.CheckResult;
|
||||
import com.rammelkast.anticheatreloaded.check.CheckType;
|
||||
import com.rammelkast.anticheatreloaded.check.combat.VelocityCheck;
|
||||
import com.rammelkast.anticheatreloaded.check.movement.AimbotCheck;
|
||||
import com.rammelkast.anticheatreloaded.check.movement.BoatFlyCheck;
|
||||
import com.rammelkast.anticheatreloaded.check.movement.ElytraCheck;
|
||||
import com.rammelkast.anticheatreloaded.check.movement.FastLadderCheck;
|
||||
import com.rammelkast.anticheatreloaded.check.movement.FlightCheck;
|
||||
@@ -377,7 +378,6 @@ public class PlayerListener extends EventListener {
|
||||
|
||||
final Distance distance = new Distance(from, to);
|
||||
final double y = distance.getYDifference();
|
||||
getBackend().logAscension(player, from.getY(), to.getY());
|
||||
|
||||
final User user = getUserManager().getUser(player.getUniqueId());
|
||||
user.setTo(to.getX(), to.getY(), to.getZ());
|
||||
|
||||
@@ -24,6 +24,7 @@ import com.comphenix.protocol.PacketType;
|
||||
import com.comphenix.protocol.events.ListenerPriority;
|
||||
import com.comphenix.protocol.events.PacketAdapter;
|
||||
import com.comphenix.protocol.events.PacketEvent;
|
||||
import com.comphenix.protocol.injector.server.TemporaryPlayer;
|
||||
import com.comphenix.protocol.wrappers.EnumWrappers.PlayerDigType;
|
||||
import com.rammelkast.anticheatreloaded.AntiCheatReloaded;
|
||||
import com.rammelkast.anticheatreloaded.check.movement.NoSlowCheck;
|
||||
@@ -55,6 +56,9 @@ public class PacketListener {
|
||||
@Override
|
||||
public void onPacketSending(PacketEvent event) {
|
||||
Player player = event.getPlayer();
|
||||
// Check if we have an actual player object
|
||||
if (player instanceof TemporaryPlayer)
|
||||
return;
|
||||
// Compensate for teleport
|
||||
MorePacketsCheck.compensate(player);
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@ public enum Permission {
|
||||
CHECK_SNEAK, CHECK_SPEED, CHECK_VCLIP, CHECK_SPIDER, CHECK_NOFALL, CHECK_FASTBOW, CHECK_FASTEAT, CHECK_FASTHEAL,
|
||||
CHECK_KILLAURA, CHECK_UNICODE, CHECK_FASTPROJECTILE, CHECK_ITEMSPAM, CHECK_FASTINVENTORY,
|
||||
CHECK_MOREPACKETS, CHECK_BADPACKETS, CHECK_VELOCITY, CHECK_CRITICALS, CHECK_ILLEGALINTERACT, CHECK_FASTLADDER,
|
||||
CHECK_AIMBOT, CHECK_STRAFE, CHECK_NOSLOW,
|
||||
CHECK_AIMBOT, CHECK_STRAFE, CHECK_NOSLOW, CHECK_BOATFLY,
|
||||
|
||||
/* System Nodes */
|
||||
SYSTEM_LOG, SYSTEM_RESET, SYSTEM_HELP, SYSTEM_VERSION, SYSTEM_REPORT, SYSTEM_NOTICE, SYSTEM_CHECK, SYSTEM_RELOAD,
|
||||
|
||||
Reference in new issue
Block a user