Class CloudRoomsService
Public API to interface with Rooms from your Project in the coherence Cloud. If you wish to create, delete or fetch rooms in a self-hosted Replication Server, you can instantiate a ReplicationServerRoomsService instead.
public class CloudRoomsService : IRoomsService
- Inheritance
-
CloudRoomsService
- Implements
- Extension Methods
Constructors
CloudRoomsService(string, CloudCredentialsPair, IRuntimeSettings)
public CloudRoomsService(string region, CloudCredentialsPair credentialsPair = null, IRuntimeSettings runtimeSettings = null)
Parameters
region
stringcredentialsPair
CloudCredentialsPairruntimeSettings
IRuntimeSettings
Properties
CachedRooms
List of cached Rooms that were fetched by the FetchRooms method.
public IReadOnlyList<RoomData> CachedRooms { get; }
Property Value
Methods
CreateRoom(Action<RequestResponse<RoomData>>, RoomCreationOptions)
Create a room with the given options in the coherence Cloud.
public void CreateRoom(Action<RequestResponse<RoomData>> onRequestFinished, RoomCreationOptions roomCreationOptions)
Parameters
onRequestFinished
Action<RequestResponse<RoomData>>Callback that will be invoked when the request finished, it includes the created room.
roomCreationOptions
RoomCreationOptionsInstance of all the room options that you wish to create the room with.
CreateRoomAsync(RoomCreationOptions)
Create a room with the given options in the coherence Cloud asynchronously.
public Task<RoomData> CreateRoomAsync(RoomCreationOptions roomCreationOptions)
Parameters
roomCreationOptions
RoomCreationOptionsInstance of all the room options that you wish to create the room with.
Returns
FetchRooms(Action<RequestResponse<IReadOnlyList<RoomData>>>, string[])
Fetch the available rooms in the coherence Cloud.
public void FetchRooms(Action<RequestResponse<IReadOnlyList<RoomData>>> onRequestFinished, string[] tags = null)
Parameters
onRequestFinished
Action<RequestResponse<IReadOnlyList<RoomData>>>Callback that will be invoked when the request finished, it includes the fetched rooms.
tags
string[]Filter the results by a list of tags.
FetchRoomsAsync(string[])
Fetch the available rooms in the coherence Cloud asynchronously.
public Task<IReadOnlyList<RoomData>> FetchRoomsAsync(string[] tags = null)
Parameters
tags
string[]Filter the results by a list of tags.
Returns
GetCreateRoomCooldown()
public TimeSpan GetCreateRoomCooldown()
Returns
- TimeSpan
Returns the internal cooldown for the Create Room endpoint.
GetFetchRoomsCooldown()
public TimeSpan GetFetchRoomsCooldown()
Returns
- TimeSpan
Returns the internal cooldown for the Fetch Rooms endpoint.
GetRemoveRoomCooldown()
public TimeSpan GetRemoveRoomCooldown()
Returns
- TimeSpan
Returns the internal cooldown for the Remove Room endpoint.
MatchRoom(Action<RequestResponse<RoomMatchResponse>>, string[])
Match against a joinable room with the given options in the coherence Cloud.
public void MatchRoom(Action<RequestResponse<RoomMatchResponse>> onRequestFinished, string[] tags = null)
Parameters
onRequestFinished
Action<RequestResponse<RoomMatchResponse>>Callback that will be invoked when the request finished, it includes the matched room or null.
tags
string[]Filter the results by a list of tags.
MatchRoomAsync(string[])
Match a room with the given options in the coherence Cloud asynchronously.
public Task<RoomMatchResponse> MatchRoomAsync(string[] tags = null)
Parameters
tags
string[]Filter the results by a list of tags.
Returns
RemoveRoom(ulong, string, Action<RequestResponse<string>>)
Remove an existing room that you have created in the coherence Cloud.
public void RemoveRoom(ulong uniqueID, string secret, Action<RequestResponse<string>> onRequestFinished)
Parameters
uniqueID
ulongUnique ID of the room you wish to remove. Can be found in RoomData.UniqueId
secret
stringToken that will allow you to remove the room. Can be found in RoomData.Secret
onRequestFinished
Action<RequestResponse<string>>Callback that will be invoked when the request finished.
RemoveRoomAsync(ulong, string)
Remove an existing room that you have created in the coherence Cloud.
public Task RemoveRoomAsync(ulong uniqueID, string secret)
Parameters
uniqueID
ulongUnique ID of the room you wish to remove. Can be found in RoomData.UniqueId
secret
stringToken that will allow you to remove the room. Can be found in RoomData.Secret
Returns
UnlistRoom(ulong, string, Action<RequestResponse<string>>)
Unlist an existing room that you have created in the coherence Cloud.
public void UnlistRoom(ulong uniqueID, string secret, Action<RequestResponse<string>> onRequestFinished)
Parameters
uniqueID
ulongUnique ID of the room you wish to unlist. Can be found in RoomData.UniqueId
secret
stringToken that will allow you to unlist the room. Can be found in RoomData.Secret
onRequestFinished
Action<RequestResponse<string>>Callback that will be invoked when the request finished.
UnlistRoomAsync(ulong, string)
Unlist an existing room that you have created in the coherence Cloud.
public Task UnlistRoomAsync(ulong uniqueID, string secret)
Parameters
uniqueID
ulongUnique ID of the room you wish to unlist. Can be found in RoomData.UniqueId
secret
stringToken that will allow you to unlist the room. Can be found in RoomData.Secret