|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
public interface PluginApi
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.
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. |
| Method Detail |
|---|
Collection<String> getUsers()
boolean isRoomLevel()
boolean isServerLevel()
String getRoomName()
int getRoomId()
String getZoneName()
int getZoneId()
Object getUserPluginVariable(String userName,
Object name)
userName - name of the username - name of the plug-in variable
setUserPluginVariable,
removeUserPluginVariable
void setUserPluginVariable(String userName,
Object name,
Object value)
userName - name of the username - name of the plug-in variable to setvalue - new value of the plug-in variablegetUserPluginVariable,
removeUserPluginVariable
Object removeUserPluginVariable(String userName,
Object name)
userName - name of the username - name of the variable to remove
getUserPluginVariable,
setUserPluginVariableEsObject getUserEsObject(String userName)
userName - name of the user
EsObjectboolean isGameRoom()
boolean isGameHidden()
setGameHiddenStateboolean isGameLocked()
setGameLockStateEsObject getGameDetails()
setGameDetails,
EsObjectvoid setGameDetails(EsObject gameDetails)
gameDetails - EsObject with the new value for gameDetailsgetGameDetails,
EsObjectvoid setGameHiddenState(boolean newHiddenValue)
newHiddenValue - true if game will now be hidden.isGameHiddenvoid setGameLockState(boolean newLockValue)
newLockValue - true if the game will now be locked.isGameLockedvoid startQueue(long frequency)
frequency - scheduling rate in millisecondsstopQueue,
pauseQueue,
resumeQueuevoid stopQueue()
startQueue,
pauseQueue,
resumeQueuevoid pauseQueue()
startQueue,
stopQueue,
resumeQueuevoid resumeQueue()
startQueue,
stopQueue,
pauseQueuevoid sendQueuedPluginMessageToRoom(EsObjectRO variable)
variable - unnamed messagesendQueuedPluginMessageToUser,
sendQueuedPluginMessageToUsers
void sendQueuedPluginMessageToRoom(String messageName,
EsObjectRO variable)
messageName - name of the messagevariable - messagesendQueuedPluginMessageToUser,
sendQueuedPluginMessageToUsers
void sendQueuedPluginMessageToUser(String userName,
EsObjectRO variable)
userName - name of the uservariable - unnamed messagesendQueuedPluginMessageToRoom,
sendQueuedPluginMessageToUsers
void sendQueuedPluginMessageToUser(String name,
String userName,
EsObjectRO variable)
name - name of the messageuserName - name of the uservariable - messagesendQueuedPluginMessageToRoom,
sendQueuedPluginMessageToUsers
void sendQueuedPluginMessageToUsers(Collection<String> userNames,
EsObjectRO variable)
userNames - Collection of names of usersvariable - unnamed messagesendQueuedPluginMessageToRoom,
sendQueuedPluginMessageToUser
void sendQueuedPluginMessageToUsers(String messageName,
Collection<String> userNames,
EsObjectRO variable)
messageName - name of the messageuserNames - Collection of names of usersvariable - messagesendQueuedPluginMessageToRoom,
sendQueuedPluginMessageToUser
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||