class RoomManagementService
(Niantic.Lightship.SharedAR.Rooms.RoomManagementService)
Overview
The RoomManagementService provides interface to access Room Management Service backend to create, remove, find Rooms. A room is an entity to connect multiple peers through server relayed network.
class RoomManagementService {
public:
struct GetOrCreateRoomAsyncTaskResult;
// methods
static RoomManagementServiceStatus CreateRoom(
RoomParams roomParams,
out IRoom outRoom
);
static RoomManagementServiceStatus DeleteRoom(string roomId);
static RoomManagementServiceStatus GetRoom(string roomId, out IRoom outRoom);
static RoomManagementServiceStatus QueryRoomsByName(
string name,
out List<IRoom> rooms
);
static RoomManagementServiceStatus GetAllRooms(out List<IRoom> rooms);
static RoomManagementServiceStatus GetOrCreateRoomForName(
RoomParams roomParams,
out IRoom outRoom
);
static void GetOrCreateRoomAsync(
string roomName,
string roomDesc,
uint roomCapacity,
GetOrCreateRoomCallback doneCb
);
static async Task<GetOrCreateRoomAsyncTaskResult> GetOrCreateRoomAsync(
string roomName,
string roomDescription,
uint roomCapacity
);
delegate void GetOrCreateRoomCallback(
RoomManagementServiceStatus status,
string room_id
);
};
Detailed Documentation
The RoomManagementService provides interface to access Room Management Service backend to create, remove, find Rooms. A room is an entity to connect multiple peers through server relayed network.
Methods
CreateRoom
static RoomManagementServiceStatus CreateRoom(
RoomParams roomParams,
out IRoom outRoom
)
Create a new room on the server.
Parameters:
roomParams
- Parameters of the room
outRoom
- Created room as IRoom object. null if failed to create.
Returns:
Status of the operation
DeleteRoom
static RoomManagementServiceStatus DeleteRoom(string roomId)
Delete a room on the server.
Parameters:
roomId
- Room ID of the room to delete
Returns:
Status of the operation
GetRoom
static RoomManagementServiceStatus GetRoom(string roomId, out IRoom outRoom)
Get a room by Room ID on the server
Parameters:
roomId
- Room ID as a string
outRoom
- Found Room object. Null if operation failed or room ID not found<//param>
Returns:
Status of the operation
QueryRoomsByName
static RoomManagementServiceStatus QueryRoomsByName(
string name,
out List<IRoom> rooms
)
Query room(s) by name on the server
Parameters:
name
- Name of the room to find
rooms
- A List of rooms which has matching name
Returns:
Status of the operation
GetAllRooms
static RoomManagementServiceStatus GetAllRooms(out List<IRoom> rooms)
Get all rooms on the server, which was created by this app
Parameters:
rooms
- List of rooms available for this app
Returns:
Status of the operation
GetOrCreateRoomForName
static RoomManagementServiceStatus GetOrCreateRoomForName(
RoomParams roomParams,
out IRoom outRoom
)
Get a IRoom object that has a given name on the server. If no room found with the name, create a new room using given room parameters