Click or drag to resize

SFSEventUSER_EXIT_ROOM Field

Dispatched when one of the Rooms joined by the current user is left by another user, or by the current user himself.

Namespace:  Sfs2X.Core
Assembly:  SmartFox2X (in SmartFox2X.dll) Version: 1.8.0.0 (1.8.0)
Syntax
C#
public static readonly string USER_EXIT_ROOM

Field Value

Type: String
Remarks
This event is caused by a LeaveRoomRequest request; it might be fired or not depending on the Room configuration defined upon its creation (see the RoomSettings.Events setting).

NOTE: if the Room is of type MMORoom, this event is never fired and it is substituted by the PROXIMITY_LIST_UPDATE event.

The Params object contains the following parameters:

ParameterDescription
user(User) An object representing the user who left the Room.
room(Room) An object representing the Room that was left by the user.
Examples
The following example shows how to handle this event type:
void SomeMethod() {
    smartFox.AddEventListener(SFSEvent.USER_EXIT_ROOM, OnUserExitRoom);
}

void OnUserExitRoom(BaseEvent evt) {
    Room room = (Room)evt.Params["room"];
    User user = (User)evt.Params["user"];

    Console.WriteLine("User: " + user.Name + " has just left Room: " + room.Name);                          // .Net / Unity
    System.Diagnostics.Debug.WriteLine("User: " + user.Name + " has just left Room: " + room.Name);         // UWP
}
See Also