We discussed three types of rooms when configuring the server in the previous section. The regular room, game room, and limbo room come with different purposes. Each type of rooms has its own set of available events. We will go through some common room events and compare the availability of the events in the three types of rooms.
Event name |
Description |
---|---|
|
This is a notification that a user has joined the room. This is useful to draw a new user's information and his graphics on the Flash virtual world when receiving this notification message. |
|
This is a notification telling that a user has left the room. Similar to the |
|
This event was fired when a spectator switched to a player in the game room. |
|
The notification message comes when any room is added to the zone. It is useful when a player stays in the lobby waiting for a new game room creation. |
|
Similar to the |
|
When a public message is sent from a user, everyone within the room will receive this event notification. |
|
This is an event when receiving a private message from other users. |
The events are broadcasted to the users depending on which room type they are in. It is important to know which events are available while designing the virtual world.
Regular room |
Game room |
Limbo room | |
---|---|---|---|
|
Yes |
Yes |
No |
|
Yes |
Yes |
No |
|
No |
Yes |
No |
|
Yes |
No |
Yes |
|
Yes |
No |
Yes |
|
Yes |
Yes |
No |
|
Yes |
Yes |
Yes |
From the preceding table we can see that game room will not receive onRoomAdded/onRoomDeleted
messages because while playing a game we are usually not interested whether a new room is created or deleted.
The limbo room as described before only receives onRoomAdded/onRoomDeleted
and onPrivateMessage
events. Other events that may cause large traffic are all disabled in the limbo room to ensure that the limbo room can handle thousands of concurrent user connections without increasing the traffic bandwidth.
We discussed some basic events in this section. A full list of events and details can be found here:
http://smartfoxserver.com/docs/docPages/as3/html/it_gotoandplay_smartfoxserver_SFSEvent.html
18.116.40.177