com.electrotank.electroserver.plugins.utilities
Class PluginHelper

java.lang.Object
  extended bycom.electrotank.electroserver.plugins.utilities.BaseExtensionHelper
      extended bycom.electrotank.electroserver.plugins.utilities.PluginHelper

public class PluginHelper
extends BaseExtensionHelper

The plugin helper class provides commonly used functionality to all plugins. It is available in script plugins as the "server" object. In Java plugins, you can access it via the getPluginHelper method on the AbstractPlugin object. See any of the example plugins included with the server to see how to use this object.


Constructor Summary
PluginHelper(Room room, String name, People people, Places places)
          This is an internal constructor.
 
Method Summary
 String getRoomName()
          Gets the name of the room that contains this plugin.
 String getZoneName()
          Gets the name of the zone that contains this plugin.
 void sendPublicMessage(String message, Map variables)
          Sends a message to the room that this plugin is in.
 void sendRawPrivateMessage(String userName, String message)
          Sends a private message to the user.
 void sendRawPrivateMessgeToMany(String[] users, String message)
          Sends a private message to the specified users.
 void sendRawPublicMessage(String message)
          Sends a message to the room that this plugin is in.
 
Methods inherited from class com.electrotank.electroserver.plugins.utilities.BaseExtensionHelper
ban, callRemotePlugin, callRemoteRoomPlugin, config, createDirectory, createRoom, createRoomVariable, createUserVariable, deleteDirectory, deleteFile, deleteRoomVariable, deleteUserVariable, doesDirectoryExist, doesFileExist, fine, finer, finest, getAllZones, getCpuPercentUsed, getLoggedInUserCount, getLogger, getName, getPhysicalMemoryAvailable, getRoomsInZone, getRoomVariables, getServerTime, getUserServerVariable, getUserServerVariable, getUsersInRoom, getUserVariables, getUserVariablesAsMap, info, isDirectory, isFile, isUserLoggedIn, kick, moveToRoom, readFile, removeUserServerVariable, sendPrivateMessage, sendPrivateMessgeToMany, sendPublicMessageToRoom, sendPublicMessageToServer, sendPublicMessageToZone, setUserServerVariable, severe, stringContainsVulgarity, updateRoomVariable, updateUserVariable, warning, writeFile
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PluginHelper

public PluginHelper(Room room,
                    String name,
                    People people,
                    Places places)
This is an internal constructor.

Parameters:
room - the room this plugin is associated with
name - the name of the plugin
people - the People object of the server
places - the Places object of the server
Method Detail

sendPublicMessage

public void sendPublicMessage(String message,
                              Map variables)
Sends a message to the room that this plugin is in. This can only be used on room-level plugins.

Parameters:
message - text of the message to send
variables - variables to be sent along with the message

sendRawPublicMessage

public void sendRawPublicMessage(String message)
Sends a message to the room that this plugin is in. This can only be used on room-level plugins.

Parameters:
message - text of the message to send

sendRawPrivateMessgeToMany

public void sendRawPrivateMessgeToMany(String[] users,
                                       String message)
Sends a private message to the specified users.

Parameters:
users - string array representing the names of users to receive this message
message - text of the message to send

sendRawPrivateMessage

public void sendRawPrivateMessage(String userName,
                                  String message)
Sends a private message to the user.

Parameters:
userName - the name of this messages recipient
message - text of the message to send

getRoomName

public String getRoomName()
Gets the name of the room that contains this plugin. This shouldn't be used from within server level plugins.

Returns:
the name of the room in which this plugin resides. Thsi will return null if called from within a server-level plugin.

getZoneName

public String getZoneName()
Gets the name of the zone that contains this plugin. This shouldn't be used from within server level plugins.

Returns:
the name of the zone in which this plugin resides. Thsi will return null if called from within a server-level plugin.


Copyright © 2006 Electrotank, Inc. All Rights Reserved.