@@ -592,6 +592,7 @@ public void StopClient()
592592 if ( LogHelper . CurrentLogLevel <= LogLevel . Developer ) LogHelper . LogInfo ( "StopClient()" ) ;
593593 _isClient = false ;
594594 NetworkConfig . NetworkTransport . DisconnectFromServer ( ) ;
595+ _isClientConnected = false ;
595596 Shutdown ( ) ;
596597 }
597598
@@ -661,6 +662,7 @@ private void OnDestroy()
661662 private void Shutdown ( )
662663 {
663664 if ( LogHelper . CurrentLogLevel <= LogLevel . Developer ) LogHelper . LogInfo ( "Shutdown()" ) ;
665+ NetworkProfiler . Stop ( ) ;
664666 isListening = false ;
665667 _isClient = false ;
666668 _isServer = false ;
@@ -751,9 +753,12 @@ private void Update()
751753 if ( LogHelper . CurrentLogLevel <= LogLevel . Developer ) LogHelper . LogInfo ( "Disconnect Event From " + clientId ) ;
752754
753755 if ( isServer )
754- OnClientDisconnect ( clientId ) ;
756+ OnClientDisconnectFromServer ( clientId ) ;
755757 else
758+ {
756759 _isClientConnected = false ;
760+ StopClient ( ) ;
761+ }
757762
758763 if ( OnClientDisconnectCallback != null )
759764 OnClientDisconnectCallback . Invoke ( clientId ) ;
@@ -1061,7 +1066,7 @@ internal void DisconnectClient(uint clientId)
10611066 NetworkConfig . NetworkTransport . DisconnectClient ( clientId ) ;
10621067 }
10631068
1064- internal void OnClientDisconnect ( uint clientId )
1069+ internal void OnClientDisconnectFromServer ( uint clientId )
10651070 {
10661071 if ( pendingClients . Contains ( clientId ) )
10671072 pendingClients . Remove ( clientId ) ;
@@ -1434,7 +1439,7 @@ public void SendToClient(uint clientId, string messageType, string channelName,
14341439 /// <typeparam name="T">The class type to send</typeparam>
14351440 /// <param name="clientId">The clientId to send the message to</param>
14361441 /// <param name="messageType">User defined messageType</param>
1437- /// <param name="channelName">User defined channelName</param>
1442+ /// <param name="channelName">User defined channelName</param>
14381443 /// <param name="instance">The instance to send</param>
14391444 public void SendToClient < T > ( int clientId , string messageType , string channelName , T instance )
14401445 {
@@ -1505,7 +1510,7 @@ public void SendToClients(uint[] clientIds, string messageType, string channelNa
15051510 /// <typeparam name="T">The class type to send</typeparam>
15061511 /// <param name="clientIds">The clientId's to send to</param>
15071512 /// <param name="messageType">User defined messageType</param>
1508- /// <param name="channelName">User defined channelName</param>
1513+ /// <param name="channelName">User defined channelName</param>
15091514 /// <param name="instance">The instance to send</param>
15101515 public void SendToClients < T > ( int [ ] clientIds , string messageType , string channelName , T instance )
15111516 {
@@ -1576,7 +1581,7 @@ public void SendToClients(List<uint> clientIds, string messageType, string chann
15761581 /// <typeparam name="T">The class type to send</typeparam>
15771582 /// <param name="clientIds">The clientId's to send to</param>
15781583 /// <param name="messageType">User defined messageType</param>
1579- /// <param name="channelName">User defined channelName</param>
1584+ /// <param name="channelName">User defined channelName</param>
15801585 /// <param name="instance">The instance to send</param>
15811586 public void SendToClients < T > ( List < int > clientIds , string messageType , string channelName , T instance )
15821587 {
@@ -1644,7 +1649,7 @@ public void SendToClients(string messageType, string channelName, BitWriter writ
16441649 /// </summary>
16451650 /// <typeparam name="T">The class type to send</typeparam>
16461651 /// <param name="messageType">User defined messageType</param>
1647- /// <param name="channelName">User defined channelName</param>
1652+ /// <param name="channelName">User defined channelName</param>
16481653 /// <param name="instance">The instance to send</param>
16491654 public void SendToClients < T > ( string messageType , string channelName , T instance )
16501655 {
0 commit comments