|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object wyvern.kernel.properties.PList wyvern.kernel.commands.SimpleHandler wyvern.lib.commands.WarnCommand
A simple player-warning system. Allows players to issue warnings to other players.
Field Summary | |
static int |
THRESHOLD
Each time a player's lifetime warning level (stored in an int "warnings" property) passes a multiple of this threshold value, they get a new punishment. |
Fields inherited from class wyvern.kernel.commands.SimpleHandler |
delay_ |
Fields inherited from class wyvern.kernel.properties.PList |
readOnly_ |
Fields inherited from interface wyvern.lib.PropertyList |
PROPERTY_PACKAGE |
Method Summary | |
void |
addCommands(java.util.Map commands,
CommandList list)
Adds our commands. |
static WarnCommand |
getImpl()
|
boolean |
handleEvent(CommandEvent event)
Implements the "warn" commands. |
static void |
main(java.lang.String[] args)
Tests the regex matching. |
static void |
punishOnline(Player warnee,
int old_points,
int new_points)
Dishes out a punishment, if the warned player has crossed a warning threshold. |
Methods inherited from class wyvern.kernel.commands.SimpleHandler |
createEvent, execute, knowsCommand |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final int THRESHOLD
Method Detail |
public static WarnCommand getImpl()
public void addCommands(java.util.Map commands, CommandList list)
addCommands
in interface BuiltInCommand
addCommands
in class SimpleHandler
commands
- a Map whose keys are the command verbs,
and whose values are references to the SimpleHandler
instance that wants to handle the command.list
- the Player, Monster, Vehicle or other CommandList
implementation for which addCommands() is being called.public boolean handleEvent(CommandEvent event)
handleEvent
in class SimpleHandler
event
- a CommandEvent with various fields filled in:
the agent performing the command, the command verb and arguments,
the delay for the command, and success/failure messages.
public static void punishOnline(Player warnee, int old_points, int new_points)
warnee
- the player being warned (must be online)old_points
- the player's previous "warnings" countnew_points
- the player's new "warnings" countpublic static void main(java.lang.String[] args)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |