mirror of
https://github.com/MirrorNetworking/Mirror.git
synced 2024-11-18 02:50: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
@ -72,14 +72,13 @@ public void Disconnect()
|
||||
// (might be client or host mode here)
|
||||
isReady = false;
|
||||
ClientScene.HandleClientDisconnect(this);
|
||||
|
||||
// paul: we may be connecting or connected, either way, we need to disconnect
|
||||
// transport should not do anything if it is not connecting/connected
|
||||
NetworkManager.singleton.transport.ClientDisconnect();
|
||||
|
||||
// client? then stop transport
|
||||
if (NetworkManager.singleton.transport.ClientConnected())
|
||||
{
|
||||
NetworkManager.singleton.transport.ClientDisconnect();
|
||||
}
|
||||
// server? then disconnect that client
|
||||
else if (NetworkManager.singleton.transport.ServerActive())
|
||||
if (NetworkManager.singleton.transport.ServerActive())
|
||||
{
|
||||
NetworkManager.singleton.transport.ServerDisconnect(connectionId);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user