Retrieves a Room object from its name.
SmartFox2X (in SmartFox2X.dll) Version: 220.127.116.11 (1.7.11)
public Room GetRoomByName(
- Type: SystemString
The name of the Room.
An object representing the requested Room; null
if no Room
object with the passed name exists in the Rooms list.
The same object is returned by the IRoomManager.getRoomById()
method, accessible through the RoomManager
this was replicated on the SmartFox
class for handy access due to its usually frequent usage.
The following example retrieves a Room
object and writes its id:
string roomName = "The Lobby";
Room room = sfs.GetRoomByName(roomName);
Console.WriteLine("The id of Room '" + roomName + "' is " + room.Id);
System.Diagnostics.Debug.WriteLine("The id of Room '" + roomName + "' is " + room.Id);