|
ElectroServer 5 Client: C#
|
This event occurs when the room list changes in a zone that your client can see, or when a public property on a room in that zone changes. More...
Public Member Functions | |
| ZoneUpdateEvent () | |
| ZoneUpdateEvent (TBase t) | |
| override TBase | ToThrift () |
| override TBase | NewThrift () |
| override void | FromThrift (TBase t_) |
Public Member Functions inherited from Electrotank.Electroserver5.Api.EsEvent | |
| EsEvent () | |
Properties | |
| int | ZoneId [get, set] |
| Id of the zone that was updated. More... | |
| ZoneUpdateAction | Action [get, set] |
| ZoneUpdateAction instance that describes the type of update that occurred. More... | |
| int | RoomId [get, set] |
| The id of the room that was created or updated, if applicable. More... | |
| int | RoomCount [get, set] |
| The number of users in the updated room, if applicable. More... | |
| RoomListEntry | RoomListEntry [get, set] |
| The room that was added or updated, if applicable. More... | |
This event occurs when the room list changes in a zone that your client can see, or when a public property on a room in that zone changes.
For example, this event occurs whenever a room is created, removed, or when something public about a room is updated such as its description or user count.
This example shows how to listen for the event and then access the updated information.
private var _es:ElectroServer;
private function initialize():void {
_es.engine.addEventListener(MessageType.ZoneUpdateEvent.name, onZoneUpdateEvent);
}private function onZoneUpdateEvent(e:ZoneUpdateEvent):void {
switch (e.action) {
case ZoneUpdateAction.AddRoom:
//the managerHelper already knows about this new room, so access it that way
trace("this room just added: " +_es.managerHelper.zoneManager.zoneById(e.zoneId).roomById(e.roomId).name);
break;
case ZoneUpdateAction.DeleteRoom:
//the managerHelper has already removed the room, so to see the name of what was removed inspect the event object
trace("this room just removed: " + e.roomListEntry.roomName);
break;
case ZoneUpdateAction.UpdateRoom:
//the managerHelper has already updated the userCount for this room
// Note: there is no roomListEntry for the event with an UpdateRoom action!
trace("User count for roomId: " + e.roomId + " just changed to: " + e.roomCount);
break;
}
}
| Electrotank.Electroserver5.Api.ZoneUpdateEvent.ZoneUpdateEvent | ( | ) |
| Electrotank.Electroserver5.Api.ZoneUpdateEvent.ZoneUpdateEvent | ( | TBase | t | ) |
|
virtual |
Implements Electrotank.Electroserver5.Api.EsMessage.
|
virtual |
Implements Electrotank.Electroserver5.Api.EsMessage.
|
virtual |
Implements Electrotank.Electroserver5.Api.EsMessage.
|
getset |
ZoneUpdateAction instance that describes the type of update that occurred.
|
getset |
The number of users in the updated room, if applicable.
|
getset |
The id of the room that was created or updated, if applicable.
|
getset |
The room that was added or updated, if applicable.
|
getset |
Id of the zone that was updated.