Class LobbyServiceProvider
Inheritance
object
UnityEngine.Object
UnityEngine.Component
UnityEngine.Behaviour
UnityEngine.MonoBehaviour
LobbyServiceProvider
Assembly: Dew.Core.dll
Syntax
public abstract class LobbyServiceProvider : MonoBehaviour
Properties
currentLobby
Declaration
public abstract LobbyInstance currentLobby { get; }
Property Value
foundLobbies
Declaration
public LobbySearchResult foundLobbies { get; set; }
Property Value
isRefreshingLobby
Declaration
public bool isRefreshingLobby { get; }
Property Value
Methods
CreateLobby()
Create a new lobby. You can use this to either create a new lobby or replace old faulty/deleted lobby mid-session.
Declaration
public abstract UniTask CreateLobby()
Returns
| Type |
Description |
| Cysharp.Threading.Tasks.UniTask |
|
GenerateRandomShortCode()
Declaration
public string GenerateRandomShortCode()
Returns
GetGameServerAddress()
Declaration
public abstract string GetGameServerAddress()
Returns
GetLobbies(Action<LobbySearchResult>, object)
Get list of lobbies we can join.
Declaration
public abstract UniTask GetLobbies(Action<LobbySearchResult> onUpdated, object continuationToken = null)
Parameters
| Type |
Name |
Description |
| System.Action<T><LobbySearchResult> |
onUpdated |
|
| object |
continuationToken |
|
Returns
| Type |
Description |
| Cysharp.Threading.Tasks.UniTask |
|
HandleUserLeavingGame(string)
Handle user leaving the game server. The user must be removed from the lobby if possible.
Declaration
public abstract UniTask HandleUserLeavingGame(string id)
Parameters
| Type |
Name |
Description |
| string |
id |
|
Returns
| Type |
Description |
| Cysharp.Threading.Tasks.UniTask |
|
InvokeOnCurrentLobbyChanged()
You must call this when currentLobby's value changes or its property(s) changes.
Declaration
protected void InvokeOnCurrentLobbyChanged()
JoinGameOfCurrentLobby()
Declaration
public virtual UniTask JoinGameOfCurrentLobby()
Returns
| Type |
Description |
| 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.
Declaration
public abstract UniTask JoinLobby(object lobby)
Parameters
| Type |
Name |
Description |
| object |
lobby |
|
Returns
| Type |
Description |
| 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.
Declaration
public abstract UniTask LeaveLobby()
Returns
| Type |
Description |
| Cysharp.Threading.Tasks.UniTask |
|
RefreshLobbies(object)
Refresh foundLobbies result.
Declaration
public UniTaskVoid RefreshLobbies(object continuationToken = null)
Parameters
| Type |
Name |
Description |
| object |
continuationToken |
|
Returns
| Type |
Description |
| Cysharp.Threading.Tasks.UniTaskVoid |
|
SetBasicAttributes()
Declaration
public UniTask SetBasicAttributes()
Returns
| Type |
Description |
| Cysharp.Threading.Tasks.UniTask |
|
SetLobbyAttribute(string, object)
Declaration
public abstract UniTask SetLobbyAttribute(string key, object value)
Parameters
| Type |
Name |
Description |
| string |
key |
|
| object |
value |
|
Returns
| Type |
Description |
| Cysharp.Threading.Tasks.UniTask |
|
Extension Methods