Class AbstractAdminScript

java.lang.Object
games.stendhal.server.core.scripting.ScriptImpl
games.stendhal.server.core.scripting.AbstractAdminScript
All Implemented Interfaces:
Script
Direct Known Subclasses:
DebugWeather, FreezeHell, ListSpawnPoints, SpawnCreature

public abstract class AbstractAdminScript extends ScriptImpl
  • Field Details

    • admin

      protected Player admin
      Admin player executing script.
  • Constructor Details

    • AbstractAdminScript

      public AbstractAdminScript()
  • Method Details

    • run

      protected abstract void run(List<String> args)
      Instructions to execute after parameter count sanity is checked.
      Parameters:
      args - Parameters passed to the script.
    • execute

      public void execute(Player admin, List<String> args)
      Description copied from interface: Script
      Executes this script.
      Specified by:
      execute in interface Script
      Overrides:
      execute in class ScriptImpl
      Parameters:
      admin - the admin who load it or null on server start.
      args - the arguments the admin specified or null on server start.
    • sendText

      protected void sendText(String msg)
      Wrapper for sending standard text to admin.
      Parameters:
      msg - Message contents.
    • sendInfo

      protected void sendInfo(String msg)
      Wrapper for sending information text to admin.
      Parameters:
      msg - Messag contents.
    • sendWarning

      protected void sendWarning(String msg)
      Wrapper for sending warning text to admin.
      Parameters:
      msg - Message contents.
    • sendError

      protected void sendError(String msg)
      Wrapper for sending error text to admin.
      Parameters:
      msg - Message contents.
    • getMinParams

      protected int getMinParams()
      Retrieves minumum number of parameters required to run script.
    • getMaxParams

      protected int getMaxParams()
      Retrieves maximum number of parameters required to run script. An indefinite amount can be specified with -1.
    • showUsage

      public void showUsage()
      Displays usage information to admin.
    • getUsage

      public String getUsage()
      Retrieves a string representation of usage information.
    • getParamStrings

      protected List<String> getParamStrings()
      Retrieves a list of parameter strings that this script accepts. An empty string can be included to show execution without parameters.
    • getParamDetails

      protected List<String> getParamDetails()
      Retrieves extended instructions on parameter usage.