What's New in Director 8.5 > Using the Shockwave Multiuser Server and Xtra > Creating multiuser movies > Using server functions |
![]() ![]() ![]() |
Using server functions
You can retrieve many kinds of information from the Shockwave Multiuser Server and perform administrative functions by sending special commands to the server in the contents of sendNetMessage()
. You can get a list of movies connected to the server, control users' and movies' access to the server, and get connected users' IP addresses. Using these functions, you can design a movie that lets you remotely monitor and control activity on the server.
The server commands themselves are sent in the recipient parameter of a sendNetMessage()
, and any additional parameters required by the command are sent as the content. To determine the version of the server you are using and the platform it is running on, use getVersion
:
errCode = gMultiuserInstance.sendNetMessage \ ("system.server.getVersion", "anySubject")
When you use server functions, the recipient parameter uses a simple dot syntax that contains a reference to the server (since this is a server command), the object the command will be performed on, and the command itself. In this case the object is the server; in other cases, it could be a user or a movie.
The message returned from the server containing the version and platform information looks like this:
[#errorCode: 0, #recipients: ["Bob"], #senderID: "system.server.getVersion", #subject: "anySubject", #content: [#vendor: "Macromedia", #version: "3.0", #platform: "Macintosh"]]
The subjects of these command messages sent to the server are arbitrary and can be set to any string you want to use. The server's responses will contain the same subject string. You can use the subject string to invoke specific message handlers by specifying the subjects in your setNetMessageHandler()
commands. See Connecting to the server.
To get a list of all the movies connected to the server, use getMovies
:
errCode = gMultiuserInstance.sendNetMessage("system.server.getMovies", "anySubject")
To prevent all instances of a particular movie from connecting to the server, use movie
as the object and disable
as the command.
Here the movie being disabled is Tech Chat:
errCode = gMultiuserInstance.sendNetMessage("system.movie.disable", "anySubject", "Tech Chat")
To disconnect a specific user from the server, the object is user
and the command is delete
:
errCode = gMultiuserInstance.sendNetMessage("system.user.delete", "anySubject", "RudePerson")
Server commands, including getMovies
, disable
, and delete
, require the sender to have a specific user level. The required user levels for each command are set in the server's Multiuser.cfg file. For more information, see Configuring the server.
Some server commands can be used to return information about a movie other than the one that sends the message. If you want to get the list of groups in a movie called Chess but you are using an administrative movie called GameAdmin, you can send the command getGroups
to the movie Chess:
errCode = gMultiuserInstance.sendNetMessage("system.movie.getGroups@Chess", "anySubject")
For a complete list of the server functions that are available, see Multiuser Lingo Dictionary overview.
![]() ![]() ![]() |