If this is going to be done infrequently, then you would need to use lines such as these:
Code:
// find all the zones, so you can get the zoneIds
Collection<ZoneValue> zones = getApi().getZones();
// iterate through all the zoneIds
Collection<RoomValue> rooms = getApi().getRoomsInZone(zoneId);
// iterate through all the roomIds in each zone
Collection<UserValue> usersInRoom = getApi().getUsersInRoom(zoneId, roomId);
// if the user you care about is in the usersInRoom collection, add this room (zoneId + roomId combo) to a list or just process this room for this user
This is NOT efficient by any means if you have multiple zones and lots of rooms. If this is going to be done fairly often, then what you will want to do is maintain a data structure either on a server level plugin or in a managed object. When a client joins a room that has a plugin attached, the plugin can record this. For rooms that have no plugin, the client would need to send a plugin request to a server level plugin with the details. I would suggest either have a plugin on every room, or else always have the client send a plugin request to do the update, instead of mixing the two.
If you need this information shared between different servers, then you may want the info stored into a database (possibly updating a batch every couple of seconds instead of individual updates).