Skip to content

Commit 0c7a4d5

Browse files
committed
Moved clearing of SessionManager to right before shutting down
1 parent 3193cce commit 0c7a4d5

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

Assets/BossRoom/Scripts/Shared/Net/ConnectionManagement/GameNetPortal.cs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -247,22 +247,27 @@ public void RequestDisconnect()
247247
}
248248
m_ClientPortal.OnUserDisconnectRequest();
249249
m_ServerPortal.OnUserDisconnectRequest();
250-
SessionManager<SessionPlayerData>.Instance.OnUserDisconnectRequest();
251250

252251
if (NetManager.IsServer)
253252
{
254253
StartCoroutine(WaitToShutdown());
255254
}
256255
else
257256
{
258-
NetManager.Shutdown();
257+
ShutDown();
259258
}
260259
}
261260

261+
void ShutDown()
262+
{
263+
SessionManager<SessionPlayerData>.Instance.OnUserDisconnectRequest();
264+
NetManager.Shutdown();
265+
}
266+
262267
IEnumerator WaitToShutdown()
263268
{
264269
yield return new WaitForSeconds(0.5f);
265-
NetManager.Shutdown();
270+
ShutDown();
266271
}
267272
}
268273
}

0 commit comments

Comments
 (0)