|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.electrotank.electroserver4.extensions.api.ElectroServerApiImpl
com.electrotank.electroserver4.extensions.api.PluginApiImpl
public class PluginApiImpl
Implementation of the api for a plug-in.
A plug-in is the most generic and flexible way to add functionality to ElectroServer. Simply put, a plug-in is a piece of code that can be tied to the server itself or a room and can then be called via clients to directly ask it to perform an action. As a special case, room-level plug-ins have the ability to listen to many events that occur in a room such as room variable changes or public messages. These are the bread and butter of multi-player game development.
PluginApi,
Plugin,
BasePlugin,
ElectroServerApi| Method Summary | |
|---|---|
EsObject |
getGameDetails()
Gets the game details as an EsObject. |
int |
getRoomId()
Gets the roomId. |
String |
getRoomName()
Gets the name of the room. |
EsObject |
getUserEsObject(String userName)
Looks up the EsObject for a given userName. |
Object |
getUserPluginVariable(String userName,
Object name)
Looks up the plug-in variable for a given user. |
Collection<String> |
getUsers()
Gets a Collection of user names. |
int |
getZoneId()
Gets the zoneId. |
String |
getZoneName()
Gets the name of the zone. |
boolean |
isGameHidden()
Is this game hidden? |
boolean |
isGameLocked()
Is this game locked? |
boolean |
isGameRoom()
Is the room for this plug-in a game? |
boolean |
isRoomLevel()
True if the plug-in is a room-level plug-in |
boolean |
isServerLevel()
True if the plug-in is a server-level plug-in. |
void |
pauseQueue()
Pauses the queue of messages. |
Object |
removeUserPluginVariable(String userName,
Object name)
Removes the specified plug-in variable for this user. |
void |
resumeQueue()
Resumes the queue of messages. |
void |
sendQueuedPluginMessageToRoom(EsObjectRO variable)
Adds the given message to the message queue of each user in the room. |
void |
sendQueuedPluginMessageToRoom(String messageName,
EsObjectRO variable)
Adds the given message to the message queue of each user in the room. |
void |
sendQueuedPluginMessageToUser(String userName,
EsObjectRO variable)
Adds the given message to the message queue of the specified user. |
void |
sendQueuedPluginMessageToUser(String name,
String userName,
EsObjectRO variable)
Adds the given message to the message queue of the specified user. |
void |
sendQueuedPluginMessageToUsers(Collection<String> userNames,
EsObjectRO variable)
Adds the given message to the message queue of each user in the Collection. |
void |
sendQueuedPluginMessageToUsers(String messageName,
Collection<String> userNames,
EsObjectRO variable)
Adds the given message to the message queue of each user in the Collection. |
void |
setGameDetails(EsObject gameDetails)
Sets the game details. |
void |
setGameHiddenState(boolean newHiddenValue)
Sets the game state to hidden or not. |
void |
setGameLockState(boolean newLockValue)
Sets the game state to locked or not. |
void |
setUserPluginVariable(String userName,
Object name,
Object value)
Sets the specified plug-in variable for a given user. |
void |
startQueue(long frequency)
Starts the queue of messages. |
void |
stopQueue()
Stops the queue of messages. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public boolean isRoomLevel()
PluginApi
isRoomLevel in interface PluginApipublic boolean isServerLevel()
PluginApi
isServerLevel in interface PluginApipublic int getZoneId()
PluginApi
getZoneId in interface PluginApipublic int getRoomId()
PluginApi
getRoomId in interface PluginApipublic String getZoneName()
PluginApi
getZoneName in interface PluginApipublic String getRoomName()
PluginApi
getRoomName in interface PluginApi
public Object getUserPluginVariable(String userName,
Object name)
PluginApi
getUserPluginVariable in interface PluginApiuserName - name of the username - name of the plug-in variable
setUserPluginVariable,
removeUserPluginVariable
public void setUserPluginVariable(String userName,
Object name,
Object value)
PluginApi
setUserPluginVariable in interface PluginApiuserName - name of the username - name of the plug-in variable to setvalue - new value of the plug-in variablegetUserPluginVariable,
removeUserPluginVariable
public Object removeUserPluginVariable(String userName,
Object name)
PluginApi
removeUserPluginVariable in interface PluginApiuserName - name of the username - name of the variable to remove
getUserPluginVariable,
setUserPluginVariablepublic EsObject getUserEsObject(String userName)
PluginApi
getUserEsObject in interface PluginApiuserName - name of the user
EsObjectpublic Collection<String> getUsers()
PluginApi
getUsers in interface PluginApipublic void sendQueuedPluginMessageToRoom(EsObjectRO variable)
PluginApi
sendQueuedPluginMessageToRoom in interface PluginApivariable - unnamed messagesendQueuedPluginMessageToUser,
sendQueuedPluginMessageToUsers
public void sendQueuedPluginMessageToRoom(String messageName,
EsObjectRO variable)
PluginApi
sendQueuedPluginMessageToRoom in interface PluginApimessageName - name of the messagevariable - messagesendQueuedPluginMessageToUser,
sendQueuedPluginMessageToUsers
public void sendQueuedPluginMessageToUsers(Collection<String> userNames,
EsObjectRO variable)
PluginApi
sendQueuedPluginMessageToUsers in interface PluginApiuserNames - Collection of names of usersvariable - unnamed messagesendQueuedPluginMessageToRoom,
sendQueuedPluginMessageToUser
public void sendQueuedPluginMessageToUsers(String messageName,
Collection<String> userNames,
EsObjectRO variable)
PluginApi
sendQueuedPluginMessageToUsers in interface PluginApimessageName - name of the messageuserNames - Collection of names of usersvariable - messagesendQueuedPluginMessageToRoom,
sendQueuedPluginMessageToUser
public void sendQueuedPluginMessageToUser(String userName,
EsObjectRO variable)
PluginApi
sendQueuedPluginMessageToUser in interface PluginApiuserName - name of the uservariable - unnamed messagesendQueuedPluginMessageToRoom,
sendQueuedPluginMessageToUsers
public void sendQueuedPluginMessageToUser(String name,
String userName,
EsObjectRO variable)
PluginApi
sendQueuedPluginMessageToUser in interface PluginApiname - name of the messageuserName - name of the uservariable - messagesendQueuedPluginMessageToRoom,
sendQueuedPluginMessageToUserspublic void startQueue(long frequency)
PluginApi
startQueue in interface PluginApifrequency - scheduling rate in millisecondsstopQueue,
pauseQueue,
resumeQueuepublic void stopQueue()
PluginApi
stopQueue in interface PluginApistartQueue,
pauseQueue,
resumeQueuepublic void pauseQueue()
PluginApi
pauseQueue in interface PluginApistartQueue,
stopQueue,
resumeQueuepublic void resumeQueue()
PluginApi
resumeQueue in interface PluginApistartQueue,
stopQueue,
pauseQueuepublic boolean isGameRoom()
PluginApi
isGameRoom in interface PluginApipublic void setGameLockState(boolean newLockValue)
PluginApi
setGameLockState in interface PluginApinewLockValue - true if the game will now be locked.isGameLockedpublic boolean isGameLocked()
PluginApi
isGameLocked in interface PluginApisetGameLockStatepublic void setGameHiddenState(boolean newHiddenValue)
PluginApi
setGameHiddenState in interface PluginApinewHiddenValue - true if game will now be hidden.isGameHiddenpublic boolean isGameHidden()
PluginApi
isGameHidden in interface PluginApisetGameHiddenStatepublic EsObject getGameDetails()
PluginApi
getGameDetails in interface PluginApisetGameDetails,
EsObjectpublic void setGameDetails(EsObject gameDetails)
PluginApi
setGameDetails in interface PluginApigameDetails - EsObject with the new value for gameDetailsgetGameDetails,
EsObject
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||