SFSEvent.USER_COUNT_CHANGE Field |
Namespace: Sfs2X.Core
The Params object contains the following parameters:
Parameter | Description |
---|---|
room | (Room) An object representing the Room in which the users count changed. |
uCount | (int) The new users count (players in case of Game Room). |
sCount | (int) The new spectators count (Game Rooms only). |
void SomeMethod() { sfs.AddEventListener(SFSEvent.USER_COUNT_CHANGE, OnUserCountChange); } void OnUserCountChange(BaseEvent evt) { Room room = (Room)evt.Params["room"]; int uCount = (int)evt.Params["uCount"]; int sCount = (int)evt.Params["sCount"]; Console.WriteLine("Room: " + room.Name + " contains " + uCount + " users and " + sCount + " spectators"); // .Net / Unity System.Diagnostics.Debug.WriteLine("Room: " + room.Name + " contains " + uCount + " users and " + sCount + " spectators"); // UWP }