Click or drag to resize


Dispatched when one of the Rooms joined by the current user is entered by another user.

Namespace:  Sfs2X.Core
Assembly:  SmartFox2X (in SmartFox2X.dll) Version: (1.7.11)
public static readonly string USER_ENTER_ROOM

Field Value

Type: String
This event is caused by a JoinRoomRequest 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 joined the Room.
room(Room) An object representing the Room that was joined by a user.
The following example shows how to handle this event type:
void SomeMethod() {
    sfs.AddEventListener(SFSEvent.USER_ENTER_ROOM, OnUserEnterRoom);

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

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