com.threerings.crowd.chat.client
Class ChatDirector.CommandHandler

java.lang.Object
  extended by com.threerings.crowd.chat.client.ChatDirector.CommandHandler
Enclosing class:
ChatDirector

public abstract static class ChatDirector.CommandHandler
extends java.lang.Object

Used to implement a slash command (e.g. /who).


Constructor Summary
ChatDirector.CommandHandler()
           
 
Method Summary
 boolean checkAccess(BodyObject user)
          Returns true if this user should have access to this chat command.
 java.lang.String getUsage(java.lang.String command)
          Returns the translatable usage message for the specified command.
abstract  java.lang.String handleCommand(SpeakService speakSvc, java.lang.String command, java.lang.String args, java.lang.String[] history)
          Handles the specified chat command.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ChatDirector.CommandHandler

public ChatDirector.CommandHandler()
Method Detail

getUsage

public java.lang.String getUsage(java.lang.String command)
Returns the translatable usage message for the specified command.


handleCommand

public abstract java.lang.String handleCommand(SpeakService speakSvc,
                                               java.lang.String command,
                                               java.lang.String args,
                                               java.lang.String[] history)
Handles the specified chat command.

Parameters:
speakSvc - an optional SpeakService object representing the object to send the chat message on.
command - the slash command that was used to invoke this handler (e.g. /tell).
args - the arguments provided along with the command (e.g. Bob hello) or null if no arguments were supplied.
history - an in/out parameter that allows the command to modify the text that will be appended to the chat history. If this is set to null, nothing will be appended.
Returns:
an untranslated string that will be reported to the chat box to convey an error response to the user, or ChatCodes.SUCCESS.

checkAccess

public boolean checkAccess(BodyObject user)
Returns true if this user should have access to this chat command.



Copyright © 2012. All Rights Reserved.