SFSEventUSER_ENTER_ROOM Field |
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.8.0.0 (1.8.0)
Syntax public static readonly string USER_ENTER_ROOM
Field Value
Type:
StringRemarks
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:
Parameter | Description |
---|
user | (User) An object representing the user who joined the Room. |
room | (Room) An object representing the Room that was joined by a user. |
Examples
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);
System.Diagnostics.Debug.WriteLine("User: " + user.Name + " has just joined Room: " + room.Name);
}
See Also