File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed
Assets/Scripts/Gameplay/ConnectionManagement/ConnectionState Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -45,8 +45,8 @@ public override void Exit()
45
45
{
46
46
m_ConnectionManager . StopCoroutine ( m_ReconnectCoroutine ) ;
47
47
m_ReconnectCoroutine = null ;
48
- m_ReconnectMessagePublisher . Publish ( new ReconnectMessage ( k_NbReconnectAttempts , k_NbReconnectAttempts ) ) ;
49
48
}
49
+ m_ReconnectMessagePublisher . Publish ( new ReconnectMessage ( k_NbReconnectAttempts , k_NbReconnectAttempts ) ) ;
50
50
}
51
51
52
52
public override void OnClientConnected ( ulong clientId )
@@ -64,7 +64,14 @@ public override void OnClientDisconnect(ulong clientId)
64
64
m_ConnectionManager . ChangeState ( ConnectionStateType . Offline ) ;
65
65
break ;
66
66
default :
67
- m_ReconnectCoroutine = m_ConnectionManager . StartCoroutine ( ReconnectCoroutine ( ) ) ;
67
+ if ( m_NbAttempts < k_NbReconnectAttempts )
68
+ {
69
+ m_ReconnectCoroutine = m_ConnectionManager . StartCoroutine ( ReconnectCoroutine ( ) ) ;
70
+ }
71
+ else
72
+ {
73
+ m_ConnectionManager . ChangeState ( ConnectionStateType . Offline ) ;
74
+ }
68
75
break ;
69
76
}
70
77
}
You can’t perform that action at this time.
0 commit comments