mirror of
https://github.com/NoCheatPlus/NoCheatPlus.git
synced 2024-09-15 08:28:10 +02:00
Plugin rename from "NoCheatPlugin" to "NoCheat" and configurable
speedhack check log message + v0.8
This commit is contained in:
parent
f8eff5ee25
commit
9ef5282905
@ -3,7 +3,7 @@ name: NoCheat
|
|||||||
author: Evenprime
|
author: Evenprime
|
||||||
|
|
||||||
main: cc.co.evenprime.bukkit.nocheat.NoCheat
|
main: cc.co.evenprime.bukkit.nocheat.NoCheat
|
||||||
version: 0.7.8a
|
version: 0.8
|
||||||
|
|
||||||
commands:
|
commands:
|
||||||
nocheat:
|
nocheat:
|
||||||
|
@ -251,6 +251,7 @@ public class NoCheat extends JavaPlugin {
|
|||||||
if(config.chatLevel.intValue() <= l.intValue()) {
|
if(config.chatLevel.intValue() <= l.intValue()) {
|
||||||
for(Player player : getServer().getOnlinePlayers()) {
|
for(Player player : getServer().getOnlinePlayers()) {
|
||||||
if(hasPermission(player, "nocheat.notify")) {
|
if(hasPermission(player, "nocheat.notify")) {
|
||||||
|
System.out.println("logged to chat");
|
||||||
player.sendMessage("["+l.getName()+"] " + message);
|
player.sendMessage("["+l.getName()+"] " + message);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -94,6 +94,8 @@ public class NoCheatConfiguration {
|
|||||||
plugin.speedhackCheck.limits[1] = c.getInt("speedhack.limits.med", plugin.speedhackCheck.limits[1]);
|
plugin.speedhackCheck.limits[1] = c.getInt("speedhack.limits.med", plugin.speedhackCheck.limits[1]);
|
||||||
plugin.speedhackCheck.limits[2] = c.getInt("speedhack.limits.high", plugin.speedhackCheck.limits[2]);
|
plugin.speedhackCheck.limits[2] = c.getInt("speedhack.limits.high", plugin.speedhackCheck.limits[2]);
|
||||||
|
|
||||||
|
plugin.speedhackCheck.logMessage = c.getString("speedhack.logmessage", plugin.speedhackCheck.logMessage);
|
||||||
|
|
||||||
plugin.movingCheck.actions[0] = stringToActions(c.getString("moving.action.low"), plugin.movingCheck.actions[0]);
|
plugin.movingCheck.actions[0] = stringToActions(c.getString("moving.action.low"), plugin.movingCheck.actions[0]);
|
||||||
plugin.movingCheck.actions[1] = stringToActions(c.getString("moving.action.med"), plugin.movingCheck.actions[1]);
|
plugin.movingCheck.actions[1] = stringToActions(c.getString("moving.action.med"), plugin.movingCheck.actions[1]);
|
||||||
plugin.movingCheck.actions[2] = stringToActions(c.getString("moving.action.high"), plugin.movingCheck.actions[2]);
|
plugin.movingCheck.actions[2] = stringToActions(c.getString("moving.action.high"), plugin.movingCheck.actions[2]);
|
||||||
@ -227,6 +229,7 @@ public class NoCheatConfiguration {
|
|||||||
w.write(" bedteleport: "+plugin.bedteleportCheck.isActive()); w.newLine();
|
w.write(" bedteleport: "+plugin.bedteleportCheck.isActive()); w.newLine();
|
||||||
w.write("# Speedhack specific options"); w.newLine();
|
w.write("# Speedhack specific options"); w.newLine();
|
||||||
w.write("speedhack:"); w.newLine();
|
w.write("speedhack:"); w.newLine();
|
||||||
|
w.write(" logmessage: \"" + plugin.speedhackCheck.logMessage+"\""); w.newLine();
|
||||||
w.write(" limits:"); w.newLine();
|
w.write(" limits:"); w.newLine();
|
||||||
w.write(" low: "+plugin.speedhackCheck.limits[0]); w.newLine();
|
w.write(" low: "+plugin.speedhackCheck.limits[0]); w.newLine();
|
||||||
w.write(" med: "+plugin.speedhackCheck.limits[1]); w.newLine();
|
w.write(" med: "+plugin.speedhackCheck.limits[1]); w.newLine();
|
||||||
|
@ -35,6 +35,8 @@ public class SpeedhackCheck extends Check {
|
|||||||
{ LogAction.logmed, CancelAction.cancel },
|
{ LogAction.logmed, CancelAction.cancel },
|
||||||
{ LogAction.loghigh, CancelAction.cancel } };
|
{ LogAction.loghigh, CancelAction.cancel } };
|
||||||
|
|
||||||
|
public String logMessage = "%1$s sent %2$d move events, but only %3$d were allowed. Speedhack?";
|
||||||
|
|
||||||
public void check(PlayerMoveEvent event) {
|
public void check(PlayerMoveEvent event) {
|
||||||
|
|
||||||
// Should we check at all?
|
// Should we check at all?
|
||||||
@ -101,11 +103,11 @@ public class SpeedhackCheck extends Check {
|
|||||||
|
|
||||||
if(actions == null) return;
|
if(actions == null) return;
|
||||||
|
|
||||||
String logMessage = event.getPlayer().getName()+" sent "+ data.speedhackEventsSinceLastCheck + " move events, but only "+limits[0]+ " were allowed. Speedhack?";
|
String log = String.format(logMessage, event.getPlayer().getName(), data.speedhackEventsSinceLastCheck, limits[0]);
|
||||||
|
|
||||||
for(Action a : actions) {
|
for(Action a : actions) {
|
||||||
if(a instanceof LogAction)
|
if(a instanceof LogAction)
|
||||||
plugin.log(((LogAction)a).level, logMessage);
|
plugin.log(((LogAction)a).level, log);
|
||||||
else if(a instanceof CancelAction)
|
else if(a instanceof CancelAction)
|
||||||
resetPlayer(event, data);
|
resetPlayer(event, data);
|
||||||
else if(a instanceof CustomAction)
|
else if(a instanceof CustomAction)
|
||||||
|
Loading…
Reference in New Issue
Block a user