mirror of
https://github.com/MirrorNetworking/Mirror.git
synced 2024-11-18 11:00:32 +00:00
NetworkClient.Disconnect: explicitly check against Connecting and Connected.
prepares for Disconnecting state so we don't need to change this here.
This commit is contained in:
parent
49eeb58af6
commit
57c0f70df8
@ -217,8 +217,12 @@ public static void ConnectLocalServer()
|
|||||||
/// <summary>Disconnect from server.</summary>
|
/// <summary>Disconnect from server.</summary>
|
||||||
public static void Disconnect()
|
public static void Disconnect()
|
||||||
{
|
{
|
||||||
// only if connected or connecting
|
// only if connected or connecting.
|
||||||
if (connectState == ConnectState.Disconnected) return;
|
// don't disconnect() again if already in the process of
|
||||||
|
// disconnecting or fully disconnected.
|
||||||
|
if (connectState != ConnectState.Connecting &&
|
||||||
|
connectState != ConnectState.Connected)
|
||||||
|
return;
|
||||||
|
|
||||||
// TODO move to 'cleanup' code below if safe
|
// TODO move to 'cleanup' code below if safe
|
||||||
connectState = ConnectState.Disconnected;
|
connectState = ConnectState.Disconnected;
|
||||||
|
Loading…
Reference in New Issue
Block a user