Skip to content

Class: LobbyServiceProvider ​

csharp
public abstract class LobbyServiceProvider : MonoBehaviour

Properties ​

NameDeclarationDescription
currentLobbypublic abstract LobbyInstance currentLobby { get; }
foundLobbiespublic LobbySearchResult foundLobbies { get; set; }
isRefreshingLobbypublic bool isRefreshingLobby { get; }

Methods ​

CreateLobby() ​

Create a new lobby. You can use this to either create a new lobby or replace old faulty/deleted lobby mid-session.

csharp
public abstract UniTask CreateLobby()

Returns: Cysharp.Threading.Tasks.UniTask

GenerateRandomShortCode() ​

csharp
public string GenerateRandomShortCode()

Returns: string

GetGameServerAddress() ​

csharp
public abstract string GetGameServerAddress()

Returns: string

GetLobbies(Action<LobbySearchResult>, object) ​

Get list of lobbies we can join.

csharp
public abstract UniTask GetLobbies(Action<LobbySearchResult> onUpdated, object continuationToken = null)

Parameters:

NameTypeDescription
onUpdatedSystem.Action<T><LobbySearchResult>
continuationTokenobject

Returns: Cysharp.Threading.Tasks.UniTask

HandleUserLeavingGame(string) ​

Handle user leaving the game server. The user must be removed from the lobby if possible.

csharp
public abstract UniTask HandleUserLeavingGame(string id)

Parameters:

NameTypeDescription
idstring

Returns: Cysharp.Threading.Tasks.UniTask

InvokeOnCurrentLobbyChanged() ​

You must call this when currentLobby's value changes or its property(s) changes.

csharp
protected void InvokeOnCurrentLobbyChanged()

JoinGameOfCurrentLobby() ​

csharp
public virtual UniTask JoinGameOfCurrentLobby()

Returns: Cysharp.Threading.Tasks.UniTask

JoinLobby(object) ​

Join a lobby. If you want to join the game of the lobby, you need to call respective function as well.

csharp
public abstract UniTask JoinLobby(object lobby)

Parameters:

NameTypeDescription
lobbyobject

Returns: Cysharp.Threading.Tasks.UniTask

LeaveLobby() ​

Leave current lobby. This can be called anytime even when you are not in a lobby, to make sure you don't have any leftover lobbies.

csharp
public abstract UniTask LeaveLobby()

Returns: Cysharp.Threading.Tasks.UniTask

RefreshLobbies(object) ​

Refresh foundLobbies result.

csharp
public UniTaskVoid RefreshLobbies(object continuationToken = null)

Parameters:

NameTypeDescription
continuationTokenobject

Returns: Cysharp.Threading.Tasks.UniTaskVoid

SetBasicAttributes() ​

csharp
public UniTask SetBasicAttributes()

Returns: Cysharp.Threading.Tasks.UniTask

SetLobbyAttribute(string, object) ​

csharp
public abstract UniTask SetLobbyAttribute(string key, object value)

Parameters:

NameTypeDescription
keystring
valueobject

Returns: Cysharp.Threading.Tasks.UniTask

Maintained by the Shape of Dreams Modding Community