Class LobbyOwnerSession
public class LobbyOwnerSession
- Inheritance
-
LobbyOwnerSession
Constructors
LobbyOwnerSession(LobbyData, IAuthClient, IRequestFactory)
public LobbyOwnerSession(LobbyData lobbyData, IAuthClient authClient, IRequestFactory requestFactory)
Parameters
lobbyDataLobbyDataauthClientIAuthClientrequestFactoryIRequestFactory
Methods
AddOrUpdateLobbyAttributes(List<CloudAttribute>, Action<RequestResponse<bool>>)
Through this method you will be able to add new Attributes or update existing Attributes. Deleting existing Attributes is not supported, the list supplied as parameter will be merged with your current Attributes if the request succeeds with the backend.
public void AddOrUpdateLobbyAttributes(List<CloudAttribute> attributes, Action<RequestResponse<bool>> onRequestFinished)
Parameters
attributesList<CloudAttribute>List of Attributes to be added or updated from the current Lobby.
onRequestFinishedAction<RequestResponse<bool>>Callback that will be invoked when the request finished.
AddOrUpdateLobbyAttributesAsync(List<CloudAttribute>)
Through this method you will be able to add new Attributes or update existing Attributes. Deleting existing Attributes is not supported, the list supplied as parameter will be merged with your current Attributes if the request succeeds with the backend.
public Task<bool> AddOrUpdateLobbyAttributesAsync(List<CloudAttribute> attributes)
Parameters
attributesList<CloudAttribute>List of Attributes to be added or updated from the current Lobby.
Returns
GetAddOrUpdateLobbyAttributesCooldown()
public TimeSpan GetAddOrUpdateLobbyAttributesCooldown()
Returns
- TimeSpan
Returns the internal cooldown for the Add Or Update Lobby Attributes endpoint.
KickPlayer(Player, Action<RequestResponse<bool>>)
Kick a Player from the active Lobby.
public void KickPlayer(Player player, Action<RequestResponse<bool>> onRequestFinished)
Parameters
playerPlayerPlayer that will be kicked from the Lobby.
onRequestFinishedAction<RequestResponse<bool>>Callback that will be invoked when the request finished.
KickPlayerAsync(Player)
Kick a Player from the active Lobby.
public Task<bool> KickPlayerAsync(Player player)
Parameters
playerPlayerPlayer that will be kicked from the Lobby.
Returns
StartGameSession(Action<RequestResponse<bool>>, int?, bool, bool)
Starts a game session for the current Lobby. A room will be created by coherence and supplied through the LobbiesService.OnPlaySessionStarted Callback.
public void StartGameSession(Action<RequestResponse<bool>> onRequestFinished, int? maxPlayers = null, bool unlistLobby = true, bool closeLobby = false)
Parameters
onRequestFinishedAction<RequestResponse<bool>>Callback that will be invoked when the request finished.
maxPlayersint?Optional parameter to specify the max amount of Players allowed in the Room. If not supplied, the max amount of Players of the Lobby will be used.
unlistLobbyboolOptional parameter to unlist the Lobby. Unlisting the Lobby means that no other Player will be able to find the Lobby through matchmaking. True by default.
closeLobbyboolOptional parameter to close the Lobby. Closing the Lobby means that no other Player will be able to join the Lobby. False by default.
StartGameSessionAsync(int?, bool, bool)
Starts a game session for the current Lobby. A room will be created by coherence and supplied through the LobbiesService.OnPlaySessionStarted Callback.
public Task<bool> StartGameSessionAsync(int? maxPlayers = null, bool unlistLobby = true, bool closeLobby = false)
Parameters
maxPlayersint?Optional parameter to specify the max amount of Players allowed in the Room. If not supplied, the max amount of Players of the Lobby will be used.
unlistLobbyboolOptional parameter to unlist the Lobby. Unlisting the Lobby means that no other Player will be able to find the Lobby through matchmaking. True by default.
closeLobbyboolOptional parameter to close the Lobby. Closing the Lobby means that no other Player will be able to join the Lobby. False by default.