Internal Event :: newRoom

Availability:

SmartFoxServer PRO 1.2.1

Event name:

newRoom

Description:

This event is fired each time a new room is created in the Zone where the extension is attached to.
The event is available only for both Zone Level extensions.

NOTE: It is always reccomended to keep track of Rooms by using their unique id. For example you can keep a local list of rooms with their id as the key.
When a room is destroyed you will always receive its id.

Properties:

name   description type
room   The Room object object

Example:

// We handle the event by adding the new room
// in our local list only if it's a game room
function handleInternalEvent(evtObj)
{
	if (evtObj.name == "newRoom")
	{
		var newRoom = evtObj.room
		var rId = newRoom.getId()
		
		if (newRoom.isGame())
			localRoomList[id] = room
	}
}

See also: