diff --git a/com.unity.multiplayer.mlapi/Editor/CodeGen/CodeGenHelpers.cs b/com.unity.multiplayer.mlapi/Editor/CodeGen/CodeGenHelpers.cs index 257aa3f87b..c513c0d556 100644 --- a/com.unity.multiplayer.mlapi/Editor/CodeGen/CodeGenHelpers.cs +++ b/com.unity.multiplayer.mlapi/Editor/CodeGen/CodeGenHelpers.cs @@ -3,9 +3,6 @@ using System.IO; using System.Linq; using System.Text; -using Unity.Multiplayer.Netcode.Hashing; -using Unity.Multiplayer.Netcode.Messaging; -using Unity.Multiplayer.Netcode.Serialization; using Mono.Cecil; using Mono.Cecil.Cil; using Mono.Cecil.Rocks; diff --git a/com.unity.multiplayer.mlapi/Editor/CodeGen/NetworkBehaviourILPP.cs b/com.unity.multiplayer.mlapi/Editor/CodeGen/NetworkBehaviourILPP.cs index 9f93171e24..a06e1aff2d 100644 --- a/com.unity.multiplayer.mlapi/Editor/CodeGen/NetworkBehaviourILPP.cs +++ b/com.unity.multiplayer.mlapi/Editor/CodeGen/NetworkBehaviourILPP.cs @@ -3,9 +3,6 @@ using System.Linq; using System.Collections.Generic; using System.Reflection; -using Unity.Multiplayer.Netcode.Logging; -using Unity.Multiplayer.Netcode.Messaging; -using Unity.Multiplayer.Netcode.Serialization; using Mono.Cecil; using Mono.Cecil.Cil; using Mono.Cecil.Rocks; diff --git a/com.unity.multiplayer.mlapi/Editor/CodeGen/RuntimeAccessModifiersILPP.cs b/com.unity.multiplayer.mlapi/Editor/CodeGen/RuntimeAccessModifiersILPP.cs index 40ab67dece..49d666d538 100644 --- a/com.unity.multiplayer.mlapi/Editor/CodeGen/RuntimeAccessModifiersILPP.cs +++ b/com.unity.multiplayer.mlapi/Editor/CodeGen/RuntimeAccessModifiersILPP.cs @@ -52,7 +52,7 @@ public override ILPostProcessResult Process(ICompiledAssembly compiledAssembly) case nameof(NetworkBehaviour): ProcessNetworkBehaviour(typeDefinition); break; - case nameof(Messaging.__RpcParams): + case nameof(__RpcParams): typeDefinition.IsPublic = true; break; } diff --git a/com.unity.multiplayer.mlapi/Editor/CodeGen/Unity.Multiplayer.MLAPI.Editor.CodeGen.asmdef b/com.unity.multiplayer.mlapi/Editor/CodeGen/Unity.Multiplayer.MLAPI.Editor.CodeGen.asmdef index 494e02f72c..3be80f6786 100644 --- a/com.unity.multiplayer.mlapi/Editor/CodeGen/Unity.Multiplayer.MLAPI.Editor.CodeGen.asmdef +++ b/com.unity.multiplayer.mlapi/Editor/CodeGen/Unity.Multiplayer.MLAPI.Editor.CodeGen.asmdef @@ -1,23 +1,19 @@ { - "name": "Unity.Multiplayer.MLAPI.Editor.CodeGen", - "rootNamespace": "", - "references": [ - "Unity.Multiplayer.MLAPI.Runtime" - ], - "includePlatforms": [ - "Editor" - ], - "excludePlatforms": [], - "allowUnsafeCode": true, - "overrideReferences": true, - "precompiledReferences": [ - "Mono.Cecil.dll", - "Mono.Cecil.Mdb.dll", - "Mono.Cecil.Pdb.dll", - "Mono.Cecil.Rocks.dll" - ], - "autoReferenced": false, - "defineConstraints": [], - "versionDefines": [], - "noEngineReferences": false + "name": "Unity.Multiplayer.MLAPI.Editor.CodeGen", + "rootNamespace": "Unity.Multiplayer.Netcode.Editor.CodeGen", + "references": [ + "Unity.Multiplayer.MLAPI.Runtime" + ], + "includePlatforms": [ + "Editor" + ], + "allowUnsafeCode": true, + "overrideReferences": true, + "precompiledReferences": [ + "Mono.Cecil.dll", + "Mono.Cecil.Mdb.dll", + "Mono.Cecil.Pdb.dll", + "Mono.Cecil.Rocks.dll" + ], + "autoReferenced": false } \ No newline at end of file diff --git a/com.unity.multiplayer.mlapi/Editor/MLAPIProfiler.cs b/com.unity.multiplayer.mlapi/Editor/MLAPIProfiler.cs index 52349b0030..a016b1c75b 100644 --- a/com.unity.multiplayer.mlapi/Editor/MLAPIProfiler.cs +++ b/com.unity.multiplayer.mlapi/Editor/MLAPIProfiler.cs @@ -1,10 +1,9 @@ using System.Collections.Generic; using System.IO; -using Unity.Multiplayer.Netcode.Profiling; -using Unity.Multiplayer.Netcode.Serialization; +using UnityEditor; using UnityEngine; -namespace UnityEditor +namespace Unity.Multiplayer.Netcode.Editor { public class MLAPIProfiler : EditorWindow { diff --git a/com.unity.multiplayer.mlapi/Editor/MLAPIProfilerModule.cs b/com.unity.multiplayer.mlapi/Editor/MLAPIProfilerModule.cs index f316c7c8bb..40f8dbe8f6 100644 --- a/com.unity.multiplayer.mlapi/Editor/MLAPIProfilerModule.cs +++ b/com.unity.multiplayer.mlapi/Editor/MLAPIProfilerModule.cs @@ -1,11 +1,10 @@ using System; using System.Collections.Generic; -using Unity.Multiplayer.Netcode.Profiling; using Unity.Profiling; using UnityEditor; using UnityEngine; -namespace Unity.Multiplayer.Netcode +namespace Unity.Multiplayer.Netcode.Editor { [InitializeOnLoad] internal static class MLAPIProfilerModule diff --git a/com.unity.multiplayer.mlapi/Editor/NetworkBehaviourEditor.cs b/com.unity.multiplayer.mlapi/Editor/NetworkBehaviourEditor.cs index 8a363cf3a0..0d33257bd8 100644 --- a/com.unity.multiplayer.mlapi/Editor/NetworkBehaviourEditor.cs +++ b/com.unity.multiplayer.mlapi/Editor/NetworkBehaviourEditor.cs @@ -1,15 +1,14 @@ using System; using System.Collections.Generic; using System.Reflection; -using Unity.Multiplayer.Netcode; -using Unity.Multiplayer.Netcode.NetworkVariable; using UnityEngine; +using UnityEditor; -namespace UnityEditor +namespace Unity.Multiplayer.Netcode.Editor { [CustomEditor(typeof(NetworkBehaviour), true)] [CanEditMultipleObjects] - public class NetworkBehaviourEditor : Editor + public class NetworkBehaviourEditor : UnityEditor.Editor { private bool m_Initialized; private readonly List m_NetworkVariableNames = new List(); diff --git a/com.unity.multiplayer.mlapi/Editor/NetworkManagerEditor.cs b/com.unity.multiplayer.mlapi/Editor/NetworkManagerEditor.cs index ea03c3e4c4..5b5610ce33 100644 --- a/com.unity.multiplayer.mlapi/Editor/NetworkManagerEditor.cs +++ b/com.unity.multiplayer.mlapi/Editor/NetworkManagerEditor.cs @@ -3,8 +3,6 @@ using UnityEditor; using UnityEngine; using UnityEditorInternal; -using Unity.Multiplayer.Netcode.Configuration; -using Unity.Multiplayer.Netcode.Transports; namespace Unity.Multiplayer.Netcode.Editor { diff --git a/com.unity.multiplayer.mlapi/Editor/com.unity.multiplayer.mlapi.editor.asmdef b/com.unity.multiplayer.mlapi/Editor/com.unity.multiplayer.mlapi.editor.asmdef index 599f10d5f7..2b981d8a66 100644 --- a/com.unity.multiplayer.mlapi/Editor/com.unity.multiplayer.mlapi.editor.asmdef +++ b/com.unity.multiplayer.mlapi/Editor/com.unity.multiplayer.mlapi.editor.asmdef @@ -1,19 +1,11 @@ { "name": "Unity.Multiplayer.MLAPI.Editor", - "rootNamespace": "", + "rootNamespace": "Unity.Multiplayer.Netcode.Editor", "references": [ "Unity.Multiplayer.MLAPI.Runtime", "Unity.Multiplayer.MLAPI.Prototyping" ], "includePlatforms": [ "Editor" - ], - "excludePlatforms": [], - "allowUnsafeCode": false, - "overrideReferences": false, - "precompiledReferences": [], - "autoReferenced": false, - "defineConstraints": [], - "versionDefines": [], - "noEngineReferences": false + ] } \ No newline at end of file diff --git a/com.unity.multiplayer.mlapi/Prototyping/NetworkAnimator.cs b/com.unity.multiplayer.mlapi/Prototyping/NetworkAnimator.cs index d0f9bf947d..724b8ace1b 100644 --- a/com.unity.multiplayer.mlapi/Prototyping/NetworkAnimator.cs +++ b/com.unity.multiplayer.mlapi/Prototyping/NetworkAnimator.cs @@ -1,7 +1,5 @@ using System.Linq; using System.Collections.Generic; -using Unity.Multiplayer.Netcode.Messaging; -using Unity.Multiplayer.Netcode.Serialization; using UnityEngine; namespace Unity.Multiplayer.Netcode.Prototyping diff --git a/com.unity.multiplayer.mlapi/Prototyping/NetworkNavMeshAgent.cs b/com.unity.multiplayer.mlapi/Prototyping/NetworkNavMeshAgent.cs index 310a8682d5..ede88adf9f 100644 --- a/com.unity.multiplayer.mlapi/Prototyping/NetworkNavMeshAgent.cs +++ b/com.unity.multiplayer.mlapi/Prototyping/NetworkNavMeshAgent.cs @@ -1,8 +1,6 @@ using System.Collections.Generic; using UnityEngine; using UnityEngine.AI; -using Unity.Multiplayer.Netcode.Connection; -using Unity.Multiplayer.Netcode.Messaging; namespace Unity.Multiplayer.Netcode.Prototyping { diff --git a/com.unity.multiplayer.mlapi/Prototyping/NetworkTransform.cs b/com.unity.multiplayer.mlapi/Prototyping/NetworkTransform.cs index ea987a968f..e4ac288d73 100644 --- a/com.unity.multiplayer.mlapi/Prototyping/NetworkTransform.cs +++ b/com.unity.multiplayer.mlapi/Prototyping/NetworkTransform.cs @@ -1,7 +1,4 @@ using System; -using Unity.Multiplayer.Netcode.NetworkVariable; -using Unity.Multiplayer.Netcode.Serialization; -using Unity.Multiplayer.Netcode.Transports; using UnityEngine; namespace Unity.Multiplayer.Netcode.Prototyping diff --git a/com.unity.multiplayer.mlapi/Prototyping/com.unity.multiplayer.mlapi.prototyping.asmdef b/com.unity.multiplayer.mlapi/Prototyping/com.unity.multiplayer.mlapi.prototyping.asmdef index 5e7626a4ae..3813d695be 100644 --- a/com.unity.multiplayer.mlapi/Prototyping/com.unity.multiplayer.mlapi.prototyping.asmdef +++ b/com.unity.multiplayer.mlapi/Prototyping/com.unity.multiplayer.mlapi.prototyping.asmdef @@ -1,9 +1,7 @@ { "name": "Unity.Multiplayer.MLAPI.Prototyping", - "rootNamespace": "MLAPI.Prototyping", + "rootNamespace": "Unity.Multiplayer.Netcode.Prototyping", "references": [ "Unity.Multiplayer.MLAPI.Runtime" - ], - "includePlatforms": [], - "excludePlatforms": [] + ] } \ No newline at end of file diff --git a/com.unity.multiplayer.mlapi/Runtime/Collections/FixedQueue.cs b/com.unity.multiplayer.mlapi/Runtime/Collections/FixedQueue.cs index 2b349d5deb..c3b870ccc4 100644 --- a/com.unity.multiplayer.mlapi/Runtime/Collections/FixedQueue.cs +++ b/com.unity.multiplayer.mlapi/Runtime/Collections/FixedQueue.cs @@ -1,6 +1,6 @@ using System; -namespace Unity.Multiplayer.Netcode.Collections +namespace Unity.Multiplayer.Netcode { /// /// Queue with a fixed size diff --git a/com.unity.multiplayer.mlapi/Runtime/Configuration/HashSize.cs b/com.unity.multiplayer.mlapi/Runtime/Configuration/HashSize.cs index 9e1211a745..66460ee914 100644 --- a/com.unity.multiplayer.mlapi/Runtime/Configuration/HashSize.cs +++ b/com.unity.multiplayer.mlapi/Runtime/Configuration/HashSize.cs @@ -1,4 +1,4 @@ -namespace Unity.Multiplayer.Netcode.Configuration +namespace Unity.Multiplayer.Netcode { /// /// Represents the length of a var int encoded hash diff --git a/com.unity.multiplayer.mlapi/Runtime/Configuration/NetworkConfig.cs b/com.unity.multiplayer.mlapi/Runtime/Configuration/NetworkConfig.cs index 0635cc1c49..9d40aa957d 100644 --- a/com.unity.multiplayer.mlapi/Runtime/Configuration/NetworkConfig.cs +++ b/com.unity.multiplayer.mlapi/Runtime/Configuration/NetworkConfig.cs @@ -2,12 +2,8 @@ using System.Collections.Generic; using UnityEngine; using System.Linq; -using Unity.Multiplayer.Netcode.Transports; -using Unity.Multiplayer.Netcode.Hashing; -using Unity.Multiplayer.Netcode.Serialization; -using Unity.Multiplayer.Netcode.Serialization.Pooled; -namespace Unity.Multiplayer.Netcode.Configuration +namespace Unity.Multiplayer.Netcode { /// /// The configuration object used to start server, client and hosts diff --git a/com.unity.multiplayer.mlapi/Runtime/Configuration/NetworkConstants.cs b/com.unity.multiplayer.mlapi/Runtime/Configuration/NetworkConstants.cs index 04ff7b3bde..04bccc7d92 100644 --- a/com.unity.multiplayer.mlapi/Runtime/Configuration/NetworkConstants.cs +++ b/com.unity.multiplayer.mlapi/Runtime/Configuration/NetworkConstants.cs @@ -1,4 +1,4 @@ -namespace Unity.Multiplayer.Netcode.Configuration +namespace Unity.Multiplayer.Netcode { /// /// A static class containing MLAPI constants diff --git a/com.unity.multiplayer.mlapi/Runtime/Configuration/NetworkPrefab.cs b/com.unity.multiplayer.mlapi/Runtime/Configuration/NetworkPrefab.cs index 6c16b6263a..b65a368ffe 100644 --- a/com.unity.multiplayer.mlapi/Runtime/Configuration/NetworkPrefab.cs +++ b/com.unity.multiplayer.mlapi/Runtime/Configuration/NetworkPrefab.cs @@ -1,7 +1,7 @@ using System; using UnityEngine; -namespace Unity.Multiplayer.Netcode.Configuration +namespace Unity.Multiplayer.Netcode { internal enum NetworkPrefabOverride { diff --git a/com.unity.multiplayer.mlapi/Runtime/Connection/NetworkClient.cs b/com.unity.multiplayer.mlapi/Runtime/Connection/NetworkClient.cs index 59201e4340..2350b09d64 100644 --- a/com.unity.multiplayer.mlapi/Runtime/Connection/NetworkClient.cs +++ b/com.unity.multiplayer.mlapi/Runtime/Connection/NetworkClient.cs @@ -1,6 +1,6 @@ using System.Collections.Generic; -namespace Unity.Multiplayer.Netcode.Connection +namespace Unity.Multiplayer.Netcode { /// /// A NetworkClient diff --git a/com.unity.multiplayer.mlapi/Runtime/Connection/PendingClient.cs b/com.unity.multiplayer.mlapi/Runtime/Connection/PendingClient.cs index c8f391d511..42cfbed84d 100644 --- a/com.unity.multiplayer.mlapi/Runtime/Connection/PendingClient.cs +++ b/com.unity.multiplayer.mlapi/Runtime/Connection/PendingClient.cs @@ -1,4 +1,4 @@ -namespace Unity.Multiplayer.Netcode.Connection +namespace Unity.Multiplayer.Netcode { /// /// A class representing a client that is currently in the process of connecting diff --git a/com.unity.multiplayer.mlapi/Runtime/Core/NetworkBehaviour.cs b/com.unity.multiplayer.mlapi/Runtime/Core/NetworkBehaviour.cs index da29771c6d..fa26054c89 100644 --- a/com.unity.multiplayer.mlapi/Runtime/Core/NetworkBehaviour.cs +++ b/com.unity.multiplayer.mlapi/Runtime/Core/NetworkBehaviour.cs @@ -4,14 +4,6 @@ using System.Reflection; using System.Linq; using System.IO; -using Unity.Multiplayer.Netcode.Logging; -using Unity.Multiplayer.Netcode.Messaging; -using Unity.Multiplayer.Netcode.NetworkVariable; -using Unity.Multiplayer.Netcode.Profiling; -using Unity.Multiplayer.Netcode.Reflection; -using Unity.Multiplayer.Netcode.Serialization; -using Unity.Multiplayer.Netcode.Serialization.Pooled; -using Unity.Multiplayer.Netcode.Transports; namespace Unity.Multiplayer.Netcode { @@ -633,7 +625,7 @@ internal static void HandleNetworkVariableDeltas(List networkV { if (NetworkLog.CurrentLogLevel <= LogLevel.Normal) { - NetworkLog.LogWarning($"Client wrote to {nameof(NetworkVariable)} without permission. => {(logInstance != null ? ($"{nameof(NetworkObjectId)}: {logInstance.NetworkObjectId} - {nameof(NetworkObject.GetNetworkBehaviourOrderIndex)}(): {logInstance.NetworkObject.GetNetworkBehaviourOrderIndex(logInstance)} - VariableIndex: {i}") : string.Empty)}"); + NetworkLog.LogWarning($"Client wrote to {typeof(NetworkVariable<>).Name} without permission. => {(logInstance != null ? ($"{nameof(NetworkObjectId)}: {logInstance.NetworkObjectId} - {nameof(NetworkObject.GetNetworkBehaviourOrderIndex)}(): {logInstance.NetworkObject.GetNetworkBehaviourOrderIndex(logInstance)} - VariableIndex: {i}") : string.Empty)}"); NetworkLog.LogError($"[{networkVariableList[i].GetType().Name}]"); } @@ -651,7 +643,7 @@ internal static void HandleNetworkVariableDeltas(List networkV if (NetworkLog.CurrentLogLevel <= LogLevel.Error) { - NetworkLog.LogError($"Client wrote to {nameof(NetworkVariable)} without permission. No more variables can be read. This is critical. => {(logInstance != null ? ($"{nameof(NetworkObjectId)}: {logInstance.NetworkObjectId} - {nameof(NetworkObject.GetNetworkBehaviourOrderIndex)}(): {logInstance.NetworkObject.GetNetworkBehaviourOrderIndex(logInstance)} - VariableIndex: {i}") : string.Empty)}"); + NetworkLog.LogError($"Client wrote to {typeof(NetworkVariable<>).Name} without permission. No more variables can be read. This is critical. => {(logInstance != null ? ($"{nameof(NetworkObjectId)}: {logInstance.NetworkObjectId} - {nameof(NetworkObject.GetNetworkBehaviourOrderIndex)}(): {logInstance.NetworkObject.GetNetworkBehaviourOrderIndex(logInstance)} - VariableIndex: {i}") : string.Empty)}"); NetworkLog.LogError($"[{networkVariableList[i].GetType().Name}]"); } @@ -723,7 +715,7 @@ internal static void HandleNetworkVariableUpdate(List networkV { if (NetworkLog.CurrentLogLevel <= LogLevel.Normal) { - NetworkLog.LogWarning($"Client wrote to {nameof(NetworkVariable)} without permission. => {(logInstance != null ? ($"{nameof(NetworkObjectId)}: {logInstance.NetworkObjectId} - {nameof(NetworkObject.GetNetworkBehaviourOrderIndex)}(): {logInstance.NetworkObject.GetNetworkBehaviourOrderIndex(logInstance)} - VariableIndex: {i}") : string.Empty)}"); + NetworkLog.LogWarning($"Client wrote to {typeof(NetworkVariable<>).Name} without permission. => {(logInstance != null ? ($"{nameof(NetworkObjectId)}: {logInstance.NetworkObjectId} - {nameof(NetworkObject.GetNetworkBehaviourOrderIndex)}(): {logInstance.NetworkObject.GetNetworkBehaviourOrderIndex(logInstance)} - VariableIndex: {i}") : string.Empty)}"); } stream.Position += varSize; @@ -739,7 +731,7 @@ internal static void HandleNetworkVariableUpdate(List networkV // - TwoTen if (NetworkLog.CurrentLogLevel <= LogLevel.Error) { - NetworkLog.LogError($"Client wrote to {nameof(NetworkVariable)} without permission. No more variables can be read. This is critical. => {(logInstance != null ? ($"{nameof(NetworkObjectId)}: {logInstance.NetworkObjectId} - {nameof(NetworkObject.GetNetworkBehaviourOrderIndex)}(): {logInstance.NetworkObject.GetNetworkBehaviourOrderIndex(logInstance)} - VariableIndex: {i}") : string.Empty)}"); + NetworkLog.LogError($"Client wrote to {typeof(NetworkVariable<>).Name} without permission. No more variables can be read. This is critical. => {(logInstance != null ? ($"{nameof(NetworkObjectId)}: {logInstance.NetworkObjectId} - {nameof(NetworkObject.GetNetworkBehaviourOrderIndex)}(): {logInstance.NetworkObject.GetNetworkBehaviourOrderIndex(logInstance)} - VariableIndex: {i}") : string.Empty)}"); } return; diff --git a/com.unity.multiplayer.mlapi/Runtime/Core/NetworkManager.cs b/com.unity.multiplayer.mlapi/Runtime/Core/NetworkManager.cs index 19cab5a00d..10a0027352 100644 --- a/com.unity.multiplayer.mlapi/Runtime/Core/NetworkManager.cs +++ b/com.unity.multiplayer.mlapi/Runtime/Core/NetworkManager.cs @@ -3,19 +3,6 @@ using System.Collections.Generic; using System.Linq; using UnityEngine; -using Unity.Multiplayer.Netcode.Logging; -using Unity.Multiplayer.Netcode.Configuration; -using Unity.Multiplayer.Netcode.Profiling; -using Unity.Multiplayer.Netcode.Serialization; -using Unity.Multiplayer.Netcode.Transports; -using Unity.Multiplayer.Netcode.Connection; -using Unity.Multiplayer.Netcode.Messaging; -using Unity.Multiplayer.Netcode.SceneManagement; -using Unity.Multiplayer.Netcode.Spawning; -using Unity.Multiplayer.Netcode.Exceptions; -using Unity.Multiplayer.Netcode.Serialization.Pooled; -using Unity.Multiplayer.Netcode.Transports.Tasks; -using Unity.Multiplayer.Netcode.Timing; using Unity.Profiling; using Debug = UnityEngine.Debug; diff --git a/com.unity.multiplayer.mlapi/Runtime/Core/NetworkObject.cs b/com.unity.multiplayer.mlapi/Runtime/Core/NetworkObject.cs index aab218cd1c..07b90ce835 100644 --- a/com.unity.multiplayer.mlapi/Runtime/Core/NetworkObject.cs +++ b/com.unity.multiplayer.mlapi/Runtime/Core/NetworkObject.cs @@ -3,12 +3,6 @@ using System.IO; using System.Linq; using System.Runtime.CompilerServices; -using Unity.Multiplayer.Netcode.Exceptions; -using Unity.Multiplayer.Netcode.Hashing; -using Unity.Multiplayer.Netcode.Logging; -using Unity.Multiplayer.Netcode.Messaging; -using Unity.Multiplayer.Netcode.Transports; -using Unity.Multiplayer.Netcode.Serialization; using UnityEngine; namespace Unity.Multiplayer.Netcode diff --git a/com.unity.multiplayer.mlapi/Runtime/Core/SnapshotSystem.cs b/com.unity.multiplayer.mlapi/Runtime/Core/SnapshotSystem.cs index 9d1589bd79..a769cf2709 100644 --- a/com.unity.multiplayer.mlapi/Runtime/Core/SnapshotSystem.cs +++ b/com.unity.multiplayer.mlapi/Runtime/Core/SnapshotSystem.cs @@ -1,12 +1,6 @@ using System; using System.Collections.Generic; using System.IO; -using Unity.Multiplayer.Netcode.Messaging; -using Unity.Multiplayer.Netcode.NetworkVariable; -using Unity.Multiplayer.Netcode.Serialization; -using Unity.Multiplayer.Netcode.Serialization.Pooled; -using Unity.Multiplayer.Netcode.Timing; -using Unity.Multiplayer.Netcode.Transports; using UnityEngine; namespace Unity.Multiplayer.Netcode diff --git a/com.unity.multiplayer.mlapi/Runtime/Exceptions/InvalidParentException.cs b/com.unity.multiplayer.mlapi/Runtime/Exceptions/InvalidParentException.cs index 782f33b183..0249ac5875 100644 --- a/com.unity.multiplayer.mlapi/Runtime/Exceptions/InvalidParentException.cs +++ b/com.unity.multiplayer.mlapi/Runtime/Exceptions/InvalidParentException.cs @@ -1,6 +1,6 @@ using System; -namespace Unity.Multiplayer.Netcode.Exceptions +namespace Unity.Multiplayer.Netcode { /// /// Exception thrown when the new parent candidate of the NetworkObject is not valid diff --git a/com.unity.multiplayer.mlapi/Runtime/Exceptions/NetworkConfigurationException.cs b/com.unity.multiplayer.mlapi/Runtime/Exceptions/NetworkConfigurationException.cs index a0a179c0b6..63eb31033a 100644 --- a/com.unity.multiplayer.mlapi/Runtime/Exceptions/NetworkConfigurationException.cs +++ b/com.unity.multiplayer.mlapi/Runtime/Exceptions/NetworkConfigurationException.cs @@ -1,6 +1,6 @@ using System; -namespace Unity.Multiplayer.Netcode.Exceptions +namespace Unity.Multiplayer.Netcode { /// /// Exception thrown when the operation can only be done on the server diff --git a/com.unity.multiplayer.mlapi/Runtime/Exceptions/NotListeningException.cs b/com.unity.multiplayer.mlapi/Runtime/Exceptions/NotListeningException.cs index 25fd969ce7..cc48fa5511 100644 --- a/com.unity.multiplayer.mlapi/Runtime/Exceptions/NotListeningException.cs +++ b/com.unity.multiplayer.mlapi/Runtime/Exceptions/NotListeningException.cs @@ -1,6 +1,6 @@ using System; -namespace Unity.Multiplayer.Netcode.Exceptions +namespace Unity.Multiplayer.Netcode { /// /// Exception thrown when the operation require NetworkManager to be listening. diff --git a/com.unity.multiplayer.mlapi/Runtime/Exceptions/NotServerException.cs b/com.unity.multiplayer.mlapi/Runtime/Exceptions/NotServerException.cs index 592425d175..164cbc282b 100644 --- a/com.unity.multiplayer.mlapi/Runtime/Exceptions/NotServerException.cs +++ b/com.unity.multiplayer.mlapi/Runtime/Exceptions/NotServerException.cs @@ -1,6 +1,6 @@ using System; -namespace Unity.Multiplayer.Netcode.Exceptions +namespace Unity.Multiplayer.Netcode { /// /// Exception thrown when the operation can only be done on the server diff --git a/com.unity.multiplayer.mlapi/Runtime/Exceptions/SpawnStateException.cs b/com.unity.multiplayer.mlapi/Runtime/Exceptions/SpawnStateException.cs index b35818dec6..c4bc9558de 100644 --- a/com.unity.multiplayer.mlapi/Runtime/Exceptions/SpawnStateException.cs +++ b/com.unity.multiplayer.mlapi/Runtime/Exceptions/SpawnStateException.cs @@ -1,6 +1,6 @@ using System; -namespace Unity.Multiplayer.Netcode.Exceptions +namespace Unity.Multiplayer.Netcode { /// /// Exception thrown when an object is not yet spawned diff --git a/com.unity.multiplayer.mlapi/Runtime/Exceptions/VisibilityChangeException.cs b/com.unity.multiplayer.mlapi/Runtime/Exceptions/VisibilityChangeException.cs index a7421e3aff..f933b25542 100644 --- a/com.unity.multiplayer.mlapi/Runtime/Exceptions/VisibilityChangeException.cs +++ b/com.unity.multiplayer.mlapi/Runtime/Exceptions/VisibilityChangeException.cs @@ -1,6 +1,6 @@ using System; -namespace Unity.Multiplayer.Netcode.Exceptions +namespace Unity.Multiplayer.Netcode { /// /// Exception thrown when a visibility change fails diff --git a/com.unity.multiplayer.mlapi/Runtime/Hashing/XXHash/XXHash.cs b/com.unity.multiplayer.mlapi/Runtime/Hashing/XXHash/XXHash.cs index 5691eee291..6d2e238a43 100644 --- a/com.unity.multiplayer.mlapi/Runtime/Hashing/XXHash/XXHash.cs +++ b/com.unity.multiplayer.mlapi/Runtime/Hashing/XXHash/XXHash.cs @@ -8,7 +8,7 @@ using System.Text; using System.Runtime.CompilerServices; -namespace Unity.Multiplayer.Netcode.Hashing +namespace Unity.Multiplayer.Netcode { /// /// XXHash implementation. diff --git a/com.unity.multiplayer.mlapi/Runtime/Logging/LogLevel.cs b/com.unity.multiplayer.mlapi/Runtime/Logging/LogLevel.cs index 56654426e1..48a6f6e4ba 100644 --- a/com.unity.multiplayer.mlapi/Runtime/Logging/LogLevel.cs +++ b/com.unity.multiplayer.mlapi/Runtime/Logging/LogLevel.cs @@ -1,4 +1,4 @@ -namespace Unity.Multiplayer.Netcode.Logging +namespace Unity.Multiplayer.Netcode { /// /// Log level diff --git a/com.unity.multiplayer.mlapi/Runtime/Logging/NetworkLog.cs b/com.unity.multiplayer.mlapi/Runtime/Logging/NetworkLog.cs index 74f1be3810..c1c343c418 100644 --- a/com.unity.multiplayer.mlapi/Runtime/Logging/NetworkLog.cs +++ b/com.unity.multiplayer.mlapi/Runtime/Logging/NetworkLog.cs @@ -1,8 +1,6 @@ -using Unity.Multiplayer.Netcode.Messaging; -using Unity.Multiplayer.Netcode.Transports; using UnityEngine; -namespace Unity.Multiplayer.Netcode.Logging +namespace Unity.Multiplayer.Netcode { /// /// Helper class for logging diff --git a/com.unity.multiplayer.mlapi/Runtime/Messaging/Buffering.meta b/com.unity.multiplayer.mlapi/Runtime/Messaging/Buffering.meta deleted file mode 100644 index 8c85959f20..0000000000 --- a/com.unity.multiplayer.mlapi/Runtime/Messaging/Buffering.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 5b96fb2c0fcfc0845a71925f9375f3a5 -folderAsset: yes -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/com.unity.multiplayer.mlapi/Runtime/Messaging/CustomMessageManager.cs b/com.unity.multiplayer.mlapi/Runtime/Messaging/CustomMessageManager.cs index f5cb685737..129b10a233 100644 --- a/com.unity.multiplayer.mlapi/Runtime/Messaging/CustomMessageManager.cs +++ b/com.unity.multiplayer.mlapi/Runtime/Messaging/CustomMessageManager.cs @@ -1,13 +1,8 @@ using System; using System.Collections.Generic; using System.IO; -using Unity.Multiplayer.Netcode.Configuration; -using Unity.Multiplayer.Netcode.Serialization; -using Unity.Multiplayer.Netcode.Hashing; -using Unity.Multiplayer.Netcode.Profiling; -using Unity.Multiplayer.Netcode.Transports; -namespace Unity.Multiplayer.Netcode.Messaging +namespace Unity.Multiplayer.Netcode { /// /// The manager class to manage custom messages, note that this is different from the NetworkManager custom messages. diff --git a/com.unity.multiplayer.mlapi/Runtime/Messaging/IInternalMessageHandler.cs b/com.unity.multiplayer.mlapi/Runtime/Messaging/IInternalMessageHandler.cs index f74680ca7d..91abe8c70d 100644 --- a/com.unity.multiplayer.mlapi/Runtime/Messaging/IInternalMessageHandler.cs +++ b/com.unity.multiplayer.mlapi/Runtime/Messaging/IInternalMessageHandler.cs @@ -1,7 +1,6 @@ using System.IO; -using Unity.Multiplayer.Netcode.Transports; -namespace Unity.Multiplayer.Netcode.Messaging +namespace Unity.Multiplayer.Netcode { internal interface IInternalMessageHandler { diff --git a/com.unity.multiplayer.mlapi/Runtime/Messaging/InternalCommandContext.cs b/com.unity.multiplayer.mlapi/Runtime/Messaging/InternalCommandContext.cs index e20515b0b2..88cf6afd9c 100644 --- a/com.unity.multiplayer.mlapi/Runtime/Messaging/InternalCommandContext.cs +++ b/com.unity.multiplayer.mlapi/Runtime/Messaging/InternalCommandContext.cs @@ -1,8 +1,7 @@ using System; -using Unity.Multiplayer.Netcode.Serialization.Pooled; using System.Linq; -namespace Unity.Multiplayer.Netcode.Messaging +namespace Unity.Multiplayer.Netcode { /// /// A context used for building an internal command. diff --git a/com.unity.multiplayer.mlapi/Runtime/Messaging/InternalMessageHandler.cs b/com.unity.multiplayer.mlapi/Runtime/Messaging/InternalMessageHandler.cs index 912003e3d8..b7f11602a4 100644 --- a/com.unity.multiplayer.mlapi/Runtime/Messaging/InternalMessageHandler.cs +++ b/com.unity.multiplayer.mlapi/Runtime/Messaging/InternalMessageHandler.cs @@ -1,19 +1,10 @@ using System; using System.IO; -using Unity.Multiplayer.Netcode.Connection; -using Unity.Multiplayer.Netcode.Logging; -using Unity.Multiplayer.Netcode.SceneManagement; -using Unity.Multiplayer.Netcode.Serialization.Pooled; using UnityEngine; using UnityEngine.Events; using UnityEngine.SceneManagement; -using Unity.Multiplayer.Netcode.Configuration; -using Unity.Multiplayer.Netcode.Profiling; -using Unity.Multiplayer.Netcode.Serialization; -using Unity.Multiplayer.Netcode.Transports; -using Unity.Multiplayer.Netcode.Timing; -namespace Unity.Multiplayer.Netcode.Messaging +namespace Unity.Multiplayer.Netcode { internal class InternalMessageHandler : IInternalMessageHandler { diff --git a/com.unity.multiplayer.mlapi/Runtime/Messaging/MessageBatcher.cs b/com.unity.multiplayer.mlapi/Runtime/Messaging/MessageBatcher.cs index 8f75b3a89c..f779aa2301 100644 --- a/com.unity.multiplayer.mlapi/Runtime/Messaging/MessageBatcher.cs +++ b/com.unity.multiplayer.mlapi/Runtime/Messaging/MessageBatcher.cs @@ -2,12 +2,8 @@ using System.IO; using System.Linq; using System.Collections.Generic; -using Unity.Multiplayer.Netcode.Serialization.Pooled; -using Unity.Multiplayer.Netcode.Serialization; -using Unity.Multiplayer.Netcode.Profiling; -using Unity.Multiplayer.Netcode.Transports; -namespace Unity.Multiplayer.Netcode.Messaging +namespace Unity.Multiplayer.Netcode { internal class MessageBatcher { diff --git a/com.unity.multiplayer.mlapi/Runtime/Messaging/MessageQueue/MessageFrameItem.cs b/com.unity.multiplayer.mlapi/Runtime/Messaging/MessageQueue/MessageFrameItem.cs index 7e225b6be5..e63131bd55 100644 --- a/com.unity.multiplayer.mlapi/Runtime/Messaging/MessageQueue/MessageFrameItem.cs +++ b/com.unity.multiplayer.mlapi/Runtime/Messaging/MessageQueue/MessageFrameItem.cs @@ -1,9 +1,7 @@ using System; using System.IO; -using Unity.Multiplayer.Netcode.Transports; -using Unity.Multiplayer.Netcode.Serialization.Pooled; -namespace Unity.Multiplayer.Netcode.Messaging +namespace Unity.Multiplayer.Netcode { /// /// MessageFrameItem diff --git a/com.unity.multiplayer.mlapi/Runtime/Messaging/MessageQueue/MessageQueueContainer.cs b/com.unity.multiplayer.mlapi/Runtime/Messaging/MessageQueue/MessageQueueContainer.cs index 12c39ebf36..30007582e9 100644 --- a/com.unity.multiplayer.mlapi/Runtime/Messaging/MessageQueue/MessageQueueContainer.cs +++ b/com.unity.multiplayer.mlapi/Runtime/Messaging/MessageQueue/MessageQueueContainer.cs @@ -1,13 +1,9 @@ using System; using System.Collections.Generic; using System.Linq; -using Unity.Multiplayer.Netcode.Logging; -using Unity.Multiplayer.Netcode.Serialization; -using Unity.Multiplayer.Netcode.Serialization.Pooled; -using Unity.Multiplayer.Netcode.Transports; using UnityEngine; -namespace Unity.Multiplayer.Netcode.Messaging +namespace Unity.Multiplayer.Netcode { /// /// MessageQueueContainer diff --git a/com.unity.multiplayer.mlapi/Runtime/Messaging/MessageQueue/MessageQueueHistoryFrame.cs b/com.unity.multiplayer.mlapi/Runtime/Messaging/MessageQueue/MessageQueueHistoryFrame.cs index 12389564f7..1689d8f774 100644 --- a/com.unity.multiplayer.mlapi/Runtime/Messaging/MessageQueue/MessageQueueHistoryFrame.cs +++ b/com.unity.multiplayer.mlapi/Runtime/Messaging/MessageQueue/MessageQueueHistoryFrame.cs @@ -1,9 +1,7 @@ using System.Collections.Generic; -using Unity.Multiplayer.Netcode.Serialization.Pooled; -using Unity.Multiplayer.Netcode.Transports; using UnityEngine; -namespace Unity.Multiplayer.Netcode.Messaging +namespace Unity.Multiplayer.Netcode { /// /// Used by the MessageQueueContainer to hold queued messages diff --git a/com.unity.multiplayer.mlapi/Runtime/Messaging/MessageQueue/MessageQueueProcessor.cs b/com.unity.multiplayer.mlapi/Runtime/Messaging/MessageQueue/MessageQueueProcessor.cs index 13b464e9d6..12d5c9856a 100644 --- a/com.unity.multiplayer.mlapi/Runtime/Messaging/MessageQueue/MessageQueueProcessor.cs +++ b/com.unity.multiplayer.mlapi/Runtime/Messaging/MessageQueue/MessageQueueProcessor.cs @@ -1,11 +1,8 @@ using System; using Unity.Profiling; -using Unity.Multiplayer.Netcode.Profiling; -using Unity.Multiplayer.Netcode.Logging; -using Unity.Multiplayer.Netcode.Transports; using UnityEngine; -namespace Unity.Multiplayer.Netcode.Messaging +namespace Unity.Multiplayer.Netcode { /// /// MessageQueueProcessing diff --git a/com.unity.multiplayer.mlapi/Runtime/Messaging/RpcAttributes.cs b/com.unity.multiplayer.mlapi/Runtime/Messaging/RpcAttributes.cs index ec48de3bea..956c653c05 100644 --- a/com.unity.multiplayer.mlapi/Runtime/Messaging/RpcAttributes.cs +++ b/com.unity.multiplayer.mlapi/Runtime/Messaging/RpcAttributes.cs @@ -1,6 +1,6 @@ using System; -namespace Unity.Multiplayer.Netcode.Messaging +namespace Unity.Multiplayer.Netcode { /// /// RPC delivery types diff --git a/com.unity.multiplayer.mlapi/Runtime/Messaging/RpcParams.cs b/com.unity.multiplayer.mlapi/Runtime/Messaging/RpcParams.cs index 696513b6f3..3c5b5c803d 100644 --- a/com.unity.multiplayer.mlapi/Runtime/Messaging/RpcParams.cs +++ b/com.unity.multiplayer.mlapi/Runtime/Messaging/RpcParams.cs @@ -1,4 +1,4 @@ -namespace Unity.Multiplayer.Netcode.Messaging +namespace Unity.Multiplayer.Netcode { public interface IHasUpdateStage { diff --git a/com.unity.multiplayer.mlapi/Runtime/Messaging/RpcQueue.meta b/com.unity.multiplayer.mlapi/Runtime/Messaging/RpcQueue.meta deleted file mode 100644 index 026c502d6c..0000000000 --- a/com.unity.multiplayer.mlapi/Runtime/Messaging/RpcQueue.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 1bd9e643489acaa4eaaa62e3b10859e3 -folderAsset: yes -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/com.unity.multiplayer.mlapi/Runtime/NetworkVariable/Collections/NetworkDictionary.cs b/com.unity.multiplayer.mlapi/Runtime/NetworkVariable/Collections/NetworkDictionary.cs index 050dbf196a..a496b8aabc 100644 --- a/com.unity.multiplayer.mlapi/Runtime/NetworkVariable/Collections/NetworkDictionary.cs +++ b/com.unity.multiplayer.mlapi/Runtime/NetworkVariable/Collections/NetworkDictionary.cs @@ -2,11 +2,8 @@ using System.Collections; using System.Collections.Generic; using System.IO; -using Unity.Multiplayer.Netcode.Timing; -using Unity.Multiplayer.Netcode.Serialization.Pooled; -using Unity.Multiplayer.Netcode.Transports; -namespace Unity.Multiplayer.Netcode.NetworkVariable.Collections +namespace Unity.Multiplayer.Netcode { /// /// Event based NetworkVariable container for syncing Dictionaries diff --git a/com.unity.multiplayer.mlapi/Runtime/NetworkVariable/Collections/NetworkList.cs b/com.unity.multiplayer.mlapi/Runtime/NetworkVariable/Collections/NetworkList.cs index 63b3e9dcc2..67a49b9d9d 100644 --- a/com.unity.multiplayer.mlapi/Runtime/NetworkVariable/Collections/NetworkList.cs +++ b/com.unity.multiplayer.mlapi/Runtime/NetworkVariable/Collections/NetworkList.cs @@ -2,11 +2,8 @@ using System.Collections; using System.Collections.Generic; using System.IO; -using Unity.Multiplayer.Netcode.Timing; -using Unity.Multiplayer.Netcode.Serialization.Pooled; -using Unity.Multiplayer.Netcode.Transports; -namespace Unity.Multiplayer.Netcode.NetworkVariable.Collections +namespace Unity.Multiplayer.Netcode { /// /// Event based NetworkVariable container for syncing Lists diff --git a/com.unity.multiplayer.mlapi/Runtime/NetworkVariable/Collections/NetworkSet.cs b/com.unity.multiplayer.mlapi/Runtime/NetworkVariable/Collections/NetworkSet.cs index 2fbf3000a2..d2e6240ca3 100644 --- a/com.unity.multiplayer.mlapi/Runtime/NetworkVariable/Collections/NetworkSet.cs +++ b/com.unity.multiplayer.mlapi/Runtime/NetworkVariable/Collections/NetworkSet.cs @@ -3,11 +3,8 @@ using System.Collections; using System.Collections.Generic; using System.IO; -using Unity.Multiplayer.Netcode.Timing; -using Unity.Multiplayer.Netcode.Serialization.Pooled; -using Unity.Multiplayer.Netcode.Transports; -namespace Unity.Multiplayer.Netcode.NetworkVariable.Collections +namespace Unity.Multiplayer.Netcode { /// /// Event based NetworkVariable container for syncing Sets diff --git a/com.unity.multiplayer.mlapi/Runtime/NetworkVariable/INetworkVariable.cs b/com.unity.multiplayer.mlapi/Runtime/NetworkVariable/INetworkVariable.cs index b64149aa0c..db933b65ef 100644 --- a/com.unity.multiplayer.mlapi/Runtime/NetworkVariable/INetworkVariable.cs +++ b/com.unity.multiplayer.mlapi/Runtime/NetworkVariable/INetworkVariable.cs @@ -1,7 +1,6 @@ using System.IO; -using Unity.Multiplayer.Netcode.Transports; -namespace Unity.Multiplayer.Netcode.NetworkVariable +namespace Unity.Multiplayer.Netcode { /// /// Interface for network value containers diff --git a/com.unity.multiplayer.mlapi/Runtime/NetworkVariable/NetworkVariable.cs b/com.unity.multiplayer.mlapi/Runtime/NetworkVariable/NetworkVariable.cs index a1c2b523d7..6924c52c1c 100644 --- a/com.unity.multiplayer.mlapi/Runtime/NetworkVariable/NetworkVariable.cs +++ b/com.unity.multiplayer.mlapi/Runtime/NetworkVariable/NetworkVariable.cs @@ -2,10 +2,8 @@ using UnityEngine; using System.IO; using System; -using Unity.Multiplayer.Netcode.Serialization.Pooled; -using Unity.Multiplayer.Netcode.Transports; -namespace Unity.Multiplayer.Netcode.NetworkVariable +namespace Unity.Multiplayer.Netcode { /// /// A variable that can be synchronized over the network. diff --git a/com.unity.multiplayer.mlapi/Runtime/NetworkVariable/NetworkVariablePermission.cs b/com.unity.multiplayer.mlapi/Runtime/NetworkVariable/NetworkVariablePermission.cs index eb48425ed1..48414ee4e7 100644 --- a/com.unity.multiplayer.mlapi/Runtime/NetworkVariable/NetworkVariablePermission.cs +++ b/com.unity.multiplayer.mlapi/Runtime/NetworkVariable/NetworkVariablePermission.cs @@ -1,4 +1,4 @@ -namespace Unity.Multiplayer.Netcode.NetworkVariable +namespace Unity.Multiplayer.Netcode { /// /// Permission type diff --git a/com.unity.multiplayer.mlapi/Runtime/NetworkVariable/NetworkVariableSettings.cs b/com.unity.multiplayer.mlapi/Runtime/NetworkVariable/NetworkVariableSettings.cs index 61026bec95..6821a859ec 100644 --- a/com.unity.multiplayer.mlapi/Runtime/NetworkVariable/NetworkVariableSettings.cs +++ b/com.unity.multiplayer.mlapi/Runtime/NetworkVariable/NetworkVariableSettings.cs @@ -1,6 +1,4 @@ -using Unity.Multiplayer.Netcode.Transports; - -namespace Unity.Multiplayer.Netcode.NetworkVariable +namespace Unity.Multiplayer.Netcode { /// /// Delegate type for permission checking diff --git a/com.unity.multiplayer.mlapi/Runtime/Profiling/IProfilableTransportProvider.cs b/com.unity.multiplayer.mlapi/Runtime/Profiling/IProfilableTransportProvider.cs index f8d674da3f..ceb99d7270 100644 --- a/com.unity.multiplayer.mlapi/Runtime/Profiling/IProfilableTransportProvider.cs +++ b/com.unity.multiplayer.mlapi/Runtime/Profiling/IProfilableTransportProvider.cs @@ -1,4 +1,4 @@ -namespace Unity.Multiplayer.Netcode.Profiling +namespace Unity.Multiplayer.Netcode { public interface IProfilableTransportProvider { diff --git a/com.unity.multiplayer.mlapi/Runtime/Profiling/ITransportProfilerData.cs b/com.unity.multiplayer.mlapi/Runtime/Profiling/ITransportProfilerData.cs index 25403a64aa..1bc4d72b1f 100644 --- a/com.unity.multiplayer.mlapi/Runtime/Profiling/ITransportProfilerData.cs +++ b/com.unity.multiplayer.mlapi/Runtime/Profiling/ITransportProfilerData.cs @@ -1,6 +1,6 @@ using System.Collections.Generic; -namespace Unity.Multiplayer.Netcode.Profiling +namespace Unity.Multiplayer.Netcode { public interface ITransportProfilerData { diff --git a/com.unity.multiplayer.mlapi/Runtime/Profiling/InternalMessageHandlerProfilingDecorator.cs b/com.unity.multiplayer.mlapi/Runtime/Profiling/InternalMessageHandlerProfilingDecorator.cs index 2da16bfdca..b176b93773 100644 --- a/com.unity.multiplayer.mlapi/Runtime/Profiling/InternalMessageHandlerProfilingDecorator.cs +++ b/com.unity.multiplayer.mlapi/Runtime/Profiling/InternalMessageHandlerProfilingDecorator.cs @@ -1,9 +1,7 @@ using System.IO; -using Unity.Multiplayer.Netcode.Messaging; -using Unity.Multiplayer.Netcode.Transports; using Unity.Profiling; -namespace Unity.Multiplayer.Netcode.Profiling +namespace Unity.Multiplayer.Netcode { internal class InternalMessageHandlerProfilingDecorator : IInternalMessageHandler { diff --git a/com.unity.multiplayer.mlapi/Runtime/Profiling/NetworkProfiler.cs b/com.unity.multiplayer.mlapi/Runtime/Profiling/NetworkProfiler.cs index b31b2871a8..918b91e5a8 100644 --- a/com.unity.multiplayer.mlapi/Runtime/Profiling/NetworkProfiler.cs +++ b/com.unity.multiplayer.mlapi/Runtime/Profiling/NetworkProfiler.cs @@ -1,15 +1,12 @@ using System.Collections.Generic; -using Unity.Multiplayer.Netcode.Collections; -using Unity.Multiplayer.Netcode.Messaging; -using Unity.Multiplayer.Netcode.Transports; using UnityEngine; -namespace Unity.Multiplayer.Netcode.Profiling +namespace Unity.Multiplayer.Netcode { /// /// NetworkProfiler for profiling network traffic /// - public static class NetworkProfiler + internal static class NetworkProfiler { /// /// The ticks that has been recorded diff --git a/com.unity.multiplayer.mlapi/Runtime/Profiling/PerformanceDataManager.cs b/com.unity.multiplayer.mlapi/Runtime/Profiling/PerformanceDataManager.cs index 9439c9bc52..3b1823809a 100644 --- a/com.unity.multiplayer.mlapi/Runtime/Profiling/PerformanceDataManager.cs +++ b/com.unity.multiplayer.mlapi/Runtime/Profiling/PerformanceDataManager.cs @@ -1,7 +1,7 @@ using System; using System.Collections.Generic; -namespace Unity.Multiplayer.Netcode.Profiling +namespace Unity.Multiplayer.Netcode { internal static class PerformanceDataManager { diff --git a/com.unity.multiplayer.mlapi/Runtime/Profiling/PerformanceTickData.cs b/com.unity.multiplayer.mlapi/Runtime/Profiling/PerformanceTickData.cs index 36ddd0f374..c1f83cd3e5 100644 --- a/com.unity.multiplayer.mlapi/Runtime/Profiling/PerformanceTickData.cs +++ b/com.unity.multiplayer.mlapi/Runtime/Profiling/PerformanceTickData.cs @@ -1,8 +1,8 @@ using System.Collections.Generic; -namespace Unity.Multiplayer.Netcode.Profiling +namespace Unity.Multiplayer.Netcode { - public class PerformanceTickData + internal class PerformanceTickData { public int TickId; diff --git a/com.unity.multiplayer.mlapi/Runtime/Profiling/ProfilerConstants.cs b/com.unity.multiplayer.mlapi/Runtime/Profiling/ProfilerConstants.cs index a8f02276a3..aec775f315 100644 --- a/com.unity.multiplayer.mlapi/Runtime/Profiling/ProfilerConstants.cs +++ b/com.unity.multiplayer.mlapi/Runtime/Profiling/ProfilerConstants.cs @@ -1,10 +1,9 @@ -namespace Unity.Multiplayer.Netcode.Profiling +namespace Unity.Multiplayer.Netcode { - public static class ProfilerConstants + internal static class ProfilerConstants { public const string Connections = nameof(Connections); public const string ReceiveTickRate = nameof(ReceiveTickRate); - public const string NamedMessageReceived = nameof(NamedMessageReceived); public const string UnnamedMessageReceived = nameof(UnnamedMessageReceived); public const string NamedMessageSent = nameof(NamedMessageSent); diff --git a/com.unity.multiplayer.mlapi/Runtime/Profiling/ProfilerCounterUtility.cs b/com.unity.multiplayer.mlapi/Runtime/Profiling/ProfilerCounterUtility.cs index 443c959f3d..2c4c18498c 100644 --- a/com.unity.multiplayer.mlapi/Runtime/Profiling/ProfilerCounterUtility.cs +++ b/com.unity.multiplayer.mlapi/Runtime/Profiling/ProfilerCounterUtility.cs @@ -3,7 +3,7 @@ using Unity.Profiling.LowLevel; #endif -namespace Unity.Multiplayer.Netcode.Profiling +namespace Unity.Multiplayer.Netcode { internal struct ProfilerCounterUtility { diff --git a/com.unity.multiplayer.mlapi/Runtime/Profiling/ProfilerCounterValue.cs b/com.unity.multiplayer.mlapi/Runtime/Profiling/ProfilerCounterValue.cs index 4f9190f2f0..197dbc42ca 100644 --- a/com.unity.multiplayer.mlapi/Runtime/Profiling/ProfilerCounterValue.cs +++ b/com.unity.multiplayer.mlapi/Runtime/Profiling/ProfilerCounterValue.cs @@ -8,7 +8,7 @@ using Unity.Collections.LowLevel.Unsafe; #endif -namespace Unity.Multiplayer.Netcode.Profiling +namespace Unity.Multiplayer.Netcode { #if ENABLE_PROFILER [StructLayout(LayoutKind.Sequential)] diff --git a/com.unity.multiplayer.mlapi/Runtime/Profiling/ProfilerCountersInfo.cs b/com.unity.multiplayer.mlapi/Runtime/Profiling/ProfilerCountersInfo.cs index 9a0659bae8..c94bce84ea 100644 --- a/com.unity.multiplayer.mlapi/Runtime/Profiling/ProfilerCountersInfo.cs +++ b/com.unity.multiplayer.mlapi/Runtime/Profiling/ProfilerCountersInfo.cs @@ -3,7 +3,7 @@ using Unity.Profiling; #endif -namespace Unity.Multiplayer.Netcode.Profiling +namespace Unity.Multiplayer.Netcode { internal static class ProfilerCountersInfo { diff --git a/com.unity.multiplayer.mlapi/Runtime/Profiling/ProfilerNotifier.cs b/com.unity.multiplayer.mlapi/Runtime/Profiling/ProfilerNotifier.cs index 518f543f2f..58e2463255 100644 --- a/com.unity.multiplayer.mlapi/Runtime/Profiling/ProfilerNotifier.cs +++ b/com.unity.multiplayer.mlapi/Runtime/Profiling/ProfilerNotifier.cs @@ -1,9 +1,8 @@ using System; -using Unity.Multiplayer.Netcode.Logging; -namespace Unity.Multiplayer.Netcode.Profiling +namespace Unity.Multiplayer.Netcode { - public static class ProfilerNotifier + internal static class ProfilerNotifier { public delegate void PerformanceDataEventHandler(PerformanceTickData profilerData); diff --git a/com.unity.multiplayer.mlapi/Runtime/Profiling/ProfilerStat.cs b/com.unity.multiplayer.mlapi/Runtime/Profiling/ProfilerStat.cs index c32218eebe..032c6f64b3 100644 --- a/com.unity.multiplayer.mlapi/Runtime/Profiling/ProfilerStat.cs +++ b/com.unity.multiplayer.mlapi/Runtime/Profiling/ProfilerStat.cs @@ -1,8 +1,8 @@ using UnityEngine; -namespace Unity.Multiplayer.Netcode.Profiling +namespace Unity.Multiplayer.Netcode { - public class ProfilerStat + internal class ProfilerStat { public ProfilerStat(string name) { @@ -36,7 +36,7 @@ public virtual float SampleRate() } } - public class ProfilerIncStat : ProfilerStat + internal class ProfilerIncStat : ProfilerStat { public ProfilerIncStat(string name) : base(name) { } diff --git a/com.unity.multiplayer.mlapi/Runtime/Profiling/ProfilerStatManager.cs b/com.unity.multiplayer.mlapi/Runtime/Profiling/ProfilerStatManager.cs index 1621a30dd0..6af35992e0 100644 --- a/com.unity.multiplayer.mlapi/Runtime/Profiling/ProfilerStatManager.cs +++ b/com.unity.multiplayer.mlapi/Runtime/Profiling/ProfilerStatManager.cs @@ -1,8 +1,8 @@ using System.Collections.Generic; -namespace Unity.Multiplayer.Netcode.Profiling +namespace Unity.Multiplayer.Netcode { - public static class ProfilerStatManager + internal static class ProfilerStatManager { public static List AllStats = new List(); diff --git a/com.unity.multiplayer.mlapi/Runtime/Profiling/ProfilerTickData.cs b/com.unity.multiplayer.mlapi/Runtime/Profiling/ProfilerTickData.cs index 608ab426af..46b450ce02 100644 --- a/com.unity.multiplayer.mlapi/Runtime/Profiling/ProfilerTickData.cs +++ b/com.unity.multiplayer.mlapi/Runtime/Profiling/ProfilerTickData.cs @@ -1,13 +1,12 @@ using System.Collections.Generic; using System.IO; -using Unity.Multiplayer.Netcode.Serialization.Pooled; -namespace Unity.Multiplayer.Netcode.Profiling +namespace Unity.Multiplayer.Netcode { /// /// The type of Tick /// - public enum TickType + internal enum TickType { /// /// Event tick. During EventTick NetworkVars are flushed etc @@ -28,7 +27,7 @@ public enum TickType /// /// A tick in used for the Profiler /// - public class ProfilerTick + internal class ProfilerTick { /// /// The events that occured during this tick @@ -134,7 +133,7 @@ public uint Bytes /// /// A event that can occur during a Event /// - public class TickEvent + internal class TickEvent { /// /// The type of evenmt diff --git a/com.unity.multiplayer.mlapi/Runtime/Profiling/ProfilingDataStore.cs b/com.unity.multiplayer.mlapi/Runtime/Profiling/ProfilingDataStore.cs index 2faf67dff0..e55fe1b54a 100644 --- a/com.unity.multiplayer.mlapi/Runtime/Profiling/ProfilingDataStore.cs +++ b/com.unity.multiplayer.mlapi/Runtime/Profiling/ProfilingDataStore.cs @@ -1,8 +1,8 @@ using System.Collections.Generic; -namespace Unity.Multiplayer.Netcode.Profiling +namespace Unity.Multiplayer.Netcode { - public class ProfilingDataStore + internal class ProfilingDataStore { private readonly Dictionary m_Dictionary = new Dictionary(); diff --git a/com.unity.multiplayer.mlapi/Runtime/Reflection/TypeExtensions.cs b/com.unity.multiplayer.mlapi/Runtime/Reflection/TypeExtensions.cs index e0af2221fa..4561c62a29 100644 --- a/com.unity.multiplayer.mlapi/Runtime/Reflection/TypeExtensions.cs +++ b/com.unity.multiplayer.mlapi/Runtime/Reflection/TypeExtensions.cs @@ -1,6 +1,6 @@ using System; -namespace Unity.Multiplayer.Netcode.Reflection +namespace Unity.Multiplayer.Netcode { internal static class TypeExtensions { diff --git a/com.unity.multiplayer.mlapi/Runtime/SceneManagement/NetworkSceneManager.cs b/com.unity.multiplayer.mlapi/Runtime/SceneManagement/NetworkSceneManager.cs index afca20e3c4..15c972acce 100644 --- a/com.unity.multiplayer.mlapi/Runtime/SceneManagement/NetworkSceneManager.cs +++ b/com.unity.multiplayer.mlapi/Runtime/SceneManagement/NetworkSceneManager.cs @@ -2,16 +2,10 @@ using System; using System.IO; using System.Linq; -using Unity.Multiplayer.Netcode.Configuration; -using Unity.Multiplayer.Netcode.Exceptions; -using Unity.Multiplayer.Netcode.Logging; -using Unity.Multiplayer.Netcode.Messaging; -using Unity.Multiplayer.Netcode.Serialization.Pooled; using UnityEngine; using UnityEngine.SceneManagement; -using Unity.Multiplayer.Netcode.Transports; -namespace Unity.Multiplayer.Netcode.SceneManagement +namespace Unity.Multiplayer.Netcode { /// /// Main class for managing network scenes @@ -409,7 +403,7 @@ private void OnClientLoadedScene(Guid switchSceneGuid, Stream objectStream) for (int i = 0; i < newObjectsCount; i++) { - NetworkObject.DeserializeSceneObject(objectStream as Serialization.NetworkBuffer, reader, m_NetworkManager); + NetworkObject.DeserializeSceneObject(objectStream as NetworkBuffer, reader, m_NetworkManager); } } diff --git a/com.unity.multiplayer.mlapi/Runtime/SceneManagement/SceneSwitchProgress.cs b/com.unity.multiplayer.mlapi/Runtime/SceneManagement/SceneSwitchProgress.cs index 92bddd4088..add897cf09 100644 --- a/com.unity.multiplayer.mlapi/Runtime/SceneManagement/SceneSwitchProgress.cs +++ b/com.unity.multiplayer.mlapi/Runtime/SceneManagement/SceneSwitchProgress.cs @@ -1,10 +1,9 @@ using System; using System.Collections.Generic; -using Unity.Multiplayer.Netcode.Timing; using UnityEngine; using AsyncOperation = UnityEngine.AsyncOperation; -namespace Unity.Multiplayer.Netcode.SceneManagement +namespace Unity.Multiplayer.Netcode { /// /// Class for tracking scene switching progress by server and clients. diff --git a/com.unity.multiplayer.mlapi/Runtime/Serialization/Arithmetic.cs b/com.unity.multiplayer.mlapi/Runtime/Serialization/Arithmetic.cs index 2d81f890a5..996a135740 100644 --- a/com.unity.multiplayer.mlapi/Runtime/Serialization/Arithmetic.cs +++ b/com.unity.multiplayer.mlapi/Runtime/Serialization/Arithmetic.cs @@ -1,4 +1,4 @@ -namespace Unity.Multiplayer.Netcode.Serialization +namespace Unity.Multiplayer.Netcode { /// /// Arithmetic helper class diff --git a/com.unity.multiplayer.mlapi/Runtime/Serialization/AutoNetworkSerializable.cs b/com.unity.multiplayer.mlapi/Runtime/Serialization/AutoNetworkSerializable.cs index 6cf881c21a..72edd5ff27 100644 --- a/com.unity.multiplayer.mlapi/Runtime/Serialization/AutoNetworkSerializable.cs +++ b/com.unity.multiplayer.mlapi/Runtime/Serialization/AutoNetworkSerializable.cs @@ -1,4 +1,4 @@ -namespace Unity.Multiplayer.Netcode.Serialization +namespace Unity.Multiplayer.Netcode { /// /// AutoBitWritable implements INetworkSerializable and automatically serializes fields using reflection diff --git a/com.unity.multiplayer.mlapi/Runtime/Serialization/INetworkSerializable.cs b/com.unity.multiplayer.mlapi/Runtime/Serialization/INetworkSerializable.cs index 1cf5f981d9..c5251b7fdd 100644 --- a/com.unity.multiplayer.mlapi/Runtime/Serialization/INetworkSerializable.cs +++ b/com.unity.multiplayer.mlapi/Runtime/Serialization/INetworkSerializable.cs @@ -1,4 +1,4 @@ -namespace Unity.Multiplayer.Netcode.Serialization +namespace Unity.Multiplayer.Netcode { public interface INetworkSerializable { diff --git a/com.unity.multiplayer.mlapi/Runtime/Serialization/MemoryStructures/ByteBool.cs b/com.unity.multiplayer.mlapi/Runtime/Serialization/MemoryStructures/ByteBool.cs index 5bf2f1af30..ba6411f2ed 100644 --- a/com.unity.multiplayer.mlapi/Runtime/Serialization/MemoryStructures/ByteBool.cs +++ b/com.unity.multiplayer.mlapi/Runtime/Serialization/MemoryStructures/ByteBool.cs @@ -1,6 +1,6 @@ using System.Runtime.InteropServices; -namespace Unity.Multiplayer.Netcode.Serialization +namespace Unity.Multiplayer.Netcode { [StructLayout(LayoutKind.Explicit)] internal struct ByteBool diff --git a/com.unity.multiplayer.mlapi/Runtime/Serialization/MemoryStructures/UIntFloat.cs b/com.unity.multiplayer.mlapi/Runtime/Serialization/MemoryStructures/UIntFloat.cs index 0bd12b6496..397f210691 100644 --- a/com.unity.multiplayer.mlapi/Runtime/Serialization/MemoryStructures/UIntFloat.cs +++ b/com.unity.multiplayer.mlapi/Runtime/Serialization/MemoryStructures/UIntFloat.cs @@ -1,6 +1,6 @@ using System.Runtime.InteropServices; -namespace Unity.Multiplayer.Netcode.Serialization +namespace Unity.Multiplayer.Netcode { /// /// A struct with a explicit memory layout. The struct has 4 fields. float,uint,double and ulong. diff --git a/com.unity.multiplayer.mlapi/Runtime/Serialization/NetworkBuffer.cs b/com.unity.multiplayer.mlapi/Runtime/Serialization/NetworkBuffer.cs index c37572a5a6..af8c842785 100644 --- a/com.unity.multiplayer.mlapi/Runtime/Serialization/NetworkBuffer.cs +++ b/com.unity.multiplayer.mlapi/Runtime/Serialization/NetworkBuffer.cs @@ -1,8 +1,8 @@ using System; using System.IO; -using static Unity.Multiplayer.Netcode.Serialization.Arithmetic; +using static Unity.Multiplayer.Netcode.Arithmetic; -namespace Unity.Multiplayer.Netcode.Serialization +namespace Unity.Multiplayer.Netcode { /// /// A buffer that can be used at the bit level diff --git a/com.unity.multiplayer.mlapi/Runtime/Serialization/NetworkReader.cs b/com.unity.multiplayer.mlapi/Runtime/Serialization/NetworkReader.cs index 1d6e779456..e038505649 100644 --- a/com.unity.multiplayer.mlapi/Runtime/Serialization/NetworkReader.cs +++ b/com.unity.multiplayer.mlapi/Runtime/Serialization/NetworkReader.cs @@ -6,12 +6,9 @@ using System; using System.IO; using System.Text; -using Unity.Multiplayer.Netcode.Reflection; -using Unity.Multiplayer.Netcode.Logging; -using Unity.Multiplayer.Netcode.Spawning; using UnityEngine; -namespace Unity.Multiplayer.Netcode.Serialization +namespace Unity.Multiplayer.Netcode { /// /// A BinaryReader that can do bit wise manipulation when backed by a NetworkBuffer diff --git a/com.unity.multiplayer.mlapi/Runtime/Serialization/NetworkSerializer.cs b/com.unity.multiplayer.mlapi/Runtime/Serialization/NetworkSerializer.cs index d491622849..272fdfb525 100644 --- a/com.unity.multiplayer.mlapi/Runtime/Serialization/NetworkSerializer.cs +++ b/com.unity.multiplayer.mlapi/Runtime/Serialization/NetworkSerializer.cs @@ -1,7 +1,7 @@ using System; using UnityEngine; -namespace Unity.Multiplayer.Netcode.Serialization +namespace Unity.Multiplayer.Netcode { public sealed class NetworkSerializer { diff --git a/com.unity.multiplayer.mlapi/Runtime/Serialization/NetworkWriter.cs b/com.unity.multiplayer.mlapi/Runtime/Serialization/NetworkWriter.cs index 9f1d464ffe..13a6dd0964 100644 --- a/com.unity.multiplayer.mlapi/Runtime/Serialization/NetworkWriter.cs +++ b/com.unity.multiplayer.mlapi/Runtime/Serialization/NetworkWriter.cs @@ -6,10 +6,9 @@ using System; using System.Diagnostics; using System.IO; -using Unity.Multiplayer.Netcode.Reflection; using UnityEngine; -namespace Unity.Multiplayer.Netcode.Serialization +namespace Unity.Multiplayer.Netcode { // Improved version of NetworkWriter /// diff --git a/com.unity.multiplayer.mlapi/Runtime/Serialization/Pooled/NetworkBufferPool.cs b/com.unity.multiplayer.mlapi/Runtime/Serialization/Pooled/NetworkBufferPool.cs index 365f04ddbf..6a3bf3bdbc 100644 --- a/com.unity.multiplayer.mlapi/Runtime/Serialization/Pooled/NetworkBufferPool.cs +++ b/com.unity.multiplayer.mlapi/Runtime/Serialization/Pooled/NetworkBufferPool.cs @@ -1,8 +1,7 @@ using System; using System.Collections.Generic; -using Unity.Multiplayer.Netcode.Logging; -namespace Unity.Multiplayer.Netcode.Serialization.Pooled +namespace Unity.Multiplayer.Netcode { /// /// Static class containing PooledNetworkBuffers diff --git a/com.unity.multiplayer.mlapi/Runtime/Serialization/Pooled/NetworkReaderPool.cs b/com.unity.multiplayer.mlapi/Runtime/Serialization/Pooled/NetworkReaderPool.cs index a9b595dbe6..b3e92e21f5 100644 --- a/com.unity.multiplayer.mlapi/Runtime/Serialization/Pooled/NetworkReaderPool.cs +++ b/com.unity.multiplayer.mlapi/Runtime/Serialization/Pooled/NetworkReaderPool.cs @@ -1,8 +1,7 @@ using System.Collections.Generic; using System.IO; -using Unity.Multiplayer.Netcode.Logging; -namespace Unity.Multiplayer.Netcode.Serialization.Pooled +namespace Unity.Multiplayer.Netcode { /// /// Static class containing PooledNetworkReaders diff --git a/com.unity.multiplayer.mlapi/Runtime/Serialization/Pooled/NetworkWriterPool.cs b/com.unity.multiplayer.mlapi/Runtime/Serialization/Pooled/NetworkWriterPool.cs index c987baf625..dbaebd5fc2 100644 --- a/com.unity.multiplayer.mlapi/Runtime/Serialization/Pooled/NetworkWriterPool.cs +++ b/com.unity.multiplayer.mlapi/Runtime/Serialization/Pooled/NetworkWriterPool.cs @@ -1,8 +1,7 @@ using System.Collections.Generic; using System.IO; -using Unity.Multiplayer.Netcode.Logging; -namespace Unity.Multiplayer.Netcode.Serialization.Pooled +namespace Unity.Multiplayer.Netcode { /// /// Static class containing PooledNetworkWriters diff --git a/com.unity.multiplayer.mlapi/Runtime/Serialization/Pooled/PooledNetworkBuffer.cs b/com.unity.multiplayer.mlapi/Runtime/Serialization/Pooled/PooledNetworkBuffer.cs index 98080c2acd..a29db88996 100644 --- a/com.unity.multiplayer.mlapi/Runtime/Serialization/Pooled/PooledNetworkBuffer.cs +++ b/com.unity.multiplayer.mlapi/Runtime/Serialization/Pooled/PooledNetworkBuffer.cs @@ -1,4 +1,4 @@ -namespace Unity.Multiplayer.Netcode.Serialization.Pooled +namespace Unity.Multiplayer.Netcode { /// /// Disposable NetworkBuffer that returns back to the NetworkBufferPool when disposed diff --git a/com.unity.multiplayer.mlapi/Runtime/Serialization/Pooled/PooledNetworkReader.cs b/com.unity.multiplayer.mlapi/Runtime/Serialization/Pooled/PooledNetworkReader.cs index 9e60023fbf..6e1ce75fd9 100644 --- a/com.unity.multiplayer.mlapi/Runtime/Serialization/Pooled/PooledNetworkReader.cs +++ b/com.unity.multiplayer.mlapi/Runtime/Serialization/Pooled/PooledNetworkReader.cs @@ -2,7 +2,7 @@ using System.IO; using UnityEngine; -namespace Unity.Multiplayer.Netcode.Serialization.Pooled +namespace Unity.Multiplayer.Netcode { /// /// Disposable NetworkReader that returns the Reader to the NetworkReaderPool when disposed diff --git a/com.unity.multiplayer.mlapi/Runtime/Serialization/Pooled/PooledNetworkWriter.cs b/com.unity.multiplayer.mlapi/Runtime/Serialization/Pooled/PooledNetworkWriter.cs index 4c98dc9c8f..964ee02f61 100644 --- a/com.unity.multiplayer.mlapi/Runtime/Serialization/Pooled/PooledNetworkWriter.cs +++ b/com.unity.multiplayer.mlapi/Runtime/Serialization/Pooled/PooledNetworkWriter.cs @@ -2,7 +2,7 @@ using System.IO; using UnityEngine; -namespace Unity.Multiplayer.Netcode.Serialization.Pooled +namespace Unity.Multiplayer.Netcode { /// /// Disposable NetworkWriter that returns the Writer to the NetworkWriterPool when disposed diff --git a/com.unity.multiplayer.mlapi/Runtime/Serialization/SerializationManager.cs b/com.unity.multiplayer.mlapi/Runtime/Serialization/SerializationManager.cs index 79daf92667..d952e2a9c1 100644 --- a/com.unity.multiplayer.mlapi/Runtime/Serialization/SerializationManager.cs +++ b/com.unity.multiplayer.mlapi/Runtime/Serialization/SerializationManager.cs @@ -3,10 +3,9 @@ using System.IO; using System.Linq; using System.Reflection; -using Unity.Multiplayer.Netcode.Reflection; using UnityEngine; -namespace Unity.Multiplayer.Netcode.Serialization +namespace Unity.Multiplayer.Netcode { /// /// Helper class to manage the MLAPI serialization. diff --git a/com.unity.multiplayer.mlapi/Runtime/Spawning/NetworkPrefabHandler.cs b/com.unity.multiplayer.mlapi/Runtime/Spawning/NetworkPrefabHandler.cs index 0d5f80ca69..747a4cce0a 100644 --- a/com.unity.multiplayer.mlapi/Runtime/Spawning/NetworkPrefabHandler.cs +++ b/com.unity.multiplayer.mlapi/Runtime/Spawning/NetworkPrefabHandler.cs @@ -1,7 +1,7 @@ using System.Collections.Generic; using UnityEngine; -namespace Unity.Multiplayer.Netcode.Spawning +namespace Unity.Multiplayer.Netcode { /// /// Interface for customizing, overriding, spawning, and destroying Network Prefabs diff --git a/com.unity.multiplayer.mlapi/Runtime/Spawning/NetworkSpawnManager.cs b/com.unity.multiplayer.mlapi/Runtime/Spawning/NetworkSpawnManager.cs index 18fb4b92e1..921839182c 100644 --- a/com.unity.multiplayer.mlapi/Runtime/Spawning/NetworkSpawnManager.cs +++ b/com.unity.multiplayer.mlapi/Runtime/Spawning/NetworkSpawnManager.cs @@ -2,17 +2,9 @@ using System.Collections.Generic; using System.IO; using System.Linq; -using Unity.Multiplayer.Netcode.Configuration; -using Unity.Multiplayer.Netcode.Connection; -using Unity.Multiplayer.Netcode.Exceptions; -using Unity.Multiplayer.Netcode.Logging; -using Unity.Multiplayer.Netcode.Messaging; -using Unity.Multiplayer.Netcode.SceneManagement; -using Unity.Multiplayer.Netcode.Serialization.Pooled; -using Unity.Multiplayer.Netcode.Transports; using UnityEngine; -namespace Unity.Multiplayer.Netcode.Spawning +namespace Unity.Multiplayer.Netcode { /// /// Class that handles object spawning diff --git a/com.unity.multiplayer.mlapi/Runtime/Spawning/ReleasedNetworkId.cs b/com.unity.multiplayer.mlapi/Runtime/Spawning/ReleasedNetworkId.cs index 30adaeba0c..0ce728df8d 100644 --- a/com.unity.multiplayer.mlapi/Runtime/Spawning/ReleasedNetworkId.cs +++ b/com.unity.multiplayer.mlapi/Runtime/Spawning/ReleasedNetworkId.cs @@ -1,4 +1,4 @@ -namespace Unity.Multiplayer.Netcode.Spawning +namespace Unity.Multiplayer.Netcode { internal struct ReleasedNetworkId { diff --git a/com.unity.multiplayer.mlapi/Runtime/Timing/NetworkTickSystem.cs b/com.unity.multiplayer.mlapi/Runtime/Timing/NetworkTickSystem.cs index 3b40471ae1..67eabbf482 100644 --- a/com.unity.multiplayer.mlapi/Runtime/Timing/NetworkTickSystem.cs +++ b/com.unity.multiplayer.mlapi/Runtime/Timing/NetworkTickSystem.cs @@ -1,7 +1,7 @@ using System; using Unity.Profiling; -namespace Unity.Multiplayer.Netcode.Timing +namespace Unity.Multiplayer.Netcode { public class NetworkTickSystem { diff --git a/com.unity.multiplayer.mlapi/Runtime/Timing/NetworkTime.cs b/com.unity.multiplayer.mlapi/Runtime/Timing/NetworkTime.cs index 4f76fc371e..0d1a47bbdd 100644 --- a/com.unity.multiplayer.mlapi/Runtime/Timing/NetworkTime.cs +++ b/com.unity.multiplayer.mlapi/Runtime/Timing/NetworkTime.cs @@ -2,7 +2,7 @@ using UnityEngine; using UnityEngine.Assertions; -namespace Unity.Multiplayer.Netcode.Timing +namespace Unity.Multiplayer.Netcode { /// /// A struct to represent a point of time in a networked game. diff --git a/com.unity.multiplayer.mlapi/Runtime/Timing/NetworkTimeSystem.cs b/com.unity.multiplayer.mlapi/Runtime/Timing/NetworkTimeSystem.cs index e9f254c11e..93ab27356f 100644 --- a/com.unity.multiplayer.mlapi/Runtime/Timing/NetworkTimeSystem.cs +++ b/com.unity.multiplayer.mlapi/Runtime/Timing/NetworkTimeSystem.cs @@ -1,6 +1,6 @@ using System; -namespace Unity.Multiplayer.Netcode.Timing +namespace Unity.Multiplayer.Netcode { /// /// is a standalone system which can be used to run a network time simulation. diff --git a/com.unity.multiplayer.mlapi/Runtime/Transports/MultiplexTransportAdapter.cs b/com.unity.multiplayer.mlapi/Runtime/Transports/MultiplexTransportAdapter.cs index b6224b0a0b..9eb3490b46 100644 --- a/com.unity.multiplayer.mlapi/Runtime/Transports/MultiplexTransportAdapter.cs +++ b/com.unity.multiplayer.mlapi/Runtime/Transports/MultiplexTransportAdapter.cs @@ -1,8 +1,7 @@ using System; using System.Collections.Generic; -using Unity.Multiplayer.Netcode.Transports.Tasks; -namespace Unity.Multiplayer.Netcode.Transports.Multiplex +namespace Unity.Multiplayer.Netcode { /// /// Multiplex transport adapter. diff --git a/com.unity.multiplayer.mlapi/Runtime/Transports/NetworkDelivery.cs b/com.unity.multiplayer.mlapi/Runtime/Transports/NetworkDelivery.cs index ca6d8e9d30..fab18383b5 100644 --- a/com.unity.multiplayer.mlapi/Runtime/Transports/NetworkDelivery.cs +++ b/com.unity.multiplayer.mlapi/Runtime/Transports/NetworkDelivery.cs @@ -1,4 +1,4 @@ -namespace Unity.Multiplayer.Netcode.Transports +namespace Unity.Multiplayer.Netcode { /// /// Delivery methods diff --git a/com.unity.multiplayer.mlapi/Runtime/Transports/NetworkEvent.cs b/com.unity.multiplayer.mlapi/Runtime/Transports/NetworkEvent.cs index 0efd40c7e1..ed50686cee 100644 --- a/com.unity.multiplayer.mlapi/Runtime/Transports/NetworkEvent.cs +++ b/com.unity.multiplayer.mlapi/Runtime/Transports/NetworkEvent.cs @@ -1,4 +1,4 @@ -namespace Unity.Multiplayer.Netcode.Transports +namespace Unity.Multiplayer.Netcode { /// /// Represents a netEvent when polling diff --git a/com.unity.multiplayer.mlapi/Runtime/Transports/NetworkTransport.cs b/com.unity.multiplayer.mlapi/Runtime/Transports/NetworkTransport.cs index d71bf77cb7..8826d13a4a 100644 --- a/com.unity.multiplayer.mlapi/Runtime/Transports/NetworkTransport.cs +++ b/com.unity.multiplayer.mlapi/Runtime/Transports/NetworkTransport.cs @@ -1,9 +1,8 @@ using System; using System.Collections.Generic; -using Unity.Multiplayer.Netcode.Transports.Tasks; using UnityEngine; -namespace Unity.Multiplayer.Netcode.Transports +namespace Unity.Multiplayer.Netcode { public enum NetworkChannel : byte { diff --git a/com.unity.multiplayer.mlapi/Runtime/Transports/Tasks/SocketTask.cs b/com.unity.multiplayer.mlapi/Runtime/Transports/Tasks/SocketTask.cs index 491911f76e..bbbada5e30 100644 --- a/com.unity.multiplayer.mlapi/Runtime/Transports/Tasks/SocketTask.cs +++ b/com.unity.multiplayer.mlapi/Runtime/Transports/Tasks/SocketTask.cs @@ -1,7 +1,7 @@ using System; using System.Net.Sockets; -namespace Unity.Multiplayer.Netcode.Transports.Tasks +namespace Unity.Multiplayer.Netcode { /// /// Represents one or more socket tasks. diff --git a/com.unity.multiplayer.mlapi/Runtime/Transports/Tests/Editor/TransportTest.cs b/com.unity.multiplayer.mlapi/Runtime/Transports/Tests/Editor/TransportTest.cs index 48c327c8b6..29f39f1484 100644 --- a/com.unity.multiplayer.mlapi/Runtime/Transports/Tests/Editor/TransportTest.cs +++ b/com.unity.multiplayer.mlapi/Runtime/Transports/Tests/Editor/TransportTest.cs @@ -1,9 +1,7 @@ using System; -using Unity.Multiplayer.Netcode; -using Unity.Multiplayer.Netcode.Configuration; -using Unity.Multiplayer.Netcode.Transports; using NUnit.Framework; using UnityEngine; +using Unity.Multiplayer.Netcode; using Unity.Multiplayer.Netcode.Transports.UNET; using UnityEngine.Networking; diff --git a/com.unity.multiplayer.mlapi/Runtime/Transports/TransportChannel.cs b/com.unity.multiplayer.mlapi/Runtime/Transports/TransportChannel.cs index 732c902354..e16bbeb908 100644 --- a/com.unity.multiplayer.mlapi/Runtime/Transports/TransportChannel.cs +++ b/com.unity.multiplayer.mlapi/Runtime/Transports/TransportChannel.cs @@ -1,6 +1,6 @@ using System; -namespace Unity.Multiplayer.Netcode.Transports +namespace Unity.Multiplayer.Netcode { /// /// A transport channel used by the MLAPI diff --git a/com.unity.multiplayer.mlapi/Runtime/Transports/UNET/UNetChannel.cs b/com.unity.multiplayer.mlapi/Runtime/Transports/UNET/UNetChannel.cs index bf18a38165..0ae32665d8 100644 --- a/com.unity.multiplayer.mlapi/Runtime/Transports/UNET/UNetChannel.cs +++ b/com.unity.multiplayer.mlapi/Runtime/Transports/UNET/UNetChannel.cs @@ -5,7 +5,7 @@ using UnityEngine; using UnityEngine.Networking; -namespace Unity.Multiplayer.Netcode.Transports +namespace Unity.Multiplayer.Netcode.Transports.UNET { /// /// A transport channel used by the MLAPI diff --git a/com.unity.multiplayer.mlapi/Runtime/Transports/UNET/UNetTransport.cs b/com.unity.multiplayer.mlapi/Runtime/Transports/UNET/UNetTransport.cs index cce4fcec08..6653728ca6 100644 --- a/com.unity.multiplayer.mlapi/Runtime/Transports/UNET/UNetTransport.cs +++ b/com.unity.multiplayer.mlapi/Runtime/Transports/UNET/UNetTransport.cs @@ -2,10 +2,6 @@ #pragma warning disable CS1591 // Missing XML comment for publicly visible type or member using System; using System.Collections.Generic; -using Unity.Multiplayer.Netcode.Exceptions; -using Unity.Multiplayer.Netcode.Logging; -using Unity.Multiplayer.Netcode.Profiling; -using Unity.Multiplayer.Netcode.Transports.Tasks; using UnityEngine; using UnityEngine.Networking; diff --git a/com.unity.multiplayer.mlapi/Runtime/com.unity.multiplayer.mlapi.runtime.asmdef b/com.unity.multiplayer.mlapi/Runtime/com.unity.multiplayer.mlapi.runtime.asmdef index 7b604fcc82..796aebcd3f 100644 --- a/com.unity.multiplayer.mlapi/Runtime/com.unity.multiplayer.mlapi.runtime.asmdef +++ b/com.unity.multiplayer.mlapi/Runtime/com.unity.multiplayer.mlapi.runtime.asmdef @@ -1,14 +1,5 @@ { "name": "Unity.Multiplayer.MLAPI.Runtime", - "rootNamespace": "MLAPI", - "references": [], - "includePlatforms": [], - "excludePlatforms": [], - "allowUnsafeCode": true, - "overrideReferences": false, - "precompiledReferences": [], - "autoReferenced": true, - "defineConstraints": [], - "versionDefines": [], - "noEngineReferences": false + "rootNamespace": "Unity.Multiplayer.Netcode", + "allowUnsafeCode": true } \ No newline at end of file diff --git a/com.unity.multiplayer.mlapi/Tests/Editor/ArithmeticTests.cs b/com.unity.multiplayer.mlapi/Tests/Editor/ArithmeticTests.cs index db9d81313a..456cbeef61 100644 --- a/com.unity.multiplayer.mlapi/Tests/Editor/ArithmeticTests.cs +++ b/com.unity.multiplayer.mlapi/Tests/Editor/ArithmeticTests.cs @@ -1,4 +1,3 @@ -using Unity.Multiplayer.Netcode.Serialization; using NUnit.Framework; namespace Unity.Multiplayer.Netcode.EditorTests diff --git a/com.unity.multiplayer.mlapi/Tests/Editor/DummyMessageHandler.cs b/com.unity.multiplayer.mlapi/Tests/Editor/DummyMessageHandler.cs index c9ab391ebd..2a2937d0c3 100644 --- a/com.unity.multiplayer.mlapi/Tests/Editor/DummyMessageHandler.cs +++ b/com.unity.multiplayer.mlapi/Tests/Editor/DummyMessageHandler.cs @@ -1,7 +1,4 @@ using System.IO; -using Unity.Multiplayer.Netcode.Messaging; -using Unity.Multiplayer.Netcode.Serialization; -using Unity.Multiplayer.Netcode.Transports; using UnityEngine; namespace Unity.Multiplayer.Netcode.EditorTests diff --git a/com.unity.multiplayer.mlapi/Tests/Editor/IndexAllocatorTests.cs b/com.unity.multiplayer.mlapi/Tests/Editor/IndexAllocatorTests.cs index 1b2444f06b..35a01f5449 100644 --- a/com.unity.multiplayer.mlapi/Tests/Editor/IndexAllocatorTests.cs +++ b/com.unity.multiplayer.mlapi/Tests/Editor/IndexAllocatorTests.cs @@ -87,7 +87,6 @@ public void ReuseTest() int count = 100; bool[] used = new bool[count]; int[] pos = new int[count]; - int bufferSize = 20000; int iterations = 10000; var allocator = new IndexAllocator(20000, 200); diff --git a/com.unity.multiplayer.mlapi/Tests/Editor/MessageBatcherTests.cs b/com.unity.multiplayer.mlapi/Tests/Editor/MessageBatcherTests.cs index af6bb3f3aa..be05c4e277 100644 --- a/com.unity.multiplayer.mlapi/Tests/Editor/MessageBatcherTests.cs +++ b/com.unity.multiplayer.mlapi/Tests/Editor/MessageBatcherTests.cs @@ -1,9 +1,6 @@ using System; using System.Collections.Generic; using System.Text; -using Unity.Multiplayer.Netcode.Messaging; -using Unity.Multiplayer.Netcode.Serialization; -using Unity.Multiplayer.Netcode.Transports; using NUnit.Framework; namespace Unity.Multiplayer.Netcode.EditorTests diff --git a/com.unity.multiplayer.mlapi/Tests/Editor/MessagePacker.cs b/com.unity.multiplayer.mlapi/Tests/Editor/MessagePacker.cs index 711b78d4e7..cba2cb840e 100644 --- a/com.unity.multiplayer.mlapi/Tests/Editor/MessagePacker.cs +++ b/com.unity.multiplayer.mlapi/Tests/Editor/MessagePacker.cs @@ -1,7 +1,3 @@ -using Unity.Multiplayer.Netcode.Serialization; -using Unity.Multiplayer.Netcode.Messaging; -using Unity.Multiplayer.Netcode.Serialization.Pooled; - namespace Unity.Multiplayer.Netcode.EditorTests { internal static class MessagePacker diff --git a/com.unity.multiplayer.mlapi/Tests/Editor/NetworkBufferTests.cs b/com.unity.multiplayer.mlapi/Tests/Editor/NetworkBufferTests.cs index 0999ce4cae..c3e33f19a7 100644 --- a/com.unity.multiplayer.mlapi/Tests/Editor/NetworkBufferTests.cs +++ b/com.unity.multiplayer.mlapi/Tests/Editor/NetworkBufferTests.cs @@ -1,6 +1,5 @@ using System; using NUnit.Framework; -using Unity.Multiplayer.Netcode.Serialization; using System.Text; namespace Unity.Multiplayer.Netcode.EditorTests diff --git a/com.unity.multiplayer.mlapi/Tests/Editor/NetworkManagerCustomMessageManagerTests.cs b/com.unity.multiplayer.mlapi/Tests/Editor/NetworkManagerCustomMessageManagerTests.cs index 2db8d22592..87ad2863f4 100644 --- a/com.unity.multiplayer.mlapi/Tests/Editor/NetworkManagerCustomMessageManagerTests.cs +++ b/com.unity.multiplayer.mlapi/Tests/Editor/NetworkManagerCustomMessageManagerTests.cs @@ -1,6 +1,4 @@ using System.Collections.Generic; -using Unity.Multiplayer.Netcode.Configuration; -using Unity.Multiplayer.Netcode.Messaging; using NUnit.Framework; using UnityEngine; using UnityEngine.SceneManagement; diff --git a/com.unity.multiplayer.mlapi/Tests/Editor/NetworkManagerMessageHandlerTests.cs b/com.unity.multiplayer.mlapi/Tests/Editor/NetworkManagerMessageHandlerTests.cs index fe89b66b1f..ad461e4912 100644 --- a/com.unity.multiplayer.mlapi/Tests/Editor/NetworkManagerMessageHandlerTests.cs +++ b/com.unity.multiplayer.mlapi/Tests/Editor/NetworkManagerMessageHandlerTests.cs @@ -1,12 +1,7 @@ using System; using System.Collections.Generic; -using Unity.Multiplayer.Netcode.Configuration; -using Unity.Multiplayer.Netcode.Editor; -using Unity.Multiplayer.Netcode.Messaging; -using Unity.Multiplayer.Netcode.Serialization; -using Unity.Multiplayer.Netcode.Transports; -using Unity.Multiplayer.Netcode.Transports.Tasks; using NUnit.Framework; +using Unity.Multiplayer.Netcode.Editor; using UnityEngine; using UnityEngine.SceneManagement; using UnityEngine.TestTools; diff --git a/com.unity.multiplayer.mlapi/Tests/Editor/NetworkManagerSceneManagerTests.cs b/com.unity.multiplayer.mlapi/Tests/Editor/NetworkManagerSceneManagerTests.cs index 382f109af5..4a168dbdc8 100644 --- a/com.unity.multiplayer.mlapi/Tests/Editor/NetworkManagerSceneManagerTests.cs +++ b/com.unity.multiplayer.mlapi/Tests/Editor/NetworkManagerSceneManagerTests.cs @@ -1,6 +1,4 @@ using System.Collections.Generic; -using Unity.Multiplayer.Netcode.Configuration; -using Unity.Multiplayer.Netcode.SceneManagement; using NUnit.Framework; using UnityEngine; using UnityEngine.SceneManagement; diff --git a/com.unity.multiplayer.mlapi/Tests/Editor/NetworkSerializerTests.cs b/com.unity.multiplayer.mlapi/Tests/Editor/NetworkSerializerTests.cs index b790bf6fd6..4af630aee9 100644 --- a/com.unity.multiplayer.mlapi/Tests/Editor/NetworkSerializerTests.cs +++ b/com.unity.multiplayer.mlapi/Tests/Editor/NetworkSerializerTests.cs @@ -1,6 +1,4 @@ using System; -using Unity.Multiplayer.Netcode.Serialization; -using Unity.Multiplayer.Netcode.Serialization.Pooled; using NUnit.Framework; using UnityEngine; diff --git a/com.unity.multiplayer.mlapi/Tests/Editor/ProfilerTests.cs b/com.unity.multiplayer.mlapi/Tests/Editor/ProfilerTests.cs index 055933e15f..f41de22a0b 100644 --- a/com.unity.multiplayer.mlapi/Tests/Editor/ProfilerTests.cs +++ b/com.unity.multiplayer.mlapi/Tests/Editor/ProfilerTests.cs @@ -1,6 +1,5 @@ using System; using System.Collections.Generic; -using Unity.Multiplayer.Netcode.Profiling; using NUnit.Framework; namespace Unity.Multiplayer.Netcode.EditorTests diff --git a/com.unity.multiplayer.mlapi/Tests/Editor/Profiling/InternalMessageHandlerProfilingDecoratorTests.cs b/com.unity.multiplayer.mlapi/Tests/Editor/Profiling/InternalMessageHandlerProfilingDecoratorTests.cs index 9864af0b00..47776c13af 100644 --- a/com.unity.multiplayer.mlapi/Tests/Editor/Profiling/InternalMessageHandlerProfilingDecoratorTests.cs +++ b/com.unity.multiplayer.mlapi/Tests/Editor/Profiling/InternalMessageHandlerProfilingDecoratorTests.cs @@ -1,11 +1,8 @@ -using Unity.Multiplayer.Netcode.Messaging; -using Unity.Multiplayer.Netcode.Profiling; -using Unity.Multiplayer.Netcode.Transports; using NUnit.Framework; using UnityEngine; using UnityEngine.TestTools; -namespace Unity.Multiplayer.Netcode.EditorTests.Profiling +namespace Unity.Multiplayer.Netcode.EditorTests { public class InternalMessageHandlerProfilingDecoratorTests { diff --git a/com.unity.multiplayer.mlapi/Tests/Editor/Timing/ClientNetworkTimeSystemTests.cs b/com.unity.multiplayer.mlapi/Tests/Editor/Timing/ClientNetworkTimeSystemTests.cs index 0cf3700cc0..761c1315b6 100644 --- a/com.unity.multiplayer.mlapi/Tests/Editor/Timing/ClientNetworkTimeSystemTests.cs +++ b/com.unity.multiplayer.mlapi/Tests/Editor/Timing/ClientNetworkTimeSystemTests.cs @@ -1,9 +1,8 @@ using System; -using Unity.Multiplayer.Netcode.Timing; using NUnit.Framework; using UnityEngine; -namespace Unity.Multiplayer.Netcode.EditorTests.Timing +namespace Unity.Multiplayer.Netcode.EditorTests { /// /// Tests for running a as a client. diff --git a/com.unity.multiplayer.mlapi/Tests/Editor/Timing/NetworkTimeTests.cs b/com.unity.multiplayer.mlapi/Tests/Editor/Timing/NetworkTimeTests.cs index 31d410790d..94f4210179 100644 --- a/com.unity.multiplayer.mlapi/Tests/Editor/Timing/NetworkTimeTests.cs +++ b/com.unity.multiplayer.mlapi/Tests/Editor/Timing/NetworkTimeTests.cs @@ -1,12 +1,11 @@ using System; using System.Collections.Generic; using System.Linq; -using Unity.Multiplayer.Netcode.Timing; using NUnit.Framework; using UnityEngine; using Random = System.Random; -namespace Unity.Multiplayer.Netcode.EditorTests.Timing +namespace Unity.Multiplayer.Netcode.EditorTests { public class NetworkTimeTests { diff --git a/com.unity.multiplayer.mlapi/Tests/Editor/Timing/ServerNetworkTimeSystemTests.cs b/com.unity.multiplayer.mlapi/Tests/Editor/Timing/ServerNetworkTimeSystemTests.cs index 6d73efdd7c..cb016ca958 100644 --- a/com.unity.multiplayer.mlapi/Tests/Editor/Timing/ServerNetworkTimeSystemTests.cs +++ b/com.unity.multiplayer.mlapi/Tests/Editor/Timing/ServerNetworkTimeSystemTests.cs @@ -1,8 +1,7 @@ -using Unity.Multiplayer.Netcode.Timing; using NUnit.Framework; using UnityEngine; -namespace Unity.Multiplayer.Netcode.EditorTests.Timing +namespace Unity.Multiplayer.Netcode.EditorTests { public class ServerNetworkTimeSystemTests { diff --git a/com.unity.multiplayer.mlapi/Tests/Editor/Timing/TimingTestHelper.cs b/com.unity.multiplayer.mlapi/Tests/Editor/Timing/TimingTestHelper.cs index 5d70f29df4..33ca2f0b01 100644 --- a/com.unity.multiplayer.mlapi/Tests/Editor/Timing/TimingTestHelper.cs +++ b/com.unity.multiplayer.mlapi/Tests/Editor/Timing/TimingTestHelper.cs @@ -1,9 +1,8 @@ using System.Collections.Generic; -using Unity.Multiplayer.Netcode.Timing; using UnityEngine; using Random = System.Random; -namespace Unity.Multiplayer.Netcode.EditorTests.Timing +namespace Unity.Multiplayer.Netcode.EditorTests { /// /// Helper functions for timing related tests. Allows to get a set of time steps and simulate time advancing without the need of a full playmode test. diff --git a/com.unity.multiplayer.mlapi/Tests/Editor/com.unity.multiplayer.mlapi.editortests.asmdef b/com.unity.multiplayer.mlapi/Tests/Editor/com.unity.multiplayer.mlapi.editortests.asmdef index 7421d73220..978c7eb092 100644 --- a/com.unity.multiplayer.mlapi/Tests/Editor/com.unity.multiplayer.mlapi.editortests.asmdef +++ b/com.unity.multiplayer.mlapi/Tests/Editor/com.unity.multiplayer.mlapi.editortests.asmdef @@ -1,5 +1,6 @@ { "name": "Unity.Multiplayer.MLAPI.EditorTests", + "rootNamespace": "Unity.Multiplayer.Netcode.EditorTests", "references": [ "Unity.Multiplayer.MLAPI.Runtime", "Unity.Multiplayer.MLAPI.Editor" @@ -9,6 +10,5 @@ ], "includePlatforms": [ "Editor" - ], - "excludePlatforms": [] + ] } \ No newline at end of file diff --git a/com.unity.multiplayer.mlapi/Tests/Runtime/Components/BufferDataValidationComponent.cs b/com.unity.multiplayer.mlapi/Tests/Runtime/Components/BufferDataValidationComponent.cs index f7b47bf2d8..a4bd4b8af0 100644 --- a/com.unity.multiplayer.mlapi/Tests/Runtime/Components/BufferDataValidationComponent.cs +++ b/com.unity.multiplayer.mlapi/Tests/Runtime/Components/BufferDataValidationComponent.cs @@ -1,6 +1,5 @@ using System.Collections.Generic; using UnityEngine; -using Unity.Multiplayer.Netcode.Messaging; namespace Unity.Multiplayer.Netcode.RuntimeTests { diff --git a/com.unity.multiplayer.mlapi/Tests/Runtime/Components/NetworkUpdateStagesComponent.cs b/com.unity.multiplayer.mlapi/Tests/Runtime/Components/NetworkUpdateStagesComponent.cs index 30d5e0cfa4..cf78b88ac4 100644 --- a/com.unity.multiplayer.mlapi/Tests/Runtime/Components/NetworkUpdateStagesComponent.cs +++ b/com.unity.multiplayer.mlapi/Tests/Runtime/Components/NetworkUpdateStagesComponent.cs @@ -1,7 +1,6 @@ using System; using System.Collections.Generic; using UnityEngine; -using Unity.Multiplayer.Netcode.Messaging; namespace Unity.Multiplayer.Netcode.RuntimeTests { diff --git a/com.unity.multiplayer.mlapi/Tests/Runtime/Components/NetworkVariableTestComponent.cs b/com.unity.multiplayer.mlapi/Tests/Runtime/Components/NetworkVariableTestComponent.cs index 25267469af..8527cb551f 100644 --- a/com.unity.multiplayer.mlapi/Tests/Runtime/Components/NetworkVariableTestComponent.cs +++ b/com.unity.multiplayer.mlapi/Tests/Runtime/Components/NetworkVariableTestComponent.cs @@ -1,5 +1,4 @@ using UnityEngine; -using Unity.Multiplayer.Netcode.NetworkVariable; namespace Unity.Multiplayer.Netcode.RuntimeTests { diff --git a/com.unity.multiplayer.mlapi/Tests/Runtime/ConnectionApproval.cs b/com.unity.multiplayer.mlapi/Tests/Runtime/ConnectionApproval.cs index 8b787570c2..13b92b5cea 100644 --- a/com.unity.multiplayer.mlapi/Tests/Runtime/ConnectionApproval.cs +++ b/com.unity.multiplayer.mlapi/Tests/Runtime/ConnectionApproval.cs @@ -7,12 +7,9 @@ namespace Unity.Multiplayer.Netcode.RuntimeTests { - public class ConnectionApprovalTests { - private Guid m_ValidationToken; - private bool m_IsValidated; [SetUp] @@ -65,6 +62,5 @@ public void TearDown() // Stop, shutdown, and destroy NetworkManagerHelper.ShutdownNetworkManager(); } - } } diff --git a/com.unity.multiplayer.mlapi/Tests/Runtime/Helpers/NetworkManagerHelper.cs b/com.unity.multiplayer.mlapi/Tests/Runtime/Helpers/NetworkManagerHelper.cs index 19054366e9..c913e86741 100644 --- a/com.unity.multiplayer.mlapi/Tests/Runtime/Helpers/NetworkManagerHelper.cs +++ b/com.unity.multiplayer.mlapi/Tests/Runtime/Helpers/NetworkManagerHelper.cs @@ -1,6 +1,5 @@ using System; using System.Collections.Generic; -using Unity.Multiplayer.Netcode.Configuration; using UnityEngine; using UnityEngine.SceneManagement; using NUnit.Framework; @@ -21,7 +20,7 @@ namespace Unity.Multiplayer.Netcode.RuntimeTests /// public static class NetworkManagerHelper { - public static Transports.Tasks.SocketTasks StartHostSocketTasks { get; internal set; } + public static SocketTasks StartHostSocketTasks { get; internal set; } public static NetworkManager NetworkManagerObject { get; internal set; } public static GameObject NetworkManagerGameObject { get; internal set; } diff --git a/com.unity.multiplayer.mlapi/Tests/Runtime/Helpers/NetworkVariableHelper.cs b/com.unity.multiplayer.mlapi/Tests/Runtime/Helpers/NetworkVariableHelper.cs index 657cf2704e..4285e20bce 100644 --- a/com.unity.multiplayer.mlapi/Tests/Runtime/Helpers/NetworkVariableHelper.cs +++ b/com.unity.multiplayer.mlapi/Tests/Runtime/Helpers/NetworkVariableHelper.cs @@ -1,6 +1,5 @@ using System; using System.Collections.Generic; -using Unity.Multiplayer.Netcode.NetworkVariable; namespace Unity.Multiplayer.Netcode.RuntimeTests { diff --git a/com.unity.multiplayer.mlapi/Tests/Runtime/Messaging/NamedMessageTests.cs b/com.unity.multiplayer.mlapi/Tests/Runtime/Messaging/NamedMessageTests.cs index 5d8bb65778..cd010a771a 100644 --- a/com.unity.multiplayer.mlapi/Tests/Runtime/Messaging/NamedMessageTests.cs +++ b/com.unity.multiplayer.mlapi/Tests/Runtime/Messaging/NamedMessageTests.cs @@ -7,7 +7,7 @@ using UnityEngine; using UnityEngine.TestTools; -namespace Unity.Multiplayer.Netcode.RuntimeTests.Messaging +namespace Unity.Multiplayer.Netcode.RuntimeTests { public class NamedMessageTests : BaseMultiInstanceTest { diff --git a/com.unity.multiplayer.mlapi/Tests/Runtime/Messaging/UnnamedMessageTests.cs b/com.unity.multiplayer.mlapi/Tests/Runtime/Messaging/UnnamedMessageTests.cs index 6e19d05194..91cc9ec87f 100644 --- a/com.unity.multiplayer.mlapi/Tests/Runtime/Messaging/UnnamedMessageTests.cs +++ b/com.unity.multiplayer.mlapi/Tests/Runtime/Messaging/UnnamedMessageTests.cs @@ -3,12 +3,11 @@ using System.Collections.Generic; using System.IO; using System.Text; -using Unity.Multiplayer.Netcode.Serialization; using NUnit.Framework; using UnityEngine; using UnityEngine.TestTools; -namespace Unity.Multiplayer.Netcode.RuntimeTests.Messaging +namespace Unity.Multiplayer.Netcode.RuntimeTests { public class UnnamedMessageTests : BaseMultiInstanceTest { diff --git a/com.unity.multiplayer.mlapi/Tests/Runtime/MultiInstanceHelpers.cs b/com.unity.multiplayer.mlapi/Tests/Runtime/MultiInstanceHelpers.cs index 399cd18218..c6756de2c1 100644 --- a/com.unity.multiplayer.mlapi/Tests/Runtime/MultiInstanceHelpers.cs +++ b/com.unity.multiplayer.mlapi/Tests/Runtime/MultiInstanceHelpers.cs @@ -2,7 +2,6 @@ using System.Collections; using System.Collections.Generic; using System.Linq; -using Unity.Multiplayer.Netcode.Configuration; using NUnit.Framework; using UnityEngine; using UnityEngine.SceneManagement; @@ -35,23 +34,21 @@ public static bool Create(int clientCount, out NetworkManager server, out Networ CreateNewClients(clientCount, out clients); - { - // Create gameObject - var go = new GameObject("NetworkManager - Server"); + // Create gameObject + var go = new GameObject("NetworkManager - Server"); - // Create networkManager component - server = go.AddComponent(); - NetworkManagerInstances.Insert(0, server); + // Create networkManager component + server = go.AddComponent(); + NetworkManagerInstances.Insert(0, server); - // Set the NetworkConfig - server.NetworkConfig = new NetworkConfig() - { - // Set the current scene to prevent unexpected log messages which would trigger a failure - RegisteredScenes = new List() { SceneManager.GetActiveScene().name }, - // Set transport - NetworkTransport = go.AddComponent() - }; - } + // Set the NetworkConfig + server.NetworkConfig = new NetworkConfig() + { + // Set the current scene to prevent unexpected log messages which would trigger a failure + RegisteredScenes = new List() { SceneManager.GetActiveScene().name }, + // Set transport + NetworkTransport = go.AddComponent() + }; s_OriginalTargetFrameRate = Application.targetFrameRate; Application.targetFrameRate = targetFrameRate; diff --git a/com.unity.multiplayer.mlapi/Tests/Runtime/NetworkBehaviourUpdaterTests.cs b/com.unity.multiplayer.mlapi/Tests/Runtime/NetworkBehaviourUpdaterTests.cs index b9fd33daa2..8453a792a2 100644 --- a/com.unity.multiplayer.mlapi/Tests/Runtime/NetworkBehaviourUpdaterTests.cs +++ b/com.unity.multiplayer.mlapi/Tests/Runtime/NetworkBehaviourUpdaterTests.cs @@ -1,7 +1,6 @@ using System; using System.Collections; using System.Collections.Generic; -using Unity.Multiplayer.Netcode.NetworkVariable; using NUnit.Framework; using UnityEngine; using UnityEngine.TestTools; @@ -67,10 +66,10 @@ void AddNetworkBehaviour(Type type, GameObject prefab) AddNetworkBehaviour(firstNetworkBehaviour, prefabToSpawn); AddNetworkBehaviour(secondNetworkBehaviour, prefabToSpawn); MultiInstanceHelpers.MakeNetworkedObjectTestPrefab(networkObjectPrefab); - m_ServerNetworkManager.NetworkConfig.NetworkPrefabs.Add(new Configuration.NetworkPrefab() { Prefab = prefabToSpawn }); + m_ServerNetworkManager.NetworkConfig.NetworkPrefabs.Add(new NetworkPrefab() { Prefab = prefabToSpawn }); foreach (var clientNetworkManager in m_ClientNetworkManagers) { - clientNetworkManager.NetworkConfig.NetworkPrefabs.Add(new Configuration.NetworkPrefab() { Prefab = prefabToSpawn }); + clientNetworkManager.NetworkConfig.NetworkPrefabs.Add(new NetworkPrefab() { Prefab = prefabToSpawn }); } // Start the instances diff --git a/com.unity.multiplayer.mlapi/Tests/Runtime/NetworkObject/NetworkObjectSceneSerializationTests.cs b/com.unity.multiplayer.mlapi/Tests/Runtime/NetworkObject/NetworkObjectSceneSerializationTests.cs index 260735ebc7..b509516acb 100644 --- a/com.unity.multiplayer.mlapi/Tests/Runtime/NetworkObject/NetworkObjectSceneSerializationTests.cs +++ b/com.unity.multiplayer.mlapi/Tests/Runtime/NetworkObject/NetworkObjectSceneSerializationTests.cs @@ -1,10 +1,7 @@ using System.Collections.Generic; using UnityEngine; -using Unity.Multiplayer.Netcode.NetworkVariable.Collections; -using Unity.Multiplayer.Netcode.Serialization.Pooled; using NUnit.Framework; - namespace Unity.Multiplayer.Netcode.RuntimeTests { public class NetworkObjectSceneSerializationTests @@ -104,7 +101,7 @@ public void NetworkObjectSceneSerializationFailure() invalidNetworkObjectOffsets.RemoveAt(0); // Turn off Network Logging to avoid other errors that we know will happen after the below LogAssert.Expect message occurs. - NetworkManager.Singleton.LogLevel = Logging.LogLevel.Nothing; + NetworkManager.Singleton.LogLevel = LogLevel.Nothing; // Trap for this specific error message so we don't make Test Runner think we failed (it will fail on Debug.LogError) UnityEngine.TestTools.LogAssert.Expect(LogType.Error, $"Failed to spawn {nameof(NetworkObject)} for Hash {invalidNetworkObjectIdCount[invalidNetworkObjectCount]}."); @@ -162,7 +159,6 @@ public void TearDown() } } - /// /// A simple test class that will provide varying NetworkBuffer stream sizes /// when the NetworkVariable is serialized diff --git a/com.unity.multiplayer.mlapi/Tests/Runtime/NetworkPrefabHandlerTests.cs b/com.unity.multiplayer.mlapi/Tests/Runtime/NetworkPrefabHandlerTests.cs index c360fb518a..124279c37d 100644 --- a/com.unity.multiplayer.mlapi/Tests/Runtime/NetworkPrefabHandlerTests.cs +++ b/com.unity.multiplayer.mlapi/Tests/Runtime/NetworkPrefabHandlerTests.cs @@ -1,10 +1,8 @@ using System; using System.Collections.Generic; using UnityEngine; -using Unity.Multiplayer.Netcode.Spawning; using NUnit.Framework; - namespace Unity.Multiplayer.Netcode.RuntimeTests { /// @@ -30,9 +28,9 @@ public void NetworkConfigInvalidNetworkPrefabTest() NetworkManagerHelper.NetworkManagerObject.NetworkConfig.NetworkPrefabs.Add(null); // Add a NetworkPrefab with no prefab - NetworkManagerHelper.NetworkManagerObject.NetworkConfig.NetworkPrefabs.Add(new Configuration.NetworkPrefab()); + NetworkManagerHelper.NetworkManagerObject.NetworkConfig.NetworkPrefabs.Add(new NetworkPrefab()); - var validNetworkPrefab = new Configuration.NetworkPrefab(); + var validNetworkPrefab = new NetworkPrefab(); validNetworkPrefab.Prefab = baseObject.gameObject; //Add a valid prefab diff --git a/com.unity.multiplayer.mlapi/Tests/Runtime/NetworkSceneManagerTests.cs b/com.unity.multiplayer.mlapi/Tests/Runtime/NetworkSceneManagerTests.cs index 485ac21bda..eb10bf08fc 100644 --- a/com.unity.multiplayer.mlapi/Tests/Runtime/NetworkSceneManagerTests.cs +++ b/com.unity.multiplayer.mlapi/Tests/Runtime/NetworkSceneManagerTests.cs @@ -1,5 +1,4 @@ using System; -using Unity.Multiplayer.Netcode.Configuration; using NUnit.Framework; namespace Unity.Multiplayer.Netcode.RuntimeTests diff --git a/com.unity.multiplayer.mlapi/Tests/Runtime/NetworkSpawnManagerTests.cs b/com.unity.multiplayer.mlapi/Tests/Runtime/NetworkSpawnManagerTests.cs index 7d91317747..bf7f6a7620 100644 --- a/com.unity.multiplayer.mlapi/Tests/Runtime/NetworkSpawnManagerTests.cs +++ b/com.unity.multiplayer.mlapi/Tests/Runtime/NetworkSpawnManagerTests.cs @@ -1,5 +1,4 @@ using System.Collections; -using Unity.Multiplayer.Netcode.Exceptions; using NUnit.Framework; using UnityEngine; using UnityEngine.TestTools; diff --git a/com.unity.multiplayer.mlapi/Tests/Runtime/Profiling/NetworkVariableNameTests.cs b/com.unity.multiplayer.mlapi/Tests/Runtime/Profiling/NetworkVariableNameTests.cs index 3f6c9152c7..f8b253262d 100644 --- a/com.unity.multiplayer.mlapi/Tests/Runtime/Profiling/NetworkVariableNameTests.cs +++ b/com.unity.multiplayer.mlapi/Tests/Runtime/Profiling/NetworkVariableNameTests.cs @@ -1,9 +1,7 @@ using System; -using Unity.Multiplayer.Netcode.NetworkVariable; -using Unity.Multiplayer.Netcode.NetworkVariable.Collections; using NUnit.Framework; -namespace Unity.Multiplayer.Netcode.RuntimeTests.Profiling +namespace Unity.Multiplayer.Netcode.RuntimeTests { public sealed class NetworkVariableNameTests { diff --git a/com.unity.multiplayer.mlapi/Tests/Runtime/RpcPipelineTestComponent.cs b/com.unity.multiplayer.mlapi/Tests/Runtime/RpcPipelineTestComponent.cs index 717c210600..e6c5ba567f 100644 --- a/com.unity.multiplayer.mlapi/Tests/Runtime/RpcPipelineTestComponent.cs +++ b/com.unity.multiplayer.mlapi/Tests/Runtime/RpcPipelineTestComponent.cs @@ -1,7 +1,6 @@ using System; using System.Collections.Generic; using UnityEngine; -using Unity.Multiplayer.Netcode.Messaging; namespace Unity.Multiplayer.Netcode.RuntimeTests { @@ -24,7 +23,6 @@ public class RpcPipelineTestComponent : NetworkBehaviour /// public int MaxIterations = 2; - // Start is called before the first frame update private void Start() { @@ -34,7 +32,7 @@ private void Start() m_ServerParams.Receive.UpdateStage = NetworkUpdateStage.EarlyUpdate; m_ClientParams.Receive.UpdateStage = NetworkUpdateStage.EarlyUpdate; - m_MaxStagesSent = (Enum.GetValues(typeof(NetworkUpdateStage)).Length) * MaxIterations; + m_MaxStagesSent = Enum.GetValues(typeof(NetworkUpdateStage)).Length * MaxIterations; //Start out with this being true (for first sequence) m_ClientReceivedRpc = true; diff --git a/com.unity.multiplayer.mlapi/Tests/Runtime/RpcQueueTests.cs b/com.unity.multiplayer.mlapi/Tests/Runtime/RpcQueueTests.cs index e9879c993b..634b77d54c 100644 --- a/com.unity.multiplayer.mlapi/Tests/Runtime/RpcQueueTests.cs +++ b/com.unity.multiplayer.mlapi/Tests/Runtime/RpcQueueTests.cs @@ -4,7 +4,6 @@ using UnityEngine; using UnityEngine.TestTools; using NUnit.Framework; -using Unity.Multiplayer.Netcode.Messaging; namespace Unity.Multiplayer.Netcode.RuntimeTests { @@ -138,7 +137,7 @@ public void RpcQueueContainerClass() // Increment our offset into our randomly generated data for next entry; indexOffset = (i * messageChunkSize) % maximumOffsetValue; - var writer = rpcQueueContainer.BeginAddQueueItemToFrame(MessageQueueContainer.MessageType.ServerRpc, Time.realtimeSinceStartup, Transports.NetworkChannel.DefaultMessage, + var writer = rpcQueueContainer.BeginAddQueueItemToFrame(MessageQueueContainer.MessageType.ServerRpc, Time.realtimeSinceStartup, NetworkChannel.DefaultMessage, senderNetworkId, psuedoClients, MessageQueueHistoryFrame.QueueFrameType.Outbound, NetworkUpdateStage.PostLateUpdate); @@ -162,7 +161,7 @@ public void RpcQueueContainerClass() Assert.AreEqual(currentQueueItem.NetworkId, senderNetworkId); Assert.AreEqual(currentQueueItem.MessageType, MessageQueueContainer.MessageType.ServerRpc); Assert.AreEqual(currentQueueItem.UpdateStage, NetworkUpdateStage.PostLateUpdate); - Assert.AreEqual(currentQueueItem.NetworkChannel, Transports.NetworkChannel.DefaultMessage); + Assert.AreEqual(currentQueueItem.NetworkChannel, NetworkChannel.DefaultMessage); // Validate the data in the queue Assert.IsTrue(NetworkManagerHelper.BuffersMatch(currentQueueItem.MessageData.Offset, messageChunkSize, currentQueueItem.MessageData.Array, randomGeneratedDataArray)); diff --git a/com.unity.multiplayer.mlapi/Tests/Runtime/RpcTests.cs b/com.unity.multiplayer.mlapi/Tests/Runtime/RpcTests.cs index e5ac612a10..3ad39f1a27 100644 --- a/com.unity.multiplayer.mlapi/Tests/Runtime/RpcTests.cs +++ b/com.unity.multiplayer.mlapi/Tests/Runtime/RpcTests.cs @@ -1,6 +1,5 @@ using System; using System.Collections; -using Unity.Multiplayer.Netcode.Messaging; using NUnit.Framework; using UnityEngine.TestTools; using Debug = UnityEngine.Debug; diff --git a/com.unity.multiplayer.mlapi/Tests/Runtime/Timing/NetworkTimeSystemTests.cs b/com.unity.multiplayer.mlapi/Tests/Runtime/Timing/NetworkTimeSystemTests.cs index ecf7b8e4d1..fd58f5cef9 100644 --- a/com.unity.multiplayer.mlapi/Tests/Runtime/Timing/NetworkTimeSystemTests.cs +++ b/com.unity.multiplayer.mlapi/Tests/Runtime/Timing/NetworkTimeSystemTests.cs @@ -1,12 +1,10 @@ using System.Collections; -using Unity.Multiplayer.Netcode.Timing; using NUnit.Framework; using UnityEngine; using UnityEngine.TestTools; -namespace Unity.Multiplayer.Netcode.RuntimeTests.Timing +namespace Unity.Multiplayer.Netcode.RuntimeTests { - /// /// Runtime tests to test the network time system with the Unity player loop. /// diff --git a/com.unity.multiplayer.mlapi/Tests/Runtime/Timing/TimeMultiInstanceTest.cs b/com.unity.multiplayer.mlapi/Tests/Runtime/Timing/TimeMultiInstanceTest.cs index c22df9920b..bfc3330b9f 100644 --- a/com.unity.multiplayer.mlapi/Tests/Runtime/Timing/TimeMultiInstanceTest.cs +++ b/com.unity.multiplayer.mlapi/Tests/Runtime/Timing/TimeMultiInstanceTest.cs @@ -1,12 +1,11 @@ using System; using System.Collections; using System.Linq; -using Unity.Multiplayer.Netcode.Timing; using NUnit.Framework; using UnityEngine; using UnityEngine.TestTools; -namespace Unity.Multiplayer.Netcode.RuntimeTests.Timing +namespace Unity.Multiplayer.Netcode.RuntimeTests { /// /// Tests the times of two clients connecting to a server using the SIPTransport (returns 50ms RTT but has no latency simulation) diff --git a/com.unity.multiplayer.mlapi/Tests/Runtime/Transport/SIPTransport.cs b/com.unity.multiplayer.mlapi/Tests/Runtime/Transport/SIPTransport.cs index dcfaf013e2..9d73b5131d 100644 --- a/com.unity.multiplayer.mlapi/Tests/Runtime/Transport/SIPTransport.cs +++ b/com.unity.multiplayer.mlapi/Tests/Runtime/Transport/SIPTransport.cs @@ -1,256 +1,274 @@ using System; using System.Collections.Generic; using Unity.Multiplayer.Netcode.Editor; -using Unity.Multiplayer.Netcode.Transports; -using Unity.Multiplayer.Netcode.Transports.Tasks; using UnityEngine; -/// -/// SIPTransport (SIngleProcessTransport) -/// is a NetworkTransport designed to be used with multiple MLAPI instances in a single process -/// it's designed for the MLAPI in a way where no networking stack has to be available -/// it's designed for testing purposes and it's not designed with speed in mind -/// -[DontShowInTransportDropdown] -public class SIPTransport : NetworkTransport +namespace Unity.Multiplayer.Netcode.RuntimeTests { - private struct Event + /// + /// SIPTransport (SIngleProcessTransport) + /// is a NetworkTransport designed to be used with multiple MLAPI instances in a single process + /// it's designed for the MLAPI in a way where no networking stack has to be available + /// it's designed for testing purposes and it's not designed with speed in mind + /// + [DontShowInTransportDropdown] + public class SIPTransport : NetworkTransport { - public NetworkEvent Type; - public ulong ConnectionId; - public ArraySegment Data; - public NetworkChannel Channel; - } + private struct Event + { + public NetworkEvent Type; + public ulong ConnectionId; + public ArraySegment Data; + public NetworkChannel Channel; + } - private class Peer - { - public ulong ConnectionId; - public SIPTransport Transport; - public Queue IncomingBuffer = new Queue(); - } + private class Peer + { + public ulong ConnectionId; + public SIPTransport Transport; + public Queue IncomingBuffer = new Queue(); + } - private readonly Dictionary m_Peers = new Dictionary(); - private ulong m_ClientsCounter = 1; + private readonly Dictionary m_Peers = new Dictionary(); + private ulong m_ClientsCounter = 1; - private static Peer s_Server; - private Peer m_LocalConnection; + private static Peer s_Server; + private Peer m_LocalConnection; - public override ulong ServerClientId => 0; - public ulong LocalClientId; + public override ulong ServerClientId => 0; + public ulong LocalClientId; - public override void DisconnectLocalClient() - { - if (m_LocalConnection != null) + public override void DisconnectLocalClient() { - // Inject local disconnect - m_LocalConnection.IncomingBuffer.Enqueue(new Event - { - Type = NetworkEvent.Disconnect, - Channel = NetworkChannel.Internal, - ConnectionId = m_LocalConnection.ConnectionId, - Data = new ArraySegment() - }); - - if (s_Server != null && m_LocalConnection != null) + if (m_LocalConnection != null) { - // Remove the connection - s_Server.Transport.m_Peers.Remove(m_LocalConnection.ConnectionId); + // Inject local disconnect + m_LocalConnection.IncomingBuffer.Enqueue(new Event + { + Type = NetworkEvent.Disconnect, + Channel = NetworkChannel.Internal, + ConnectionId = m_LocalConnection.ConnectionId, + Data = new ArraySegment() + }); + + if (s_Server != null && m_LocalConnection != null) + { + // Remove the connection + s_Server.Transport.m_Peers.Remove(m_LocalConnection.ConnectionId); + } + + if (m_LocalConnection.ConnectionId == ServerClientId) + { + StopServer(); + } + + // Remove the local connection + m_LocalConnection = null; } + } - if (m_LocalConnection.ConnectionId == ServerClientId) + // Called by server + public override void DisconnectRemoteClient(ulong clientId) + { + if (m_Peers.ContainsKey(clientId)) { - StopServer(); + // Inject disconnect into remote + m_Peers[clientId].IncomingBuffer.Enqueue(new Event + { + Type = NetworkEvent.Disconnect, + Channel = NetworkChannel.Internal, + ConnectionId = clientId, + Data = new ArraySegment() + }); + + // Inject local disconnect + m_LocalConnection.IncomingBuffer.Enqueue(new Event + { + Type = NetworkEvent.Disconnect, + Channel = NetworkChannel.Internal, + ConnectionId = clientId, + Data = new ArraySegment() + }); + + // Remove the local connection on remote + m_Peers[clientId].Transport.m_LocalConnection = null; + + // Remove connection on server + m_Peers.Remove(clientId); } - - // Remove the local connection - m_LocalConnection = null; } - } - // Called by server - public override void DisconnectRemoteClient(ulong clientId) - { - if (m_Peers.ContainsKey(clientId)) + public override ulong GetCurrentRtt(ulong clientId) { - // Inject disconnect into remote - m_Peers[clientId].IncomingBuffer.Enqueue(new Event - { - Type = NetworkEvent.Disconnect, - Channel = NetworkChannel.Internal, - ConnectionId = clientId, - Data = new ArraySegment() - }); - - // Inject local disconnect - m_LocalConnection.IncomingBuffer.Enqueue(new Event - { - Type = NetworkEvent.Disconnect, - Channel = NetworkChannel.Internal, - ConnectionId = clientId, - Data = new ArraySegment() - }); - - // Remove the local connection on remote - m_Peers[clientId].Transport.m_LocalConnection = null; - - // Remove connection on server - m_Peers.Remove(clientId); + // Always returns 50ms + return 50; } - } - - public override ulong GetCurrentRtt(ulong clientId) - { - // Always returns 50ms - return 50; - } - - public override void Init() - { - } - - private void StopServer() - { - s_Server = null; - m_Peers.Remove(ServerClientId); - } - public override void Shutdown() - { - // Inject disconnects to all the remotes - foreach (KeyValuePair onePeer in m_Peers) + public override void Init() { - onePeer.Value.IncomingBuffer.Enqueue(new Event - { - Type = NetworkEvent.Disconnect, - Channel = NetworkChannel.Internal, - ConnectionId = LocalClientId, - Data = new ArraySegment() - }); } - if (m_LocalConnection != null && m_LocalConnection.ConnectionId == ServerClientId) + private void StopServer() { - StopServer(); + s_Server = null; + m_Peers.Remove(ServerClientId); } + public override void Shutdown() + { + // Inject disconnects to all the remotes + foreach (KeyValuePair onePeer in m_Peers) + { + onePeer.Value.IncomingBuffer.Enqueue(new Event + { + Type = NetworkEvent.Disconnect, + Channel = NetworkChannel.Internal, + ConnectionId = LocalClientId, + Data = new ArraySegment() + }); + } - // TODO: Cleanup - } + if (m_LocalConnection != null && m_LocalConnection.ConnectionId == ServerClientId) + { + StopServer(); + } - public override SocketTasks StartClient() - { - if (s_Server == null) - { - // No server - Debug.LogError("No server"); - return SocketTask.Fault.AsTasks(); + + // TODO: Cleanup } - if (m_LocalConnection != null) + public override SocketTasks StartClient() { - // Already connected - Debug.LogError("Already connected"); - return SocketTask.Fault.AsTasks(); - } + if (s_Server == null) + { + // No server + Debug.LogError("No server"); + return SocketTask.Fault.AsTasks(); + } - // Generate an Id for the server that represents this client - ulong serverConnectionId = ++s_Server.Transport.m_ClientsCounter; - LocalClientId = serverConnectionId; + if (m_LocalConnection != null) + { + // Already connected + Debug.LogError("Already connected"); + return SocketTask.Fault.AsTasks(); + } - // Create local connection - m_LocalConnection = new Peer() - { - ConnectionId = serverConnectionId, - Transport = this, - IncomingBuffer = new Queue() - }; + // Generate an Id for the server that represents this client + ulong serverConnectionId = ++s_Server.Transport.m_ClientsCounter; + LocalClientId = serverConnectionId; - // Add the server as a local connection - m_Peers.Add(ServerClientId, s_Server); + // Create local connection + m_LocalConnection = new Peer() + { + ConnectionId = serverConnectionId, + Transport = this, + IncomingBuffer = new Queue() + }; - // Add local connection as a connection on the server - s_Server.Transport.m_Peers.Add(serverConnectionId, m_LocalConnection); + // Add the server as a local connection + m_Peers.Add(ServerClientId, s_Server); - // Sends a connect message to the server - s_Server.Transport.m_LocalConnection.IncomingBuffer.Enqueue(new Event() - { - Type = NetworkEvent.Connect, - ConnectionId = serverConnectionId, - Data = new ArraySegment() - }); + // Add local connection as a connection on the server + s_Server.Transport.m_Peers.Add(serverConnectionId, m_LocalConnection); - // Send a local connect message - m_LocalConnection.IncomingBuffer.Enqueue(new Event - { - Type = NetworkEvent.Connect, - ConnectionId = ServerClientId, - Data = new ArraySegment() - }); + // Sends a connect message to the server + s_Server.Transport.m_LocalConnection.IncomingBuffer.Enqueue(new Event() + { + Type = NetworkEvent.Connect, + ConnectionId = serverConnectionId, + Data = new ArraySegment() + }); - return SocketTask.Done.AsTasks(); - } + // Send a local connect message + m_LocalConnection.IncomingBuffer.Enqueue(new Event + { + Type = NetworkEvent.Connect, + ConnectionId = ServerClientId, + Data = new ArraySegment() + }); - public override SocketTasks StartServer() - { - if (s_Server != null) - { - // Can only have one server - Debug.LogError("Server already started"); - return SocketTask.Fault.AsTasks(); + return SocketTask.Done.AsTasks(); } - if (m_LocalConnection != null) + public override SocketTasks StartServer() { - // Already connected - Debug.LogError("Already connected"); - return SocketTask.Fault.AsTasks(); - } + if (s_Server != null) + { + // Can only have one server + Debug.LogError("Server already started"); + return SocketTask.Fault.AsTasks(); + } - // Create local connection - m_LocalConnection = new Peer() - { - ConnectionId = ServerClientId, - Transport = this, - IncomingBuffer = new Queue() - }; + if (m_LocalConnection != null) + { + // Already connected + Debug.LogError("Already connected"); + return SocketTask.Fault.AsTasks(); + } - // Set the local connection as the server - s_Server = m_LocalConnection; + // Create local connection + m_LocalConnection = new Peer() + { + ConnectionId = ServerClientId, + Transport = this, + IncomingBuffer = new Queue() + }; - m_Peers.Add(ServerClientId, s_Server); + // Set the local connection as the server + s_Server = m_LocalConnection; - return SocketTask.Done.AsTasks(); - } + m_Peers.Add(ServerClientId, s_Server); - public override void Send(ulong clientId, ArraySegment data, NetworkChannel channel) - { - if (m_LocalConnection != null) - { - // Create copy since MLAPI wants the byte array back straight after the method call. - // Hard on GC. - byte[] copy = new byte[data.Count]; - Buffer.BlockCopy(data.Array, data.Offset, copy, 0, data.Count); + return SocketTask.Done.AsTasks(); + } - if (!m_Peers.ContainsKey(clientId)) + public override void Send(ulong clientId, ArraySegment data, NetworkChannel channel) + { + if (m_LocalConnection != null) { - throw new KeyNotFoundException($"peer id {clientId} not in peer list"); + // Create copy since MLAPI wants the byte array back straight after the method call. + // Hard on GC. + byte[] copy = new byte[data.Count]; + Buffer.BlockCopy(data.Array, data.Offset, copy, 0, data.Count); + + if (!m_Peers.ContainsKey(clientId)) + { + throw new KeyNotFoundException($"peer id {clientId} not in peer list"); + } + + m_Peers[clientId].IncomingBuffer.Enqueue(new Event + { + Type = NetworkEvent.Data, + ConnectionId = m_LocalConnection.ConnectionId, + Data = new ArraySegment(copy), + Channel = channel + }); } - - m_Peers[clientId].IncomingBuffer.Enqueue(new Event - { - Type = NetworkEvent.Data, - ConnectionId = m_LocalConnection.ConnectionId, - Data = new ArraySegment(copy), - Channel = channel - }); } - } - public override NetworkEvent PollEvent(out ulong clientId, out NetworkChannel channel, out ArraySegment payload, out float receiveTime) - { - if (m_LocalConnection != null) + public override NetworkEvent PollEvent(out ulong clientId, out NetworkChannel channel, out ArraySegment payload, out float receiveTime) { - if (m_LocalConnection.IncomingBuffer.Count == 0) + if (m_LocalConnection != null) + { + if (m_LocalConnection.IncomingBuffer.Count == 0) + { + clientId = 0; + channel = NetworkChannel.Internal; + payload = new ArraySegment(); + receiveTime = 0; + return NetworkEvent.Nothing; + } + + var peerEvent = m_LocalConnection.IncomingBuffer.Dequeue(); + + clientId = peerEvent.ConnectionId; + channel = peerEvent.Channel; + payload = peerEvent.Data; + receiveTime = 0; + + return peerEvent.Type; + } + else { clientId = 0; channel = NetworkChannel.Internal; @@ -258,23 +276,6 @@ public override NetworkEvent PollEvent(out ulong clientId, out NetworkChannel ch receiveTime = 0; return NetworkEvent.Nothing; } - - var peerEvent = m_LocalConnection.IncomingBuffer.Dequeue(); - - clientId = peerEvent.ConnectionId; - channel = peerEvent.Channel; - payload = peerEvent.Data; - receiveTime = 0; - - return peerEvent.Type; - } - else - { - clientId = 0; - channel = NetworkChannel.Internal; - payload = new ArraySegment(); - receiveTime = 0; - return NetworkEvent.Nothing; } } } diff --git a/com.unity.multiplayer.mlapi/Tests/Runtime/Transport/SIPTransportTests.cs b/com.unity.multiplayer.mlapi/Tests/Runtime/Transport/SIPTransportTests.cs index 96d732d3f1..cb1b0fa0f3 100644 --- a/com.unity.multiplayer.mlapi/Tests/Runtime/Transport/SIPTransportTests.cs +++ b/com.unity.multiplayer.mlapi/Tests/Runtime/Transport/SIPTransportTests.cs @@ -1,6 +1,5 @@ using System; using System.Text; -using Unity.Multiplayer.Netcode.Transports; using NUnit.Framework; using UnityEngine; @@ -45,6 +44,9 @@ public void SendReceiveData() // Make sure the payload was correct Assert.That(serverPayload, Is.EquivalentTo(Encoding.ASCII.GetBytes("Hello Server"))); Assert.That(clientPayload, Is.EquivalentTo(Encoding.ASCII.GetBytes("Hello Client"))); + + server.Shutdown(); + client.Shutdown(); } } } diff --git a/com.unity.multiplayer.mlapi/Tests/Runtime/com.unity.multiplayer.mlapi.runtimetests.asmdef b/com.unity.multiplayer.mlapi/Tests/Runtime/com.unity.multiplayer.mlapi.runtimetests.asmdef index 7e2bc0e99e..40d517e866 100644 --- a/com.unity.multiplayer.mlapi/Tests/Runtime/com.unity.multiplayer.mlapi.runtimetests.asmdef +++ b/com.unity.multiplayer.mlapi/Tests/Runtime/com.unity.multiplayer.mlapi.runtimetests.asmdef @@ -1,6 +1,6 @@ { "name": "Unity.Multiplayer.MLAPI.RuntimeTests", - "rootNamespace": "MLAPI.RuntimeTests", + "rootNamespace": "Unity.Multiplayer.Netcode.RuntimeTests", "references": [ "Unity.Multiplayer.MLAPI.Runtime", "Unity.Multiplayer.MLAPI.Editor", diff --git a/com.unity.multiplayer.transport.utp/Runtime/UTPTransport.cs b/com.unity.multiplayer.transport.utp/Runtime/UTPTransport.cs index 47cefacfd5..3da309ac5f 100644 --- a/com.unity.multiplayer.transport.utp/Runtime/UTPTransport.cs +++ b/com.unity.multiplayer.transport.utp/Runtime/UTPTransport.cs @@ -1,8 +1,7 @@ using System; using System.Runtime.InteropServices; -using Unity.Multiplayer.Netcode.Transports; -using Unity.Multiplayer.Netcode.Transports.Tasks; +using Unity.Multiplayer.Netcode; using Unity.Burst; using Unity.Collections; @@ -14,7 +13,7 @@ using UnityEngine.Assertions; using NetworkEvent = Unity.Networking.Transport.NetworkEvent; -using NetcodeEvent = Unity.Multiplayer.Netcode.Transports.NetworkEvent; +using NetcodeEvent = Unity.Multiplayer.Netcode.NetworkEvent; [StructLayout(LayoutKind.Explicit)] public unsafe struct RawNetworkMessage diff --git a/com.unity.multiplayer.transport.utp/Tests/Editor/BasicUTPTest.cs b/com.unity.multiplayer.transport.utp/Tests/Editor/BasicUTPTest.cs index 0c0592d5cb..3d176663da 100644 --- a/com.unity.multiplayer.transport.utp/Tests/Editor/BasicUTPTest.cs +++ b/com.unity.multiplayer.transport.utp/Tests/Editor/BasicUTPTest.cs @@ -1,7 +1,7 @@ using UnityEngine; using NUnit.Framework; -namespace Unity.Multiplayer.Netcode.UTP.RuntimeTests +namespace Unity.Multiplayer.Netcode.UTP.EditorTests { public class BasicUTPTest : MonoBehaviour { @@ -18,5 +18,3 @@ public void BasicUTPInitializationTest() } } } - - diff --git a/com.unity.multiplayer.transport.utp/Tests/Editor/com.unity.multiplayer.transport.utp.editortests.asmdef b/com.unity.multiplayer.transport.utp/Tests/Editor/com.unity.multiplayer.transport.utp.editortests.asmdef index dca00f9771..406f3df974 100644 --- a/com.unity.multiplayer.transport.utp/Tests/Editor/com.unity.multiplayer.transport.utp.editortests.asmdef +++ b/com.unity.multiplayer.transport.utp/Tests/Editor/com.unity.multiplayer.transport.utp.editortests.asmdef @@ -1,6 +1,6 @@ { "name": "Unity.Multiplayer.Transport.UTP.EditorTests", - "rootNamespace": "", + "rootNamespace": "Unity.Multiplayer.Netcode.UTP.EditorTests", "references": [ "Unity.Multiplayer.MLAPI.Runtime", "UnityEngine.TestRunner", diff --git a/com.unity.multiplayer.transport.utp/Tests/Runtime/DummyTestScript.cs b/com.unity.multiplayer.transport.utp/Tests/Runtime/DummyTestScript.cs new file mode 100644 index 0000000000..a5ced74f88 --- /dev/null +++ b/com.unity.multiplayer.transport.utp/Tests/Runtime/DummyTestScript.cs @@ -0,0 +1,26 @@ +using System.Collections; +using NUnit.Framework; +using UnityEngine.TestTools; + +namespace Unity.Multiplayer.Netcode.UTP.RuntimeTests +{ + public class DummyTestScript + { + // A Test behaves as an ordinary method + [Test] + public void DummyTestScriptSimplePasses() + { + // Use the Assert class to test conditions + } + + // A UnityTest behaves like a coroutine in Play Mode. In Edit Mode you can use + // `yield return null;` to skip a frame. + [UnityTest] + public IEnumerator DummyTestScriptWithEnumeratorPasses() + { + // Use the Assert class to test conditions. + // Use yield to skip a frame. + yield return null; + } + } +} diff --git a/com.unity.multiplayer.transport.utp/Tests/Runtime/DummyTestScript.cs.meta b/com.unity.multiplayer.transport.utp/Tests/Runtime/DummyTestScript.cs.meta new file mode 100644 index 0000000000..5d3c36c174 --- /dev/null +++ b/com.unity.multiplayer.transport.utp/Tests/Runtime/DummyTestScript.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: a4625f3349130440d9879c25654c9862 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/com.unity.multiplayer.transport.utp/Tests/Runtime/com.unity.multiplayer.transport.utp.runtimetests.asmdef b/com.unity.multiplayer.transport.utp/Tests/Runtime/com.unity.multiplayer.transport.utp.runtimetests.asmdef index 16811cc2b1..af5b83ac87 100644 --- a/com.unity.multiplayer.transport.utp/Tests/Runtime/com.unity.multiplayer.transport.utp.runtimetests.asmdef +++ b/com.unity.multiplayer.transport.utp/Tests/Runtime/com.unity.multiplayer.transport.utp.runtimetests.asmdef @@ -1,6 +1,6 @@ { "name": "Unity.Multiplayer.Transport.UTP.RuntimeTests", - "rootNamespace": "", + "rootNamespace": "Unity.Multiplayer.Netcode.UTP.RuntimeTests", "references": [ "Unity.Multiplayer.MLAPI.Runtime", "UnityEngine.TestRunner", diff --git a/testproject/Assets/Samples/EnableDisableNetworkObject/EnableDisableSceneNetworkObjectComponent.cs b/testproject/Assets/Samples/EnableDisableNetworkObject/EnableDisableSceneNetworkObjectComponent.cs index 53e896b35a..27f308b611 100644 --- a/testproject/Assets/Samples/EnableDisableNetworkObject/EnableDisableSceneNetworkObjectComponent.cs +++ b/testproject/Assets/Samples/EnableDisableNetworkObject/EnableDisableSceneNetworkObjectComponent.cs @@ -1,8 +1,6 @@ using UnityEngine; using UnityEngine.UI; using Unity.Multiplayer.Netcode; -using Unity.Multiplayer.Netcode.Messaging; - public class EnableDisableSceneNetworkObjectComponent : NetworkBehaviour { diff --git a/testproject/Assets/Scripts/GrabbableBall.cs b/testproject/Assets/Scripts/GrabbableBall.cs index 156ce0bf89..70ff3db312 100644 --- a/testproject/Assets/Scripts/GrabbableBall.cs +++ b/testproject/Assets/Scripts/GrabbableBall.cs @@ -1,7 +1,5 @@ using UnityEngine; using Unity.Multiplayer.Netcode; -using Unity.Multiplayer.Netcode.NetworkVariable; -using Unity.Multiplayer.Netcode.Messaging; public class GrabbableBall : NetworkBehaviour { diff --git a/testproject/Assets/Scripts/SyncTransform.cs b/testproject/Assets/Scripts/SyncTransform.cs index c28902e1c7..b97cd4b8c4 100644 --- a/testproject/Assets/Scripts/SyncTransform.cs +++ b/testproject/Assets/Scripts/SyncTransform.cs @@ -1,4 +1,3 @@ -using Unity.Multiplayer.Netcode.NetworkVariable; using UnityEngine; namespace Unity.Multiplayer.Netcode diff --git a/testproject/Assets/Tests/Editor/DummyTestScript.cs b/testproject/Assets/Tests/Editor/DummyTestScript.cs new file mode 100644 index 0000000000..44e87a64e5 --- /dev/null +++ b/testproject/Assets/Tests/Editor/DummyTestScript.cs @@ -0,0 +1,26 @@ +using System.Collections; +using NUnit.Framework; +using UnityEngine.TestTools; + +namespace TestProject.EditorTests +{ + public class DummyTestScript + { + // A Test behaves as an ordinary method + [Test] + public void DummyTestScriptSimplePasses() + { + // Use the Assert class to test conditions + } + + // A UnityTest behaves like a coroutine in Play Mode. In Edit Mode you can use + // `yield return null;` to skip a frame. + [UnityTest] + public IEnumerator DummyTestScriptWithEnumeratorPasses() + { + // Use the Assert class to test conditions. + // Use yield to skip a frame. + yield return null; + } + } +} diff --git a/testproject/Assets/Tests/Editor/DummyTestScript.cs.meta b/testproject/Assets/Tests/Editor/DummyTestScript.cs.meta new file mode 100644 index 0000000000..8517db2b69 --- /dev/null +++ b/testproject/Assets/Tests/Editor/DummyTestScript.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 0dc1c04a00e514419ba1e96d4a427c7a +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/testproject/Assets/Tests/Editor/testproject.editortests.asmdef b/testproject/Assets/Tests/Editor/testproject.editortests.asmdef index 256df4b3a7..14fdc09bce 100644 --- a/testproject/Assets/Tests/Editor/testproject.editortests.asmdef +++ b/testproject/Assets/Tests/Editor/testproject.editortests.asmdef @@ -1,5 +1,6 @@ { "name": "TestProject.EditorTests", + "rootNamespace": "TestProject.EditorTests", "references": [ "Unity.Multiplayer.MLAPI.Runtime", "Unity.Multiplayer.MLAPI.Editor" @@ -9,6 +10,5 @@ ], "includePlatforms": [ "Editor" - ], - "excludePlatforms": [] + ] } \ No newline at end of file diff --git a/testproject/Assets/Tests/Manual/HybridScripts/RpcQueueManualTests.cs b/testproject/Assets/Tests/Manual/HybridScripts/RpcQueueManualTests.cs index f957ceaea8..50322a4802 100644 --- a/testproject/Assets/Tests/Manual/HybridScripts/RpcQueueManualTests.cs +++ b/testproject/Assets/Tests/Manual/HybridScripts/RpcQueueManualTests.cs @@ -2,7 +2,6 @@ using UnityEngine; using UnityEngine.UI; using Unity.Multiplayer.Netcode; -using Unity.Multiplayer.Netcode.Messaging; namespace TestProject.ManualTests { diff --git a/testproject/Assets/Tests/Manual/NetworkAnimatorTests/AnimatedCubeController.cs b/testproject/Assets/Tests/Manual/NetworkAnimatorTests/AnimatedCubeController.cs index d239a7379f..a5973538b4 100644 --- a/testproject/Assets/Tests/Manual/NetworkAnimatorTests/AnimatedCubeController.cs +++ b/testproject/Assets/Tests/Manual/NetworkAnimatorTests/AnimatedCubeController.cs @@ -1,5 +1,4 @@ using Unity.Multiplayer.Netcode; -using Unity.Multiplayer.Netcode.Messaging; using Unity.Multiplayer.Netcode.Prototyping; using UnityEngine; diff --git a/testproject/Assets/Tests/Manual/Scripts/BandwidthTest.cs b/testproject/Assets/Tests/Manual/Scripts/BandwidthTest.cs index f54aadcc73..5304c82f9e 100644 --- a/testproject/Assets/Tests/Manual/Scripts/BandwidthTest.cs +++ b/testproject/Assets/Tests/Manual/Scripts/BandwidthTest.cs @@ -1,7 +1,5 @@ using UnityEngine; using Unity.Multiplayer.Netcode; -using Unity.Multiplayer.Netcode.NetworkVariable; -using Unity.Multiplayer.Netcode.NetworkVariable.Collections; namespace TestProject.ManualTests { diff --git a/testproject/Assets/Tests/Manual/Scripts/ManualNetworkVariableTest.cs b/testproject/Assets/Tests/Manual/Scripts/ManualNetworkVariableTest.cs index fe6970686c..9803b11c97 100644 --- a/testproject/Assets/Tests/Manual/Scripts/ManualNetworkVariableTest.cs +++ b/testproject/Assets/Tests/Manual/Scripts/ManualNetworkVariableTest.cs @@ -1,8 +1,6 @@ using System.Collections.Generic; using UnityEngine; using Unity.Multiplayer.Netcode; -using Unity.Multiplayer.Netcode.NetworkVariable; -using Unity.Multiplayer.Netcode.NetworkVariable.Collections; namespace TestProject.ManualTests { @@ -28,7 +26,6 @@ public class ManualNetworkVariableTest : NetworkBehaviour private NetworkVariable m_TestVar = new NetworkVariable(); private string m_Problems = string.Empty; - private int m_Count = 0; private bool m_Started = false; private const int k_EndValue = 1000; diff --git a/testproject/Assets/Tests/Manual/Scripts/NetworkPrefabPool.cs b/testproject/Assets/Tests/Manual/Scripts/NetworkPrefabPool.cs index aa9b0510d3..12fd9e752b 100644 --- a/testproject/Assets/Tests/Manual/Scripts/NetworkPrefabPool.cs +++ b/testproject/Assets/Tests/Manual/Scripts/NetworkPrefabPool.cs @@ -3,7 +3,6 @@ using UnityEngine; using UnityEngine.UI; using Unity.Multiplayer.Netcode; -using Unity.Multiplayer.Netcode.Spawning; namespace TestProject.ManualTests { diff --git a/testproject/Assets/Tests/Manual/Scripts/StatsDisplay.cs b/testproject/Assets/Tests/Manual/Scripts/StatsDisplay.cs index 464579200e..19e9a706c5 100644 --- a/testproject/Assets/Tests/Manual/Scripts/StatsDisplay.cs +++ b/testproject/Assets/Tests/Manual/Scripts/StatsDisplay.cs @@ -3,8 +3,6 @@ using UnityEngine; using UnityEngine.UI; using Unity.Multiplayer.Netcode; -using Unity.Multiplayer.Netcode.Messaging; -using Unity.Multiplayer.Netcode.Profiling; namespace TestProject.ManualTests { diff --git a/testproject/Assets/Tests/Manual/Scripts/StatsInfoContainer.cs b/testproject/Assets/Tests/Manual/Scripts/StatsInfoContainer.cs index 07612bffc5..d24a130ba5 100644 --- a/testproject/Assets/Tests/Manual/Scripts/StatsInfoContainer.cs +++ b/testproject/Assets/Tests/Manual/Scripts/StatsInfoContainer.cs @@ -1,5 +1,5 @@ using System.Collections.Generic; -using Unity.Multiplayer.Netcode.Serialization; +using Unity.Multiplayer.Netcode; namespace TestProject.ManualTests { diff --git a/testproject/Assets/Tests/Manual/Scripts/SwitchSceneHandler.cs b/testproject/Assets/Tests/Manual/Scripts/SwitchSceneHandler.cs index 6a70426996..2f01b311ef 100644 --- a/testproject/Assets/Tests/Manual/Scripts/SwitchSceneHandler.cs +++ b/testproject/Assets/Tests/Manual/Scripts/SwitchSceneHandler.cs @@ -1,7 +1,6 @@ using System.Collections; using UnityEngine; using Unity.Multiplayer.Netcode; -using Unity.Multiplayer.Netcode.SceneManagement; namespace TestProject.ManualTests { @@ -23,7 +22,6 @@ public class SwitchSceneHandler : NetworkBehaviour [SerializeField] private float m_AutoSwitchTimeOut = 60; - private void Awake() { ExitingNow = false; @@ -33,11 +31,8 @@ private void Start() { m_SwitchSceneButtonObject.SetActive(false); StartCoroutine(CheckForVisibility()); - } - - private bool m_ExitingScene; private void OnDestroy() { diff --git a/testproject/Assets/Tests/Manual/testproject.manualtests.asmdef b/testproject/Assets/Tests/Manual/testproject.manualtests.asmdef index d0fad6ab7c..593f1822b8 100644 --- a/testproject/Assets/Tests/Manual/testproject.manualtests.asmdef +++ b/testproject/Assets/Tests/Manual/testproject.manualtests.asmdef @@ -1,5 +1,6 @@ { "name": "TestProject.ManualTests", + "rootNamespace": "TestProject.ManualTests", "references": [ "TestProject", "Unity.Multiplayer.MLAPI.Runtime", diff --git a/testproject/Assets/Tests/Runtime/FixedUpdateMessagesAreOnlyProcessedOnceTest.cs b/testproject/Assets/Tests/Runtime/FixedUpdateMessagesAreOnlyProcessedOnceTest.cs index 91d39f33b8..533d367d42 100644 --- a/testproject/Assets/Tests/Runtime/FixedUpdateMessagesAreOnlyProcessedOnceTest.cs +++ b/testproject/Assets/Tests/Runtime/FixedUpdateMessagesAreOnlyProcessedOnceTest.cs @@ -1,6 +1,5 @@ using System.Collections; using Unity.Multiplayer.Netcode; -using Unity.Multiplayer.Netcode.Configuration; using Unity.Multiplayer.Netcode.RuntimeTests; using NUnit.Framework; using TestProject.RuntimeTests.Support; diff --git a/testproject/Assets/Tests/Runtime/MessageOrdering.cs b/testproject/Assets/Tests/Runtime/MessageOrdering.cs index be8effcf39..b968bb0e34 100644 --- a/testproject/Assets/Tests/Runtime/MessageOrdering.cs +++ b/testproject/Assets/Tests/Runtime/MessageOrdering.cs @@ -1,6 +1,5 @@ using System.Collections; using Unity.Multiplayer.Netcode; -using Unity.Multiplayer.Netcode.Configuration; using Unity.Multiplayer.Netcode.RuntimeTests; using NUnit.Framework; using TestProject.RuntimeTests.Support; diff --git a/testproject/Assets/Tests/Runtime/MultiprocessRuntime/ExecuteStepInContext.cs b/testproject/Assets/Tests/Runtime/MultiprocessRuntime/ExecuteStepInContext.cs index c8a7228fd0..615a9f35fd 100644 --- a/testproject/Assets/Tests/Runtime/MultiprocessRuntime/ExecuteStepInContext.cs +++ b/testproject/Assets/Tests/Runtime/MultiprocessRuntime/ExecuteStepInContext.cs @@ -5,7 +5,6 @@ using System.Linq; using System.Reflection; using Unity.Multiplayer.Netcode; -using Unity.Multiplayer.Netcode.Messaging; using NUnit.Framework; using NUnit.Framework.Interfaces; using UnityEngine; diff --git a/testproject/Assets/Tests/Runtime/MultiprocessRuntime/Helpers/CustomPrefabSpawnerForPerformanceTests.cs b/testproject/Assets/Tests/Runtime/MultiprocessRuntime/Helpers/CustomPrefabSpawnerForPerformanceTests.cs index 430140d387..1ad92132b1 100644 --- a/testproject/Assets/Tests/Runtime/MultiprocessRuntime/Helpers/CustomPrefabSpawnerForPerformanceTests.cs +++ b/testproject/Assets/Tests/Runtime/MultiprocessRuntime/Helpers/CustomPrefabSpawnerForPerformanceTests.cs @@ -1,6 +1,5 @@ using System; using UnityEngine; -using Unity.Multiplayer.Netcode.Spawning; namespace Unity.Multiplayer.Netcode.MultiprocessRuntimeTests { diff --git a/testproject/Assets/Tests/Runtime/MultiprocessRuntime/NetworkVariablePerformanceTests.cs b/testproject/Assets/Tests/Runtime/MultiprocessRuntime/NetworkVariablePerformanceTests.cs index f35cdb1346..f032f93815 100644 --- a/testproject/Assets/Tests/Runtime/MultiprocessRuntime/NetworkVariablePerformanceTests.cs +++ b/testproject/Assets/Tests/Runtime/MultiprocessRuntime/NetworkVariablePerformanceTests.cs @@ -1,7 +1,6 @@ using System; using System.Collections; using System.Collections.Generic; -using Unity.Multiplayer.Netcode.NetworkVariable; using NUnit.Framework; using Unity.PerformanceTesting; using UnityEngine; diff --git a/testproject/Assets/Tests/Runtime/MultiprocessRuntime/TestCoordinator.cs b/testproject/Assets/Tests/Runtime/MultiprocessRuntime/TestCoordinator.cs index 1ca0925c64..0a8ae1e571 100644 --- a/testproject/Assets/Tests/Runtime/MultiprocessRuntime/TestCoordinator.cs +++ b/testproject/Assets/Tests/Runtime/MultiprocessRuntime/TestCoordinator.cs @@ -3,7 +3,6 @@ using System.Linq; using System.Reflection; using Unity.Multiplayer.Netcode; -using Unity.Multiplayer.Netcode.Messaging; using NUnit.Framework; using UnityEngine; using Debug = UnityEngine.Debug; diff --git a/testproject/Assets/Tests/Runtime/RpcINetworkSerializable.cs b/testproject/Assets/Tests/Runtime/RpcINetworkSerializable.cs index b1f4de0196..a5d0a9465f 100644 --- a/testproject/Assets/Tests/Runtime/RpcINetworkSerializable.cs +++ b/testproject/Assets/Tests/Runtime/RpcINetworkSerializable.cs @@ -5,8 +5,6 @@ using UnityEngine.TestTools; using Unity.Multiplayer.Netcode; using Unity.Multiplayer.Netcode.RuntimeTests; -using Unity.Multiplayer.Netcode.Serialization; -using Unity.Multiplayer.Netcode.Messaging; namespace TestProject.RuntimeTests { diff --git a/testproject/Assets/Tests/Runtime/Support/SpawnRpcDespawn.cs b/testproject/Assets/Tests/Runtime/Support/SpawnRpcDespawn.cs index f520f528f3..728682d4cb 100644 --- a/testproject/Assets/Tests/Runtime/Support/SpawnRpcDespawn.cs +++ b/testproject/Assets/Tests/Runtime/Support/SpawnRpcDespawn.cs @@ -1,6 +1,5 @@ using System; using Unity.Multiplayer.Netcode; -using Unity.Multiplayer.Netcode.Messaging; using NUnit.Framework; using UnityEngine; diff --git a/testproject/Assets/Tests/Runtime/Support/SpawnRpcDespawnInstanceHandler.cs b/testproject/Assets/Tests/Runtime/Support/SpawnRpcDespawnInstanceHandler.cs index 24f11b286f..e8e9c1a120 100644 --- a/testproject/Assets/Tests/Runtime/Support/SpawnRpcDespawnInstanceHandler.cs +++ b/testproject/Assets/Tests/Runtime/Support/SpawnRpcDespawnInstanceHandler.cs @@ -1,7 +1,4 @@ using Unity.Multiplayer.Netcode; -using Unity.Multiplayer.Netcode.Configuration; -using Unity.Multiplayer.Netcode.Logging; -using Unity.Multiplayer.Netcode.Spawning; using NUnit.Framework; using UnityEngine; diff --git a/testproject/Assets/Tests/Runtime/testproject.runtimetests.asmdef b/testproject/Assets/Tests/Runtime/testproject.runtimetests.asmdef index abe114e619..ec085f3662 100644 --- a/testproject/Assets/Tests/Runtime/testproject.runtimetests.asmdef +++ b/testproject/Assets/Tests/Runtime/testproject.runtimetests.asmdef @@ -1,5 +1,6 @@ { "name": "TestProject.RuntimeTests", + "rootNamespace": "TestProject.RuntimeTests", "references": [ "TestProject.ManualTests", "Unity.Multiplayer.MLAPI.Runtime",