ChangeRoomNameRequest Class |
Namespace: Sfs2X.Requests
public class ChangeRoomNameRequest : BaseRequest
The ChangeRoomNameRequest type exposes the following members.
Name | Description | |
---|---|---|
ChangeRoomNameRequest |
Creates a new ChangeRoomNameRequest instance.
|
void SomeMethod() { sfs.AddEventListener(SFSEvent.ROOM_NAME_CHANGE, OnRoomNameChange); sfs.AddEventListener(SFSEvent.ROOM_NAME_CHANGE_ERROR, OnRoomNameChangeError); Room theRoom = sfs.GetRoomByName("Gonzo's Room"); sfs.Send( new ChangeRoomNameRequest(theRoom, "Gonzo The Great's Room") ); } void OnRoomNameChange(BaseEvent evt) { Room theRoom = (Room)evt.Params["room"]; Console.WriteLine("Room " + (string)evt.Params["oldName"] + " was successfully renamed to " + theRoom.Name); // .Net / Unity System.Diagnostics.Debug.WriteLine("Room " + (string)evt.Params["oldName"] + " was successfully renamed to " + theRoom.Name); // UWP } void OnRoomNameChangeError(BaseEvent evt) { Console.WriteLine("Room name change failed: " + (string)evt.Params["errorMessage"]); // .Net / Unity System.Diagnostics.Debug.WriteLine("Room name change failed: " + (string)evt.Params["errorMessage"]); // UWP }