megamek.server.commands
Class ServerCommand

java.lang.Object
  extended by megamek.server.commands.ServerCommand
Direct Known Subclasses:
AddBotCommand, CheckBVCommand, DefeatCommand, ExportListCommand, FixElevationCommand, HelpCommand, KickCommand, ListSavesCommand, LoadGameCommand, LocalLoadGameCommand, LocalSaveGameCommand, NukeCommand, ResetCommand, RollCommand, RulerCommand, SaveGameCommand, SeeAllCommand, ShowEntityCommand, ShowTileCommand, ShowValidTargetsCommand, SkipCommand, TeamCommand, VictoryCommand, WhoCommand

public abstract class ServerCommand
extends java.lang.Object

Version:
Author:
Ben

Field Summary
protected  Server server
           
 
Constructor Summary
ServerCommand(Server server, java.lang.String name, java.lang.String helpText)
          Creates new ServerCommand
 
Method Summary
 boolean canRunRestrictedCommand(int connId)
          Utility Function for "Restricted Commands."
 java.lang.String getHelp()
          Returns some help text for this command
 java.lang.String getName()
          Return the string trigger for this command
abstract  void run(int connId, java.lang.String[] args)
          Run this command with the arguments supplied
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

server

protected Server server
Constructor Detail

ServerCommand

public ServerCommand(Server server,
                     java.lang.String name,
                     java.lang.String helpText)
Creates new ServerCommand

Method Detail

getName

public java.lang.String getName()
Return the string trigger for this command


getHelp

public java.lang.String getHelp()
Returns some help text for this command


run

public abstract void run(int connId,
                         java.lang.String[] args)
Run this command with the arguments supplied


canRunRestrictedCommand

public boolean canRunRestrictedCommand(int connId)
Utility Function for "Restricted Commands." Restricted commands are not password-protected, they are restricted to non-Observers. In the case where there are only Ghosts and/or Observers, the Observers can run restricted commands.