diff --git a/.yamato/project.metafile b/.yamato/project.metafile index c0ec992fc0..f8d663b68e 100644 --- a/.yamato/project.metafile +++ b/.yamato/project.metafile @@ -1,5 +1,5 @@ -validation_editor: 2021.3 -mobile_validation_editor: 2021.3 +validation_editor: 2022.3 +mobile_validation_editor: 2022.3 # Platforms that will be tested. The first entry in this array will also # be used for validation @@ -42,10 +42,7 @@ projects: - name: com.unity.netcode.gameobjects path: com.unity.netcode.gameobjects test_editors: - - 2021.3 - - 2022.2 - - 2023.1 - - trunk + - 2022.3 - name: minimalproject path: minimalproject validate: false @@ -55,24 +52,21 @@ projects: - name: com.unity.netcode.gameobjects path: com.unity.netcode.gameobjects test_editors: - - 2021.3 + - 2022.3 - name: testproject-tools-integration path: testproject-tools-integration validate: false publish: false has_tests: true test_editors: - - 2021.3 - - 2022.2 - - trunk + - 2022.3 # Package dependencies dependencies: - name: com.unity.transport version: 2.0.0-pre.2 test_editors: - - 2022.2 - - trunk + - 2022.3 # Scripting backends used by Standalone Playmode Tests scripting_backends: diff --git a/com.unity.netcode.gameobjects/Editor/NetworkManagerEditor.cs b/com.unity.netcode.gameobjects/Editor/NetworkManagerEditor.cs index 1713ba226a..75c5765669 100644 --- a/com.unity.netcode.gameobjects/Editor/NetworkManagerEditor.cs +++ b/com.unity.netcode.gameobjects/Editor/NetworkManagerEditor.cs @@ -222,7 +222,7 @@ private void DrawAllPropertyFields() private void DrawTransportField() { #if RELAY_INTEGRATION_AVAILABLE - var useRelay = EditorPrefs.GetBool(k_UseEasyRelayIntegrationKey, false); + var useRelay = EditorPrefs.GetBool(m_UseEasyRelayIntegrationKey, false); #else var useRelay = false; #endif @@ -257,7 +257,7 @@ private void DrawTransportField() } #if RELAY_INTEGRATION_AVAILABLE - private readonly string k_UseEasyRelayIntegrationKey = "NetworkManagerUI_UseRelay_" + Application.dataPath.GetHashCode(); + private readonly string m_UseEasyRelayIntegrationKey = "NetworkManagerUI_UseRelay_" + Application.dataPath.GetHashCode(); private string m_JoinCode = ""; private string m_StartConnectionError = null; private string m_Region = ""; @@ -272,7 +272,7 @@ private void ShowStartConnectionButtons() #if RELAY_INTEGRATION_AVAILABLE // use editor prefs to persist the setting when entering / leaving play mode / exiting Unity - var useRelay = EditorPrefs.GetBool(k_UseEasyRelayIntegrationKey, false); + var useRelay = EditorPrefs.GetBool(m_UseEasyRelayIntegrationKey, false); GUILayout.BeginHorizontal(); useRelay = GUILayout.Toggle(useRelay, "Try Relay in the Editor"); @@ -284,7 +284,7 @@ private void ShowStartConnectionButtons() } GUILayout.EndHorizontal(); - EditorPrefs.SetBool(k_UseEasyRelayIntegrationKey, useRelay); + EditorPrefs.SetBool(m_UseEasyRelayIntegrationKey, useRelay); if (useRelay && !Application.isPlaying && !CloudProjectSettings.projectBound) { EditorGUILayout.HelpBox("To use relay, you need to setup your project in the Project Settings in the Services section.", MessageType.Warning); diff --git a/com.unity.netcode.gameobjects/Tests/Editor/Messaging/MessageCorruptionTests.cs b/com.unity.netcode.gameobjects/Tests/Editor/Messaging/MessageCorruptionTests.cs index 96544ac4a3..b37454f233 100644 --- a/com.unity.netcode.gameobjects/Tests/Editor/Messaging/MessageCorruptionTests.cs +++ b/com.unity.netcode.gameobjects/Tests/Editor/Messaging/MessageCorruptionTests.cs @@ -90,11 +90,16 @@ public unsafe void Send(ulong clientId, NetworkDelivery delivery, FastBufferWrit break; } case TypeOfCorruption.CorruptBytes: - batchData.Seek(batchData.Length - 2); - var currentByte = batchData.GetUnsafePtr()[0]; - batchData.WriteByteSafe((byte)(currentByte == 0 ? 1 : 0)); - MessageQueue.Add(batchData.ToArray()); - break; + { + batchData.Seek(batchData.Length - 4); + for (int i = 0; i < 4; i++) + { + var currentByte = batchData.GetUnsafePtr()[i]; + batchData.WriteByteSafe((byte)(currentByte == 0 ? 1 : 0)); + MessageQueue.Add(batchData.ToArray()); + } + break; + } case TypeOfCorruption.Truncated: batchData.Truncate(batchData.Length - 1); MessageQueue.Add(batchData.ToArray()); diff --git a/com.unity.netcode.gameobjects/Tests/Runtime/UniversalRpcTests.cs b/com.unity.netcode.gameobjects/Tests/Runtime/UniversalRpcTests.cs index 6be13427e0..e157a3a212 100644 --- a/com.unity.netcode.gameobjects/Tests/Runtime/UniversalRpcTests.cs +++ b/com.unity.netcode.gameobjects/Tests/Runtime/UniversalRpcTests.cs @@ -1285,23 +1285,31 @@ public enum AllocationType List } + // Extending timeout since the added yield return causes this test to commonly timeout + [Timeout(600000)] [UnityTest] public IEnumerator TestSendingWithGroupOverride() { + var waitFor = new WaitForFixedUpdate(); foreach (var defaultSendTo in Enum.GetValues(typeof(SendTo))) { + m_EnableVerboseDebug = true; + VerboseDebug($"Processing: {defaultSendTo}"); + m_EnableVerboseDebug = false; + foreach (var recipient in RecipientGroups) { for (ulong objectOwner = 0u; objectOwner <= 2u; ++objectOwner) { for (ulong sender = 0u; sender <= 2u; ++sender) { + yield return waitFor; foreach (var allocationType in Enum.GetValues(typeof(AllocationType))) { - if (++YieldCheck % YieldCycleCount == 0) - { - yield return null; - } + //if (++YieldCheck % YieldCycleCount == 0) + //{ + // yield return null; + //} OnInlineSetup(); var sendMethodName = $"DefaultTo{defaultSendTo}AllowOverrideRpc"; @@ -1378,23 +1386,32 @@ public enum AllocationType List } + // Extending timeout since the added yield return causes this test to commonly timeout + [Timeout(600000)] [UnityTest] public IEnumerator TestSendingWithGroupNotOverride() { + var waitFor = new WaitForFixedUpdate(); foreach (var defaultSendTo in Enum.GetValues(typeof(SendTo))) { + m_EnableVerboseDebug = true; + VerboseDebug($"Processing: {defaultSendTo}"); + m_EnableVerboseDebug = false; foreach (var recipient in RecipientGroups) { for (ulong objectOwner = 0u; objectOwner <= 2u; ++objectOwner) { for (ulong sender = 0u; sender <= 2u; ++sender) { + yield return waitFor; + foreach (var allocationType in Enum.GetValues(typeof(AllocationType))) { - if (++YieldCheck % YieldCycleCount == 0) - { - yield return null; - } + //if (++YieldCheck % YieldCycleCount == 0) + //{ + // yield return waitFor; + //} + OnInlineSetup(); var sendMethodName = $"DefaultTo{defaultSendTo}AllowOverrideRpc";