mirror of
https://github.com/NoCheatPlus/NoCheatPlus.git
synced 2024-10-03 00:47:25 +02:00
Show limit in fight.speed check log messages
This commit is contained in:
parent
6e68ffed4b
commit
d1aa15d1e9
@ -5,7 +5,7 @@ package cc.co.evenprime.bukkit.nocheat.actions;
|
||||
*
|
||||
*/
|
||||
public enum ParameterName {
|
||||
PLAYER("player"), LOCATION("location"), WORLD("world"), VIOLATIONS("violations"), MOVEDISTANCE("movedistance"), REACHDISTANCE("reachdistance"), FALLDISTANCE("falldistance"), LOCATION_TO("locationto"), CHECK("check"), PACKETS("packets"), TEXT("text"), PLACE_LOCATION("placelocation"), PLACE_AGAINST("placeagainst"), BLOCK_TYPE("blocktype");
|
||||
PLAYER("player"), LOCATION("location"), WORLD("world"), VIOLATIONS("violations"), MOVEDISTANCE("movedistance"), REACHDISTANCE("reachdistance"), FALLDISTANCE("falldistance"), LOCATION_TO("locationto"), CHECK("check"), PACKETS("packets"), TEXT("text"), PLACE_LOCATION("placelocation"), PLACE_AGAINST("placeagainst"), BLOCK_TYPE("blocktype"), LIMIT("limit");
|
||||
|
||||
private final String s;
|
||||
|
||||
|
@ -45,6 +45,7 @@ public class ReachCheck extends FightCheck {
|
||||
} else {
|
||||
// Player failed the check
|
||||
// Increment violation counter
|
||||
// This is influenced by lag, so don't do it if there was server lag
|
||||
if(!plugin.skipCheck()) {
|
||||
double sqrt = Math.sqrt(off);
|
||||
data.reachVL += sqrt;
|
||||
|
@ -48,6 +48,8 @@ public class SpeedCheck extends FightCheck {
|
||||
|
||||
if(wildcard == ParameterName.VIOLATIONS)
|
||||
return String.format(Locale.US, "%d", (int) getData(player.getDataStore()).speedVL);
|
||||
else if(wildcard == ParameterName.LIMIT)
|
||||
return String.format(Locale.US, "%d", (int) getConfig(player.getConfigurationStore()).speedAttackLimit);
|
||||
else
|
||||
return super.getParameter(wildcard, player);
|
||||
}
|
||||
|
@ -92,7 +92,7 @@ public class DefaultConfiguration extends NoCheatConfiguration {
|
||||
set(ConfPaths.FIGHT_REACH_CHECK, true);
|
||||
set(ConfPaths.FIGHT_REACH_LIMIT, 400);
|
||||
set(ConfPaths.FIGHT_REACH_PENALTYTIME, 500);
|
||||
set(ConfPaths.FIGHT_REACH_ACTIONS, "log:freach:0:5:if cancel");
|
||||
set(ConfPaths.FIGHT_REACH_ACTIONS, "log:freach:2:5:if cancel");
|
||||
|
||||
set(ConfPaths.FIGHT_SPEED_CHECK, true);
|
||||
set(ConfPaths.FIGHT_SPEED_ATTACKLIMIT, 7);
|
||||
@ -112,7 +112,7 @@ public class DefaultConfiguration extends NoCheatConfiguration {
|
||||
set(ConfPaths.STRINGS + ".spam", "[player] failed [check]: Last sent message '[text]'. VL [violations]");
|
||||
set(ConfPaths.STRINGS + ".fdirection", "[player] failed [check]: tried to interact with a block out of line of sight. VL [violations]");
|
||||
set(ConfPaths.STRINGS + ".freach", "[player] failed [check]: tried to attack entity out of reach. VL [violations]");
|
||||
set(ConfPaths.STRINGS + ".fspeed", "[player] failed [check]: tried to attack too fast. VL [violations]");
|
||||
set(ConfPaths.STRINGS + ".fspeed", "[player] failed [check]: tried to attack more than [limit] times per second. VL [violations]");
|
||||
set(ConfPaths.STRINGS + ".fnoswing", "[player] failed [check]: Didn't swing arm. VL [violations]");
|
||||
set(ConfPaths.STRINGS + ".kick", "kick [player]");
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user