|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object wyvern.lib.commands.ShoutCommand
Sends a message to every player on the game. Handles chat channels as well.
Field Summary | |
static java.lang.String |
MYCLASS
|
static int |
NAUGHTY_SHOUT_MINUTES
How long to auto-silence players who shout the f-word. |
static int |
THIRTY_MINUTES
|
Method Summary | |
void |
addCommands(java.util.Map commands,
CommandList list)
Tells the Command to add the commands that it wants to implement into the passed data structure. |
static boolean |
checkSilenced(CommandEvent event)
Returns true if agent is silenced. |
CommandEvent |
createEvent(CommandEvent initialInfo)
Creates a CommandEvent that encapsulates all the state necessary to perform the command. |
boolean |
execute(CommandEvent e)
Executes the specified CommandEvent. |
static ShoutCommand |
getImpl()
|
static java.util.List |
getLastShouts()
Returns the last 100 or so shouts. |
static int |
getRequiredShoutPoints(java.lang.String msg)
Returns the number of shout points this agent needs to shout something, based on the agent's skills, the current player count online, and the text of the shout. |
static java.lang.String |
getSilencer(Player player)
Returns the name of the wizard or agent who silenced the player. |
static java.lang.String |
getSilenceReason(Player agent)
Returns the reason the player is silenced, if they're silenced. |
static int |
getSilenceTime(Player agent)
Returns the number of minutes of silence the player has remaining. |
static java.util.List |
getValidChannels()
Returns the chat channels we currently support. |
static boolean |
isPlayerSubscribed(Player p,
java.lang.String channel)
Returns true if the passed player is subscribed to the specified channel. |
static boolean |
isSilenced(Player p)
Returns true if agent is silenced. |
static boolean |
isSilencedNotifyPlayer(Player p)
Same as isSilenced(), but tells the player who silenced them, why, and how many more minutes of silence remain. |
boolean |
knowsCommand(java.lang.String command)
Returns true if this Command wants to handle the command. |
static void |
putInLastShoutList(java.lang.String msg)
Adds a message to the last-shout list. |
static void |
shoutToAllPlayers(Commandable shouter,
java.lang.String msg,
boolean isChannel,
java.lang.String verb)
Shouts a message to all the players on the game, skipping any with earmuffs, or who are ignoring the agent, or whatever. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final java.lang.String MYCLASS
public static final int NAUGHTY_SHOUT_MINUTES
public static final int THIRTY_MINUTES
Method Detail |
public static ShoutCommand getImpl()
public void addCommands(java.util.Map commands, CommandList list)
BuiltInCommand
addCommands
in interface BuiltInCommand
commands
- a Map whose keys are commands, and whose values
are Commands that handle those commands.list
- the CommandList the Command is being added to.public boolean knowsCommand(java.lang.String command)
Command
This method exists to allow more than one game object to implement the same command verb, but with different expected arguments.
If two objects register for the same command and the same arguments, the object that was registered most recently gets to handle at the command.
knowsCommand
in interface Command
command
- the entire command string, including arguments
public CommandEvent createEvent(CommandEvent initialInfo)
Command
This method is called by the kernel. The kernel passes the event to the pre-hook, then calls Command.execute() (below) to execute the event, and finally calls the post-hook.
createEvent
in interface Command
initialInfo
- a "blank" CommandEvent containing only the
command text and the agent who's performing the command. This
initial event is created by the originator of the event (e.g.
the AI or player's command preprocessor).
public boolean execute(CommandEvent e)
Command
execute
in interface Command
e
- the CommandEvent to execute
public static java.util.List getValidChannels()
public static boolean isPlayerSubscribed(Player p, java.lang.String channel)
public static void putInLastShoutList(java.lang.String msg)
public static java.util.List getLastShouts()
public static boolean checkSilenced(CommandEvent event)
event
- the ShoutEvent to veto
public static int getSilenceTime(Player agent)
public static java.lang.String getSilencer(Player player)
player
- the player who's (maybe) silenced
public static java.lang.String getSilenceReason(Player agent)
agent
- the player who's (maybe) silenced
public static boolean isSilenced(Player p)
public static boolean isSilencedNotifyPlayer(Player p)
p
- the player
public static void shoutToAllPlayers(Commandable shouter, java.lang.String msg, boolean isChannel, java.lang.String verb)
shouter
- the person shoutingmsg
- the message, e.g. "Rhialto shouts: hi all!"isChannel
- true if it's a chat-channel message
(not shout or emergency)verb
- the verb used to shout ("shout", "ooc", etc.)public static int getRequiredShoutPoints(java.lang.String msg)
msg
- the message they're shouting
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |