Multiuser Lingo Dictionary > Multiuser Lingo Dictionary > getUserCount

 

getUserCount

Syntax

system.movie.getUserCount [movieName]
system.group.getUserCount [groupName]
system.DBAdmin.getUserCount

Description

Multiuser Server function; returns the number of users logged in to the given movie or group, or the number of DBUser objects in the server database. When movie is specified, the result is the same as calling getUsers for the group @AllUsers. If no movie is specified, the result is for the current movie. When group is specified, the result is for the given group. The reply message consists of a property list.

Examples

This statement returns the number of users logged into the current movie ID on the server:

errCode = gMultiuserInstance.sendNetMessage("system.movie.getUserCount", "anySubject")

The server's response looks like this:

[#errorCode: 0, #recipients: ["userName"], #senderID: "system.movie.getUserCount", #subject: "anySubject", #content: 17, #timeStamp: 30231031]

This statement has the server report the number of members in the group @RedTeam:

errCode = gMultiuserInstance.sendNetMessage("system.group.getUserCount", "anySubject", "@RedTeam")

The server's response looks like this:

[#errorCode: 0, #recipients: ["userName"], #senderID: "system.group.getUserCount", #subject: "anySubject", #content: [#groupName: "@RedTeam", #numberMembers: 6], #timeStamp: 30234705]

To find the number of members in more than one group at a time, put the group names in a list in a statement similar to this:

errCode = gMultiuserInstance.sendNetMessage("system.group.getUserCount", "anySubject", ["@RedTeam", "@BlueTeam", "@GreenTeam"])

The server responds with a separate message for each group.

See also

sendNetMessage()