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.7.3)


public static readonly string USER_EXIT_ROOM

Field Value

Type: String


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:

user(User) An object representing the user who left the Room.
room(Room) An object representing the Room that was left by the user.


The following example shows how to handle this event type:
 Copy imageCopy
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);         // Windows Universal

See Also