CreateRoomRequest Class |
Namespace: Sfs2X.Requests
public class CreateRoomRequest : BaseRequest
Name | Description | |
---|---|---|
CreateRoomRequest(RoomSettings) |
See CreateRoomRequest(RoomSettings, bool, Room) constructor.
| |
CreateRoomRequest(RoomSettings, Boolean) |
See CreateRoomRequest(RoomSettings, bool, Room) constructor.
| |
CreateRoomRequest(RoomSettings, Boolean, Room) |
Creates a new CreateRoomRequest instance.
|
void SomeMethod() { sfs.AddEventListener(SFSEvent.ROOM_ADDED, OnRoomAdded); sfs.AddEventListener(SFSEvent.ROOM_CREATION_ERROR, OnRoomCreationError); // Create a new Chat Room RoomSettings settings = new RoomSettings("My Chat Room"); settings.MaxUsers = 40; settings.GroupId = "chats"; sfs.Send( new CreateRoomRequest(settings) ); } void OnRoomAdded(BaseEvent evt) { Console.WriteLine("Room created: " + (Room)evt.Params["room"]); // .Net / Unity System.Diagnostics.Debug.WriteLine("Room created: " + (Room)evt.Params["room"]); // UWP } void OnRoomCreationError(BaseEvent evt) { Console.WriteLine("Room creation failed: " + (string)evt.Params["errorMessage"]); // .Net / Unity System.Diagnostics.Debug.WriteLine("Room creation failed: " + (string)evt.Params["errorMessage"]); // UWP }