onUserCountChange()
Availability:
SmartFoxServer Basic / Pro
Usage:
smartFox.onUserCountChange(roomObj <propList>)
Description:
The event is fired when the number of users and/or spectators
changes in a room within the same zone. This feature allows to keep track in
realtime of the status of the other rooms in terms of users and spectators.
Also this functionality can be turned off to save bandwitdh, since a message
is broadcasted each time a user enters or exits a room in the whole zone.
In case you're using many rooms in the zone and you're handling a medium to
high traffic (for example 700-1000 clients) you could turn the feature off
to reduce bandwidth consumption.
Check the configuration docs for more info about it.
Parameters:
roomObj | The propertylist of the room where the user change occurred |
Check the Room Properties for more info on the objects returned.
Returns:
nothing
Example:
on onUserCountChange me, roomObj -- Assuming this is a game room roomName = roomObj.name roomUsers = roomObj.userCount roomSpectators = room.spectatorCount put("Room " & roomName & "has " & roomUsers & " players and " & roomSpectators & " spectators") end
See also: