What's New in Director 8.5 > Using the Shockwave Multiuser Server and Xtra > Creating multiuser movies > Sending messages

 

Sending messages

When you have successfully connected to the server, you are ready to send messages. Your messages may contain any kind of data that Lingo supports. The messages you receive will take the form of Lingo property lists, and you may choose to send your outgoing messages as property lists as well.

To send any kind of data as a message to another movie, use sendNetMessage. This function can take two forms: either a property list or the same parameters, separated by commas.

errCode = gMultiuserInstance.sendNetMessage([#recipients: \
whichUsersOrGroups, #subject: "Example Subject", #content: \
whatMessage])

or

errCode = gMultiuserInstance.sendNetMessage( \
"whichUsersOrGroups", "Example Subject", whatMessage)

You can send messages to specific users and to named groups of users in the same movie. For example, user Guest Speaker in the movie Tech Chat could be in New York and send a message to user Bob in the same movie in San Francisco.

errCode = sendNetMessage(gMultiuserInstance, "Bob", "Chat Text", \
"Hello. Welcome to our conversation.")

To send a message to all the members of a group, use the group name, in this case @MultimediaAuthors, as the recipient parameter. You must begin all group names with the @ sign. For information on creating groups, see Using groups.

errCode = gMultiuserInstance.sendNetMessage( \
"@MultimediaAuthors","Chat Text", "How is everyone doing?")

You can also send messages to users of other movies connected to the server. A player of a chess game might send a message to a player of a checkersgame:

errCode = gMultiuserInstance.sendNetMessage("Chris@Checkers", \
"Question", "Who's winning?")

To send a message to a user in any other movie on the server, use @AllMovies after the user name. You can use this to page a user to see if he or she is connected to the server at all.

errCode = gMultiuserInstance.sendNetMessage("Chris@AllMovies", \
"Page", "Are you there?")