Interface IRoomManager

All Known Implementing Classes:
SFSRoomManager

public interface IRoomManager
The IRoomManager interface defines all the methods and properties exposed by the client-side manager of the SmartFoxServer Room entities.

In the SmartFoxServer 3 client API this interface is implemented by the SFSRoomManager class. Read the class description for additional informations.

See Also:
  • Method Details

    • addRoom

      void addRoom(Room room)
      Internal
    • addRoom

      void addRoom(Room room, boolean addGroupIfMissing)
      Internal
    • addGroup

      void addGroup(String groupId)
      Internal
    • updateRoomList

      void updateRoomList(ISFSArray roomList) throws SFSException
      Throws:
      SFSException
      Internal
    • removeGroup

      void removeGroup(String groupId)
      Internal
    • containsGroup

      boolean containsGroup(String groupId)
      Indicates whether the specified Group has been subscribed by the client or not.
      Parameters:
      groupId - The name of the Group.
      Returns:
      true if the client subscribed the passed Group.
    • containsRoom

      boolean containsRoom(int id)
      Indicates whether a Room exists in the Rooms list or not.
      Parameters:
      id - The id of the Room object whose presence in the Rooms list is to be tested.
      Returns:
      true if the passed Room exists in the Rooms list.
      See Also:
    • containsRoom

      boolean containsRoom(String name)
      Indicates whether a Room exists in the Rooms list or not.
      Parameters:
      name - The name of the Room object whose presence in the Rooms list is to be tested.
      Returns:
      true if the passed Room exists in the Rooms list.
      See Also:
    • containsRoomInGroup

      boolean containsRoomInGroup(int roomId, String groupId)
      Indicates whether the Rooms list contains a Room belonging to the specified Group or not.
      Parameters:
      roomId - The id of the Room object whose presence in the Rooms list is to be tested.
      groupId - The name of the Group to which the specified Room must belong.
      Returns:
      true if the Rooms list contains the passed Room and it belongs to the specified Group.
      See Also:
    • containsRoomInGroup

      boolean containsRoomInGroup(String roomName, String groupId)
      Indicates whether the Rooms list contains a Room belonging to the specified Group or not.
      Parameters:
      roomName - The name of the Room object whose presence in the Rooms list is to be tested.
      groupId - The name of the Group to which the specified Room must belong.
      Returns:
      true if the Rooms list contains the passed Room and it belongs to the specified Group.
      See Also:
    • changeRoomName

      void changeRoomName(Room room, String newName)
      Internal
    • changeRoomPasswordState

      void changeRoomPasswordState(Room room, boolean isPassProtected)
      Internal
    • changeRoomCapacity

      void changeRoomCapacity(Room room, int maxUsers, int maxSpect)
      Internal
    • getRoomById

      Room getRoomById(int id)
      Retrieves a Room object from its id.
      Parameters:
      id - The id of the Room.
      Returns:
      An object representing the requested Room; null if no Room object with the passed id exists in the Rooms list.

      Example
      The following example retrieves a Room object and traces its name:

               
               	int roomId = 3;
               	Room room = sfs.getRoomById(roomId);
               	System.out.println("The name of Room " + roomId + " is " + room.getName());
               
               
      See Also:
    • getRoomByName

      Room getRoomByName(String name)
      Retrieves a Room object from its name.
      Parameters:
      name - The name of the Room.
      Returns:
      An object representing the requested Room; null if no Room object with the passed name exists in the Rooms list.

      Example
      The following example retrieves a Room object and traces its id:

               
               	String roomName = "The Lobby";
               	Room room = sfs.getRoomByName(roomName);
               	System.out.println("The ID of Room '" + roomName + "' is " + room.getId());
               
               
      See Also:
    • getRoomList

      List<Room> getRoomList()
      Returns a list of Rooms currently "known" by the client. The list contains all the Rooms that are currently joined and all the Rooms belonging to the Room Groups that have been subscribed.

      NOTE: at login time, the client automatically subscribes all the Room Groups specified in the Zone's Default Room Groups setting.

      Returns:
      The list of the available Room objects.
      See Also:
    • getRoomCount

      int getRoomCount()
      Returns the current number of Rooms in the Rooms list.
      Returns:
      The number of Rooms in the Rooms list.
    • getRoomGroups

      List<String> getRoomGroups()
      Returns the names of Room Groups currently subscribed by the client.

      NOTE: at login time, the client automatically subscribes all the Room Groups specified in the Zone's Default Room Groups setting.

      Returns:
      A list of Room Group names.
      See Also:
    • getRoomListFromGroup

      List<Room> getRoomListFromGroup(String groupId)
      Retrieves the list of Rooms which are part of the specified Room Group.
      Parameters:
      groupId - The name of the Group.
      Returns:
      The list of Room objects belonging to the passed Room Group.
      See Also:
    • getJoinedRooms

      List<Room> getJoinedRooms()
      Returns a list of Rooms currently joined by the client.
      Returns:
      The list of Room objects representing the Rooms currently joined by the client.
      See Also:
    • getUserRooms

      List<Room> getUserRooms(User user)
      Retrieves a list of Rooms joined by the specified user. The list contains only those Rooms "known" by the Room Manager; the user might have joined others the client is not aware of.
      Parameters:
      user - A User object representing the user to look for in the current Rooms list.
      Returns:
      The list of Rooms joined by the passed user.
    • removeRoom

      void removeRoom(Room room)
      Internal
    • removeRoomById

      void removeRoomById(int id)
      Internal
    • removeRoomByName

      void removeRoomByName(String name)
      Internal
    • removeUser

      void removeUser(User user)
      Internal
    • getSmartFox

      ISmartFox getSmartFox()
      Internal