anecho.JamochaMUD.plugins
Interface PlugInterface

All Known Implementing Classes:
FBLocationPlugIn, MusicBox, TestPlugIn, Ticker, TimeStamp, Trigger, Zombie

public interface PlugInterface

This is the standard interface that must be used by all JamochaMUD plug-ins. It outlines the standard commands required by JamochaMUD to qualify as a plug-in, such as starting and stopping the plug-in, as well as registering the plug-in with the main program.


Method Summary
 void activate()
          This function tells the plug-in that it should be functioning.
 void deactivate()
          This function tells the plug-in that it should not be active.
 boolean hasProperties()
          Check to see if the plug-in has configurable properties
 boolean haveConfig()
          This function indicates whether a directory is required to hold settings for our plug-in.
 void initialiseAtLoad()
          This function is called at load-up, in case properties are needed...
 boolean isActive()
          Allows JamochaMUD to check whether this plug-in is active and should be used.
 java.lang.String plugInDescription()
          Returns a description, eg.
 java.lang.String plugInName()
          Returns the plugin's proper name
 void plugInProperties()
          Any user configurable options for the plugin
 java.lang.String plugInType()
          Returns a type of either input, output, or other
 java.lang.String plugMain(java.lang.String jamochaString, MuSocket mSock)
          the core of the plugin
 void setAtHalt()
          Previously this function did most of the functions of deactivate() but now this is reserved solely for shutting down the plug-in and doing any necessary clean-up.
 

Method Detail

plugInName

java.lang.String plugInName()
Returns the plugin's proper name

Returns:
Returns a human-readable string of the plug-in's name.

plugInDescription

java.lang.String plugInDescription()
Returns a description, eg. author, date, build...

Returns:
Returns a human-readable description of what the plug-in does, as well as any other information such as author, date, version... what-ever the author deems important.

plugInType

java.lang.String plugInType()
Returns a type of either input, output, or other

Returns:

plugMain

java.lang.String plugMain(java.lang.String jamochaString,
                          MuSocket mSock)
the core of the plugin

Parameters:
jamochaString -
mSock -
Returns:

plugInProperties

void plugInProperties()
Any user configurable options for the plugin


hasProperties

boolean hasProperties()
Check to see if the plug-in has configurable properties

Returns:
true
- plug-in can be configured
false
- plug-in cannot be configured

initialiseAtLoad

void initialiseAtLoad()
This function is called at load-up, in case properties are needed... eg. lists, settings


activate

void activate()
This function tells the plug-in that it should be functioning. See Deactive() for the inverse function. activate may be called more than once.


deactivate

void deactivate()
This function tells the plug-in that it should not be active. deactivate may be called more than once. Formerly this function was handled by setAtHalt.


isActive

boolean isActive()
Allows JamochaMUD to check whether this plug-in is active and should be used.

Returns:
true - this plug-in is active false - this plug-in is not active

setAtHalt

void setAtHalt()
Previously this function did most of the functions of deactivate() but now this is reserved solely for shutting down the plug-in and doing any necessary clean-up.


haveConfig

boolean haveConfig()
This function indicates whether a directory is required to hold settings for our plug-in. It is recommended for consistency to let JamochaMUD create and handle any plug-in directories. Plus, it means you can use less code in your plug-in!

Returns:
true
- create a settings directory
false
- no directory required