Hi,
On the server side , we don't have by default any code that will tell you if all users have left or not. You would need to build that logic in your server code by yourself. You have to first subscribe to the "UserManager" collection as "UserManager" is the name of UserManager collection node.
Once you do that, you would always get any item that is published on this collection in your 'receiveItem' hook function.
Now, whenever you get an item on the node called "UserList" under this collection , it means either an user has entered or exited or some user's userDescriptor has been modified.
Thus from any item on UserList, you can build a bookkeeping of the list of users on your server side code and whenever you get an item, you can check if your bookkeeping list is empty or not and if so, there is no user in that room.
We do it similarly on the client side too( you can refer to the onItemReceive function in UserManager.as ).
Hope this solves your issue
Thanks
Hironmay Basu