|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sf.opensmus.ServerSideScript
public class ServerSideScript
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.
Field Summary | |
---|---|
int |
m_userlevel
The user access level for this script. |
Constructor Summary | |
---|---|
ServerSideScript()
Constructor. |
Method Summary | |
---|---|
long |
creationTime()
Gets this scripts's creationTime on the server. |
void |
deleteUser()
Scripts should not call this method, it is reserved for internal use of OpenSMUS. |
java.util.Vector<java.lang.String> |
getGroupNames()
Gets a list of the groups this script is a member of. |
java.util.Vector<ServerGroup> |
getGroups()
Gets a list of the groups this script is a member of. |
int |
getGroupsCount()
Gets the number of groups this script is a member of. |
void |
groupCreate(ServerGroup grp)
Called by the OpenSMUS server when a group is created in the movie associated with this server side script. |
void |
groupDelete(ServerGroup grp)
Called by the OpenSMUS server when a group is deleted from the movie associated with this server side script. |
void |
groupJoin(ServerUser usr,
ServerGroup grp)
Called by the OpenSMUS server when a user joins a group in the movie associated with this server side script. |
void |
groupJoined(ServerGroup grp)
Called by the OpenSMUS server when the script joins a group. |
void |
groupLeave(ServerUser usr,
ServerGroup grp)
Called by the OpenSMUS server when a user leaves a group in the movie associated with this server side script. |
void |
groupLeft(ServerGroup grp)
Called by the OpenSMUS server when the script leaves a group. |
void |
incomingMessage(ServerUser user,
MUSMessage msg)
Called by the OpenSMUS server when a message addressed to this script object arrives. |
void |
initScript(ServerObject srv,
ServerMovie mov)
Reserved for internal use of OpenSMUS. |
java.lang.String |
ipAddress()
Returns "localhost" for server side scripts. |
java.lang.String |
name()
Gets the script name. |
void |
postMessage(MUSMessage msg)
Posts a message to the OpenSMUS server dispatcher. |
void |
scriptCreate()
Called by the OpenSMUS server when the script object is created on the server. |
void |
scriptDelete()
Called by the OpenSMUS server when the script object is destroyed on the server. |
void |
sendMessage(MUSMessage msg)
Sends a message to this script directly. |
ServerMovie |
serverMovie()
Retrieves a pointer to the server movie object that created this script. |
ServerObject |
serverObject()
Retrieves a pointer to a ServerObject instance representing the current server. |
void |
setuserLevel(int level)
Sets the user access level for this script. |
int |
userLevel()
Gets the user access level for this script. |
void |
userLogOff(ServerUser usr)
Called by the OpenSMUS server when a user is disconnected from the movie associated with this server side script. |
void |
userLogOn(ServerUser usr)
Called by the OpenSMUS server when a user connects to the movie associated with this server side script. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public int m_userlevel
Constructor Detail |
---|
public ServerSideScript()
Method Detail |
---|
public ServerObject serverObject()
public void initScript(ServerObject srv, ServerMovie mov)
public void incomingMessage(ServerUser user, MUSMessage msg)
user
- ServerUser reference, representing the user that has sent the message.msg
- Message to be processed.public void scriptCreate()
public void scriptDelete()
public void userLogOn(ServerUser usr)
usr
- ServerUser referencepublic void userLogOff(ServerUser usr)
usr
- ServerUser referencepublic void groupCreate(ServerGroup grp)
grp
- ServerGroup referencepublic void groupDelete(ServerGroup grp)
grp
- ServerGroup referencepublic void groupJoin(ServerUser usr, ServerGroup grp)
usr
- ServerUser referencegrp
- ServerGroup referencepublic void groupLeave(ServerUser usr, ServerGroup grp)
usr
- ServerUser referencegrp
- ServerGroup referencepublic void sendMessage(MUSMessage msg)
sendMessage
in interface ServerUser
msg
- Message to sendpublic void postMessage(MUSMessage msg)
postMessage
in interface ServerUser
msg
- Message to postpublic java.lang.String name()
name
in interface ServerUser
public int userLevel()
userLevel
in interface ServerUser
public void setuserLevel(int level)
setuserLevel
in interface ServerUser
level
- new user access levelpublic ServerMovie serverMovie()
serverMovie
in interface ServerUser
public long creationTime()
creationTime
in interface ServerUser
public java.lang.String ipAddress()
ipAddress
in interface ServerUser
public java.util.Vector<java.lang.String> getGroupNames()
getGroupNames
in interface ServerUser
public java.util.Vector<ServerGroup> getGroups()
getGroups
in interface ServerUser
public int getGroupsCount()
getGroupsCount
in interface ServerUser
public void deleteUser()
deleteUser
in interface ServerUser
public void groupJoined(ServerGroup grp)
groupJoined
in interface ServerUser
grp
- ServerGroup referencepublic void groupLeft(ServerGroup grp)
groupLeft
in interface ServerUser
grp
- ServerGroup reference
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |