diff options
author | md_5 <md_5@bigpond.com> | 2012-03-12 10:39:36 +1100 |
---|---|---|
committer | md_5 <md_5@bigpond.com> | 2012-03-12 10:39:36 +1100 |
commit | 78f4820876f42f7b50bf88f64afd45bee939e4e4 (patch) | |
tree | 317cd3bcc63fc9e86a6efbcb5e13a50ed9efbaaf /EssentialsAntiCheat/src/com/earth2me/essentials/anticheat/actions/types/ConsolecommandAction.java | |
parent | 26409058467e9f34aa65a08df3c68a58129d22ba (diff) | |
download | Essentials-78f4820876f42f7b50bf88f64afd45bee939e4e4.tar Essentials-78f4820876f42f7b50bf88f64afd45bee939e4e4.tar.gz Essentials-78f4820876f42f7b50bf88f64afd45bee939e4e4.tar.lz Essentials-78f4820876f42f7b50bf88f64afd45bee939e4e4.tar.xz Essentials-78f4820876f42f7b50bf88f64afd45bee939e4e4.zip |
Initial formatted and slightly tweaked version of @evenprime 's NoCheat. Will be intergrated into the main Essentials as soon as possible
Diffstat (limited to 'EssentialsAntiCheat/src/com/earth2me/essentials/anticheat/actions/types/ConsolecommandAction.java')
-rw-r--r-- | EssentialsAntiCheat/src/com/earth2me/essentials/anticheat/actions/types/ConsolecommandAction.java | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/EssentialsAntiCheat/src/com/earth2me/essentials/anticheat/actions/types/ConsolecommandAction.java b/EssentialsAntiCheat/src/com/earth2me/essentials/anticheat/actions/types/ConsolecommandAction.java new file mode 100644 index 000000000..5af889c16 --- /dev/null +++ b/EssentialsAntiCheat/src/com/earth2me/essentials/anticheat/actions/types/ConsolecommandAction.java @@ -0,0 +1,39 @@ +package com.earth2me.essentials.anticheat.actions.types; + +import com.earth2me.essentials.anticheat.NoCheatPlayer; +import com.earth2me.essentials.anticheat.checks.Check; + + +/** + * Execute a command by imitating an admin typing the command directly into the console + * + */ +public class ConsolecommandAction extends ActionWithParameters +{ + public ConsolecommandAction(String name, int delay, int repeat, String command) + { + // Log messages may have color codes now + super(name, delay, repeat, command); + } + + /** + * Fill in the placeholders ( stuff that looks like '[something]') with information, make a nice String out of it + * that can be directly used as a command in the console. + * + * @param player The player that is used to fill in missing data + * @param check The check that is used to fill in missing data + * @return The complete, ready to use, command + */ + public String getCommand(NoCheatPlayer player, Check check) + { + return super.getMessage(player, check); + } + + /** + * Convert the commands data into a string that can be used in the config files + */ + public String toString() + { + return "cmd:" + name + ":" + delay + ":" + repeat; + } +} |