Skip to content

Commit 160c917

Browse files
style and test
Adjusting URPC tests. Fixing naming convention violation.
1 parent 0958d04 commit 160c917

File tree

2 files changed

+27
-14
lines changed

2 files changed

+27
-14
lines changed

com.unity.netcode.gameobjects/Editor/NetworkManagerEditor.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ private void DrawAllPropertyFields()
222222
private void DrawTransportField()
223223
{
224224
#if RELAY_INTEGRATION_AVAILABLE
225-
var useRelay = EditorPrefs.GetBool(k_UseEasyRelayIntegrationKey, false);
225+
var useRelay = EditorPrefs.GetBool(m_UseEasyRelayIntegrationKey, false);
226226
#else
227227
var useRelay = false;
228228
#endif
@@ -257,7 +257,7 @@ private void DrawTransportField()
257257
}
258258

259259
#if RELAY_INTEGRATION_AVAILABLE
260-
private readonly string k_UseEasyRelayIntegrationKey = "NetworkManagerUI_UseRelay_" + Application.dataPath.GetHashCode();
260+
private readonly string m_UseEasyRelayIntegrationKey = "NetworkManagerUI_UseRelay_" + Application.dataPath.GetHashCode();
261261
private string m_JoinCode = "";
262262
private string m_StartConnectionError = null;
263263
private string m_Region = "";
@@ -272,7 +272,7 @@ private void ShowStartConnectionButtons()
272272

273273
#if RELAY_INTEGRATION_AVAILABLE
274274
// use editor prefs to persist the setting when entering / leaving play mode / exiting Unity
275-
var useRelay = EditorPrefs.GetBool(k_UseEasyRelayIntegrationKey, false);
275+
var useRelay = EditorPrefs.GetBool(m_UseEasyRelayIntegrationKey, false);
276276
GUILayout.BeginHorizontal();
277277
useRelay = GUILayout.Toggle(useRelay, "Try Relay in the Editor");
278278

@@ -284,7 +284,7 @@ private void ShowStartConnectionButtons()
284284
}
285285
GUILayout.EndHorizontal();
286286

287-
EditorPrefs.SetBool(k_UseEasyRelayIntegrationKey, useRelay);
287+
EditorPrefs.SetBool(m_UseEasyRelayIntegrationKey, useRelay);
288288
if (useRelay && !Application.isPlaying && !CloudProjectSettings.projectBound)
289289
{
290290
EditorGUILayout.HelpBox("To use relay, you need to setup your project in the Project Settings in the Services section.", MessageType.Warning);

com.unity.netcode.gameobjects/Tests/Runtime/UniversalRpcTests.cs

Lines changed: 23 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1286,24 +1286,30 @@ public enum AllocationType
12861286
}
12871287

12881288
// Extending timeout since the added yield return causes this test to commonly timeout
1289-
[Timeout(360000)]
1289+
[Timeout(600000)]
12901290
[UnityTest]
12911291
public IEnumerator TestSendingWithGroupOverride()
12921292
{
1293+
var waitFor = new WaitForFixedUpdate();
12931294
foreach (var defaultSendTo in Enum.GetValues(typeof(SendTo)))
12941295
{
1296+
m_EnableVerboseDebug = true;
1297+
VerboseDebug($"Processing: {defaultSendTo}");
1298+
m_EnableVerboseDebug = false;
1299+
12951300
foreach (var recipient in RecipientGroups)
12961301
{
12971302
for (ulong objectOwner = 0u; objectOwner <= 2u; ++objectOwner)
12981303
{
12991304
for (ulong sender = 0u; sender <= 2u; ++sender)
13001305
{
1306+
yield return waitFor;
13011307
foreach (var allocationType in Enum.GetValues(typeof(AllocationType)))
13021308
{
1303-
if (++YieldCheck % YieldCycleCount == 0)
1304-
{
1305-
yield return null;
1306-
}
1309+
//if (++YieldCheck % YieldCycleCount == 0)
1310+
//{
1311+
// yield return null;
1312+
//}
13071313
OnInlineSetup();
13081314
var sendMethodName = $"DefaultTo{defaultSendTo}AllowOverrideRpc";
13091315

@@ -1381,24 +1387,31 @@ public enum AllocationType
13811387
}
13821388

13831389
// Extending timeout since the added yield return causes this test to commonly timeout
1384-
[Timeout(360000)]
1390+
[Timeout(600000)]
13851391
[UnityTest]
13861392
public IEnumerator TestSendingWithGroupNotOverride()
13871393
{
1394+
var waitFor = new WaitForFixedUpdate();
13881395
foreach (var defaultSendTo in Enum.GetValues(typeof(SendTo)))
13891396
{
1397+
m_EnableVerboseDebug = true;
1398+
VerboseDebug($"Processing: {defaultSendTo}");
1399+
m_EnableVerboseDebug = false;
13901400
foreach (var recipient in RecipientGroups)
13911401
{
13921402
for (ulong objectOwner = 0u; objectOwner <= 2u; ++objectOwner)
13931403
{
13941404
for (ulong sender = 0u; sender <= 2u; ++sender)
13951405
{
1406+
yield return waitFor;
1407+
13961408
foreach (var allocationType in Enum.GetValues(typeof(AllocationType)))
13971409
{
1398-
if (++YieldCheck % YieldCycleCount == 0)
1399-
{
1400-
yield return null;
1401-
}
1410+
//if (++YieldCheck % YieldCycleCount == 0)
1411+
//{
1412+
// yield return waitFor;
1413+
//}
1414+
14021415
OnInlineSetup();
14031416
var sendMethodName = $"DefaultTo{defaultSendTo}AllowOverrideRpc";
14041417

0 commit comments

Comments
 (0)