mirror of
https://github.com/MirrorNetworking/Mirror.git
synced 2024-11-18 11:00:32 +00:00
Now we can stop even while connecting.
In some transports (Ignorance), when the player clicks "Connect", the transport goes in Connecting state. If the player clicks Disconnect the transport remains in Connecting state. This gives the transport a chance to cancel the Connecting process. This fix has been tested for quite some time in 2018 branch
This commit is contained in:
parent
6c163d1a45
commit
1b915fbffb
@ -73,13 +73,12 @@ public void Disconnect()
|
|||||||
isReady = false;
|
isReady = false;
|
||||||
ClientScene.HandleClientDisconnect(this);
|
ClientScene.HandleClientDisconnect(this);
|
||||||
|
|
||||||
// client? then stop transport
|
// paul: we may be connecting or connected, either way, we need to disconnect
|
||||||
if (NetworkManager.singleton.transport.ClientConnected())
|
// transport should not do anything if it is not connecting/connected
|
||||||
{
|
|
||||||
NetworkManager.singleton.transport.ClientDisconnect();
|
NetworkManager.singleton.transport.ClientDisconnect();
|
||||||
}
|
|
||||||
// server? then disconnect that client
|
// server? then disconnect that client
|
||||||
else if (NetworkManager.singleton.transport.ServerActive())
|
if (NetworkManager.singleton.transport.ServerActive())
|
||||||
{
|
{
|
||||||
NetworkManager.singleton.transport.ServerDisconnect(connectionId);
|
NetworkManager.singleton.transport.ServerDisconnect(connectionId);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user