Skip to content

Commit 0382392

Browse files
committed
using state machine's monobehaviour for coroutines
(cherry picked from commit 444f436)
1 parent 0ab59b2 commit 0382392

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

Assets/Scripts/Gameplay/ConnectionManagement/ConnectionState/HostingConnectionState.cs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -88,9 +88,7 @@ public override void OnUserRequestedShutdown()
8888
{
8989
ConnectionManager.SendServerToAllClientsSetDisconnectReason(ConnectStatus.HostEndedSession);
9090
// Wait before shutting down to make sure clients receive that message before they are disconnected
91-
//StartCoroutine(WaitToShutdown());
92-
m_ConnectionManager.NetworkManager.Shutdown();
93-
SessionManager<SessionPlayerData>.Instance.OnServerEnded();
91+
m_ConnectionManager.StartCoroutine(WaitToShutdown());
9492
}
9593

9694
public override void OnServerShutdown()
@@ -127,8 +125,8 @@ public override void ApprovalCheck(byte[] connectionData, ulong clientId, Networ
127125
//approval callback, so that we can provide more context on a reject. In the meantime we must provide
128126
//the extra information ourselves, and then wait a short time before manually close down the connection.
129127

130-
//ConnectionManager.SendServerToClientSetDisconnectReason(clientId, gameReturnStatus);
131-
//StartCoroutine(WaitToDenyApproval(connectionApprovedCallback));
128+
ConnectionManager.SendServerToClientSetDisconnectReason(clientId, gameReturnStatus);
129+
m_ConnectionManager.StartCoroutine(WaitToDenyApproval(connectionApprovedCallback));
132130
if (m_LobbyServiceFacade.CurrentUnityLobby != null)
133131
{
134132
m_LobbyServiceFacade.RemovePlayerFromLobbyAsync(connectionPayload.playerId, m_LobbyServiceFacade.CurrentUnityLobby.Id);

0 commit comments

Comments
 (0)