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.


Variable Index

 o m_name
The name of the script object.
 o m_userlevel
The user access level for this script.

Constructor Index

 o ServerSideScript()
Constructor.

Method Index

 o creationTime()
Gets this scripts's creationTime on the server.
 o deleteUser()
Scripts should not call this method, it is reserved for internal use of the Nebulae MultiUser Server.
 o getGroupNames()
Gets a list of the groups this script is a member of.
 o getGroupsCount()
Gets the number of groups this script is a member of.
 o groupCreate(ServerGroup)
Called by the Nebulae server when a group is created in the movie associated with this server side script.
 o groupDelete(ServerGroup)
Called by the Nebulae server when a group is deleted from the movie associated with this server side script.
 o groupJoin(ServerUser, ServerGroup)
Called by the Nebulae server when an user joins a group in the movie associated with this server side script.
 o groupJoined(ServerGroup)
Called by the Nebulae server when the script joins a group.
 o groupLeave(ServerUser, ServerGroup)
Called by the Nebulae server when an user leaves a group in the movie associated with this server side script.
 o groupLeft(ServerGroup)
Called by the Nebulae server when the script leaves a group.
 o incomingMessage(ServerUser, MUSMessage)
Called by the Nebulae server when a message addressed to this script object arrives.
 o initScript(ServerObject, ServerMovie)
Reserved for internal use of the Nebulae MultiUser Server.
 o ipAddress()
Returns "localhost" for server side scripts.
 o name()
Gets the script name.
 o postMessage(MUSMessage)
Posts a message to the Nebulae server dispatcher.
 o scriptCreate()
Called by the Nebulae server when the script object is created on the server.
 o scriptDelete()
Called by the Nebulae server when the script object is destroyed on the server.
 o sendMessage(MUSMessage)
Sends a message to this script directly.
 o serverMovie()
Retrieves a pointer to the server movie object that created this script.
 o serverObject()
Retrieves a pointer to a ServerObject instance representing the current server.
 o setuserLevel(int)
Sets the user access level for this script.
 o userLevel()
Gets the user access level for this script.
 o userLogOff(ServerUser)
Called by the Nebulae server when an user is disconnected from the movie associated with this server side script.
 o userLogOn(ServerUser)
Called by the Nebulae server when an user connects to the movie associated with this server side script.

Variables

 o m_name
 public java.lang.String m_name
The name of the script object.

 o m_userlevel
 public int m_userlevel
The user access level for this script. Default is 100.

Constructors

 o ServerSideScript
 public ServerSideScript()
Constructor. Reserved for internal use of the Nebulae MultiUser Server.

Methods

 o serverObject
 public net.tabuleiro.nebulae.ServerObject serverObject()
Retrieves a pointer to a ServerObject instance representing the current server.

 o 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.

 o 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.
 o 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.

 o 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.

 o 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
 o 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
 o 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
 o 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
 o 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
 o 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
 o 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
 o 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
 o name
 public java.lang.String name()
Gets the script name.
This method is part of the ServerUser interface implemented by ServerSideScript objects.

 o 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.

 o 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
 o 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
 o creationTime
 public long creationTime()
Gets this scripts's creationTime on the server.
This method is part of the ServerUser interface implemented by ServerSideScript objects.

 o ipAddress
 public java.lang.String ipAddress()
Returns "localhost" for server side scripts.
This method is implemented for compatibility with the ServerUser interface.

 o 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.
 o 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
 o 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.

 o 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
 o 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