ExitSession
Namespace: SynicSugar.P2P
Class: ConnectHub
public async UniTask<bool> ExitSession(bool destroyManager = true, bool cleanupMemberCountChanged = false, CancellationToken cancelToken = default(CancellationToken))
Description
Stop the packet receiver, close all connections, remove the notify events and destroy ConnectManager object. Then, the user leaves Lobby.
The last user closes the lobby in Backend.
destroyManager: If true, destroy NetworkManager after exit lobby.
cleanupMemberCountChanged: Need to call MatchMakeManager.Instance.MatchMakingGUIEvents.LobbyMemberCountChanged(id, false) after exit lobby?
cancelToken: ancel token for this task
using SynicSugar.P2P;
using System.Threading;
public class p2pSample {
public async void ConnectHubSample(){
await ConnectHub.Instance.ExitSession();
}
}