File tree Expand file tree Collapse file tree 2 files changed +9
-9
lines changed Expand file tree Collapse file tree 2 files changed +9
-9
lines changed Original file line number Diff line number Diff line change @@ -49,7 +49,7 @@ MonoBehaviour:
49
49
m_MaxSendQueueSize : 50000000
50
50
m_HeartbeatTimeoutMS : 500
51
51
m_ConnectTimeoutMS : 1000
52
- m_MaxConnectAttempts : 15
52
+ m_MaxConnectAttempts : 10
53
53
m_DisconnectTimeoutMS : 10000
54
54
ConnectionData :
55
55
Address : 127.0.0.1
@@ -239,7 +239,7 @@ MonoBehaviour:
239
239
NetworkIdRecycleDelay : 120
240
240
RpcHashSize : 0
241
241
LoadSceneTimeOut : 120
242
- MessageBufferTimeout : 20
242
+ SpawnTimeout : 1
243
243
EnableNetworkLogs : 1
244
244
--- !u!1 &7311172147761373013
245
245
GameObject :
Original file line number Diff line number Diff line change @@ -63,7 +63,7 @@ void OnTimeElapsed()
63
63
case UnityTransport unityTransport :
64
64
var maxConnectAttempts = unityTransport . MaxConnectAttempts ;
65
65
var connectTimeoutMS = unityTransport . ConnectTimeoutMS ;
66
- StartCoroutine ( DisplayUTPReconnectAttempts ( maxConnectAttempts , connectTimeoutMS , OnTimeElapsed ) ) ;
66
+ StartCoroutine ( DisplayUTPConnectionDuration ( maxConnectAttempts , connectTimeoutMS , OnTimeElapsed ) ) ;
67
67
break ;
68
68
default :
69
69
throw new ArgumentOutOfRangeException ( nameof ( chosenTransport ) ) ;
@@ -90,15 +90,15 @@ IEnumerator WaitUntilUNETDisconnected(Action endAction)
90
90
endAction ( ) ;
91
91
}
92
92
93
- IEnumerator DisplayUTPReconnectAttempts ( int maxReconnectAttempts , int connectTimeoutMS , Action endAction )
93
+ IEnumerator DisplayUTPConnectionDuration ( int maxReconnectAttempts , int connectTimeoutMS , Action endAction )
94
94
{
95
- var attempt = 0 ;
95
+ var connectionDuration = maxReconnectAttempts * connectTimeoutMS / 1000f ;
96
96
97
- while ( attempt < maxReconnectAttempts )
97
+ while ( connectionDuration > 0f )
98
98
{
99
- attempt ++ ;
100
- m_TitleText . text = $ "Connecting... { attempt } / { maxReconnectAttempts } ." ;
101
- yield return new WaitForSeconds ( connectTimeoutMS / 1000f ) ;
99
+ m_TitleText . text = $ "Connecting... \n { Mathf . Round ( connectionDuration ) } " ;
100
+ connectionDuration -= Time . deltaTime ;
101
+ yield return null ;
102
102
}
103
103
m_TitleText . text = "Connecting..." ;
104
104
You can’t perform that action at this time.
0 commit comments