All Packages Class Hierarchy This Package Previous Next Index
Class net.tabuleiro.nebulae.ServerSideScript
net.tabuleiro.nebulae.ServerSideScript
- public class ServerSideScript
- extends java.lang.Object
- implements net.tabuleiro.nebulae.ServerUser
Base class representing a ServerSideScript object. All server side scripts must extend this class.
The ServerSideScript class implements the ServerUser interface, so scripts can join movies and
send/receive messages as if they were a connected user.
Server side scripts are instantiated when a movie is created on the server. Classes are mapped to movies
according to the Scriptmap.cfg file.
Messages that are addressed to a server side script should be sent with the system.script.* prefix.
-
m_name
-
The name of the script object.
-
m_userlevel
-
The user access level for this script.
-
ServerSideScript()
-
Constructor.
-
creationTime()
-
Gets this scripts's creationTime on the server.
-
deleteUser()
-
Scripts should not call this method, it is reserved for internal use of the Nebulae MultiUser Server.
-
getGroupNames()
-
Gets a list of the groups this script is a member of.
-
getGroupsCount()
-
Gets the number of groups this script is a member of.
-
groupCreate(ServerGroup)
-
Called by the Nebulae server when a group is created in the movie associated with this server side script.
-
groupDelete(ServerGroup)
-
Called by the Nebulae server when a group is deleted from the movie associated with this server side script.
-
groupJoin(ServerUser, ServerGroup)
-
Called by the Nebulae server when an user joins a group in the movie associated with this server side script.
-
groupJoined(ServerGroup)
-
Called by the Nebulae server when the script joins a group.
-
groupLeave(ServerUser, ServerGroup)
-
Called by the Nebulae server when an user leaves a group in the movie associated with this server side script.
-
groupLeft(ServerGroup)
-
Called by the Nebulae server when the script leaves a group.
-
incomingMessage(ServerUser, MUSMessage)
-
Called by the Nebulae server when a message addressed to this script object arrives.
-
initScript(ServerObject, ServerMovie)
-
Reserved for internal use of the Nebulae MultiUser Server.
-
ipAddress()
-
Returns "localhost" for server side scripts.
-
name()
-
Gets the script name.
-
postMessage(MUSMessage)
-
Posts a message to the Nebulae server dispatcher.
-
scriptCreate()
-
Called by the Nebulae server when the script object is created on the server.
-
scriptDelete()
-
Called by the Nebulae server when the script object is destroyed on the server.
-
sendMessage(MUSMessage)
-
Sends a message to this script directly.
-
serverMovie()
-
Retrieves a pointer to the server movie object that created this script.
-
serverObject()
-
Retrieves a pointer to a ServerObject instance representing the current server.
-
setuserLevel(int)
-
Sets the user access level for this script.
-
userLevel()
-
Gets the user access level for this script.
-
userLogOff(ServerUser)
-
Called by the Nebulae server when an user is disconnected from the movie associated with this server side script.
-
userLogOn(ServerUser)
-
Called by the Nebulae server when an user connects to the movie associated with this server side script.
m_name
public java.lang.String m_name
- The name of the script object.
m_userlevel
public int m_userlevel
- The user access level for this script. Default is 100.
ServerSideScript
public ServerSideScript()
- Constructor. Reserved for internal use of the Nebulae MultiUser Server.
serverObject
public net.tabuleiro.nebulae.ServerObject serverObject()
- Retrieves a pointer to a ServerObject instance representing the current server.
initScript
public void initScript(net.tabuleiro.nebulae.ServerObject srv,
net.tabuleiro.nebulae.ServerMovie mov)
- Reserved for internal use of the Nebulae MultiUser Server.
Scripts should implement the scriptCreate() method to perform initialization tasks.
incomingMessage
public void incomingMessage(net.tabuleiro.nebulae.ServerUser user,
net.tabuleiro.nebulae.MUSMessage msg)
- Called by the Nebulae server when a message addressed to this script object arrives.
Scripts should implement this method to receive message from other users.
Messages should be addressed to system.script.*, and are passed intact for processing.
- Parameters:
- user - ServerUser reference, representing the user that has sent the message.
- msg - Message to be processed.
scriptCreate
public void scriptCreate()
- Called by the Nebulae server when the script object is created on the server.
Scripts should implement this method to perform initialization tasks.
scriptDelete
public void scriptDelete()
- Called by the Nebulae server when the script object is destroyed on the server.
Scripts should implement this method to perform cleanup tasks.
userLogOn
public void userLogOn(net.tabuleiro.nebulae.ServerUser usr)
- Called by the Nebulae server when an user connects to the movie associated with this server side script.
- Parameters:
- usr - ServerUser reference
userLogOff
public void userLogOff(net.tabuleiro.nebulae.ServerUser usr)
- Called by the Nebulae server when an user is disconnected from the movie associated with this server side script.
- Parameters:
- usr - ServerUser reference
groupCreate
public void groupCreate(net.tabuleiro.nebulae.ServerGroup grp)
- Called by the Nebulae server when a group is created in the movie associated with this server side script.
- Parameters:
- grp - ServerGroup reference
groupDelete
public void groupDelete(net.tabuleiro.nebulae.ServerGroup grp)
- Called by the Nebulae server when a group is deleted from the movie associated with this server side script.
- Parameters:
- grp - ServerGroup reference
groupJoin
public void groupJoin(net.tabuleiro.nebulae.ServerUser usr,
net.tabuleiro.nebulae.ServerGroup grp)
- Called by the Nebulae server when an user joins a group in the movie associated with this server side script.
- Parameters:
- usr - ServerUser reference
- grp - ServerGroup reference
groupLeave
public void groupLeave(net.tabuleiro.nebulae.ServerUser usr,
net.tabuleiro.nebulae.ServerGroup grp)
- Called by the Nebulae server when an user leaves a group in the movie associated with this server side script.
- Parameters:
- usr - ServerUser reference
- grp - ServerGroup reference
sendMessage
public void sendMessage(net.tabuleiro.nebulae.MUSMessage msg)
- Sends a message to this script directly. Message will be received by the incomingMessage() method.
This method is implemented for compatibility with the ServerUser interface.
- Parameters:
- msg - Message to send
postMessage
public void postMessage(net.tabuleiro.nebulae.MUSMessage msg)
- Posts a message to the Nebulae server dispatcher.
This method is part of the ServerUser interface implemented by ServerSideScript objects.
- Parameters:
- msg - Message to post
name
public java.lang.String name()
- Gets the script name.
This method is part of the ServerUser interface implemented by ServerSideScript objects.
userLevel
public int userLevel()
- Gets the user access level for this script.
By default all scripts are instantiated with full privileges (userlevel 100).
This method is part of the ServerUser interface implemented by ServerSideScript objects.
setuserLevel
public void setuserLevel(int level)
- Sets the user access level for this script.
This method is part of the ServerUser interface implemented by ServerSideScript objects.
- Parameters:
- level - new user access level
serverMovie
public net.tabuleiro.nebulae.ServerMovie serverMovie()
- Retrieves a pointer to the server movie object that created this script.
This method is part of the ServerUser interface implemented by ServerSideScript objects.
- Returns:
- ServerMovie pointer
creationTime
public long creationTime()
- Gets this scripts's creationTime on the server.
This method is part of the ServerUser interface implemented by ServerSideScript objects.
ipAddress
public java.lang.String ipAddress()
- Returns "localhost" for server side scripts.
This method is implemented for compatibility with the ServerUser interface.
getGroupNames
public java.util.Vector getGroupNames()
- Gets a list of the groups this script is a member of.
This method is part of the ServerUser interface implemented by ServerSideScript objects.
- Returns:
- Java Vector with the group names as Strings.
getGroupsCount
public int getGroupsCount()
- Gets the number of groups this script is a member of.
This method is part of the ServerUser interface implemented by ServerSideScript objects.
- Returns:
- the number of groups
deleteUser
public void deleteUser()
- Scripts should not call this method, it is reserved for internal use of the Nebulae MultiUser Server.
This method is part of the ServerUser interface implemented by ServerSideScript objects.
groupJoined
public void groupJoined(net.tabuleiro.nebulae.ServerGroup grp)
- Called by the Nebulae server when the script joins a group.
This method is part of the ServerUser interface implemented by ServerSideScript objects.
- Parameters:
- grp - ServerGroup reference
groupLeft
public void groupLeft(net.tabuleiro.nebulae.ServerGroup grp)
- Called by the Nebulae server when the script leaves a group.
This method is part of the ServerUser interface implemented by ServerSideScript objects.
- Parameters:
- grp - ServerGroup reference
All Packages Class Hierarchy This Package Previous Next Index