|
ElectroServer 5 Client: C#
|
When a user is joined successfully to a room this event occurs. More...
Public Member Functions | |
| JoinRoomEvent () | |
| JoinRoomEvent (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] |
| The id of the zone that contains the room. More... | |
| int | RoomId [get, set] |
| The id of the room the user just joined. More... | |
| string | RoomName [get, set] |
| The name of the room the user just joined. More... | |
| string | RoomDescription [get, set] |
| Optional field. More... | |
| bool | HasPassword [get, set] |
| If the room is password protected, this is true. More... | |
| bool | Hidden [get, set] |
| If the room is hidden, this is true. More... | |
| int | Capacity [get, set] |
| The number of users allowed in this room. More... | |
| List< UserListEntry > | Users [get, set] |
| A list of users (UserListEntry) that are in this room. More... | |
| List< RoomVariable > | RoomVariables [get, set] |
| A list of RoomVariables in this room. More... | |
| List< string > | PluginHandles [get, set] |
| A list of plugins attached to this room. More... | |
When a user is joined successfully to a room this event occurs.
A user can end up in a room in one of two ways: 1) They can opt into joining the room by using the JoinRoomRequest or CreateRoomRequest requests, or 2) a server extension can put them into a room. In either case this event will occur if the room is joined.
In the event of a CreateRoomRequest that fails to join a room, the client will be sent a GenericErrorResponse.
Shows the most simple example of how to create a new room and capture the JoinRoomEvent.
package {
import com.electrotank.electroserver5.api.CreateRoomRequest;
import com.electrotank.electroserver5.api.JoinRoomEvent;
import com.electrotank.electroserver5.api.MessageType;
import com.electrotank.electroserver5.ElectroServer;
import com.electrotank.electroserver5.user.User;
import com.electrotank.electroserver5.zone.Room;
import flash.events.Event; public class RoomJoiner {
private var _es:ElectroServer;
public function initialize():void {
listen for the JoinRoomEvent so we know when it happens
_es.engine.addEventListener(MessageType.JoinRoomEvent.name, onJoinRoomEvent);
create the request and populate it with the room details
var crr:CreateRoomRequest = new CreateRoomRequest();
crr.roomName = "MyRoom";
crr.zoneName = "MyZone";send it
_es.engine.send(crr);
} private function onJoinRoomEvent(e:JoinRoomEvent):void {
trace("room joined!");get the room you're in
var room:Room = _es.managerHelper.zoneManager.zoneById(e.zoneId).roomById(e.roomId);print out the users in the room
for each (var user:User in room.users) {
trace(user.userName);
}
} public function set es(value:ElectroServer):void {
_es = value;
}}
}
| Electrotank.Electroserver5.Api.JoinRoomEvent.JoinRoomEvent | ( | ) |
| Electrotank.Electroserver5.Api.JoinRoomEvent.JoinRoomEvent | ( | TBase | t | ) |
|
virtual |
Implements Electrotank.Electroserver5.Api.EsMessage.
|
virtual |
Implements Electrotank.Electroserver5.Api.EsMessage.
|
virtual |
Implements Electrotank.Electroserver5.Api.EsMessage.
|
getset |
The number of users allowed in this room.
A value of -1 means there is no restriction.
|
getset |
If the room is password protected, this is true.
|
getset |
If the room is hidden, this is true.
|
getset |
A list of plugins attached to this room.
|
getset |
Optional field.
The description of the room the user just joined.
|
getset |
The id of the room the user just joined.
|
getset |
The name of the room the user just joined.
|
getset |
A list of RoomVariables in this room.
|
getset |
A list of users (UserListEntry) that are in this room.
|
getset |
The id of the zone that contains the room.