Skip to content

Commit 9c73270

Browse files
authored
chore!: per-asmdef namespaces instead of per-folder (#1009)
* chore!: per-asmdef namespaces instead of per-folder * fix SIPTransportTests * delete empty folders * make most of profiler types internal
1 parent 85842ee commit 9c73270

File tree

174 files changed

+467
-666
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

174 files changed

+467
-666
lines changed

com.unity.multiplayer.mlapi/Editor/CodeGen/CodeGenHelpers.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,6 @@
33
using System.IO;
44
using System.Linq;
55
using System.Text;
6-
using Unity.Multiplayer.Netcode.Hashing;
7-
using Unity.Multiplayer.Netcode.Messaging;
8-
using Unity.Multiplayer.Netcode.Serialization;
96
using Mono.Cecil;
107
using Mono.Cecil.Cil;
118
using Mono.Cecil.Rocks;

com.unity.multiplayer.mlapi/Editor/CodeGen/NetworkBehaviourILPP.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,6 @@
33
using System.Linq;
44
using System.Collections.Generic;
55
using System.Reflection;
6-
using Unity.Multiplayer.Netcode.Logging;
7-
using Unity.Multiplayer.Netcode.Messaging;
8-
using Unity.Multiplayer.Netcode.Serialization;
96
using Mono.Cecil;
107
using Mono.Cecil.Cil;
118
using Mono.Cecil.Rocks;

com.unity.multiplayer.mlapi/Editor/CodeGen/RuntimeAccessModifiersILPP.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ public override ILPostProcessResult Process(ICompiledAssembly compiledAssembly)
5252
case nameof(NetworkBehaviour):
5353
ProcessNetworkBehaviour(typeDefinition);
5454
break;
55-
case nameof(Messaging.__RpcParams):
55+
case nameof(__RpcParams):
5656
typeDefinition.IsPublic = true;
5757
break;
5858
}
Lines changed: 17 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,19 @@
11
{
2-
"name": "Unity.Multiplayer.MLAPI.Editor.CodeGen",
3-
"rootNamespace": "",
4-
"references": [
5-
"Unity.Multiplayer.MLAPI.Runtime"
6-
],
7-
"includePlatforms": [
8-
"Editor"
9-
],
10-
"excludePlatforms": [],
11-
"allowUnsafeCode": true,
12-
"overrideReferences": true,
13-
"precompiledReferences": [
14-
"Mono.Cecil.dll",
15-
"Mono.Cecil.Mdb.dll",
16-
"Mono.Cecil.Pdb.dll",
17-
"Mono.Cecil.Rocks.dll"
18-
],
19-
"autoReferenced": false,
20-
"defineConstraints": [],
21-
"versionDefines": [],
22-
"noEngineReferences": false
2+
"name": "Unity.Multiplayer.MLAPI.Editor.CodeGen",
3+
"rootNamespace": "Unity.Multiplayer.Netcode.Editor.CodeGen",
4+
"references": [
5+
"Unity.Multiplayer.MLAPI.Runtime"
6+
],
7+
"includePlatforms": [
8+
"Editor"
9+
],
10+
"allowUnsafeCode": true,
11+
"overrideReferences": true,
12+
"precompiledReferences": [
13+
"Mono.Cecil.dll",
14+
"Mono.Cecil.Mdb.dll",
15+
"Mono.Cecil.Pdb.dll",
16+
"Mono.Cecil.Rocks.dll"
17+
],
18+
"autoReferenced": false
2319
}

com.unity.multiplayer.mlapi/Editor/MLAPIProfiler.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
using System.Collections.Generic;
22
using System.IO;
3-
using Unity.Multiplayer.Netcode.Profiling;
4-
using Unity.Multiplayer.Netcode.Serialization;
3+
using UnityEditor;
54
using UnityEngine;
65

7-
namespace UnityEditor
6+
namespace Unity.Multiplayer.Netcode.Editor
87
{
98
public class MLAPIProfiler : EditorWindow
109
{

com.unity.multiplayer.mlapi/Editor/MLAPIProfilerModule.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
using System;
22
using System.Collections.Generic;
3-
using Unity.Multiplayer.Netcode.Profiling;
43
using Unity.Profiling;
54
using UnityEditor;
65
using UnityEngine;
76

8-
namespace Unity.Multiplayer.Netcode
7+
namespace Unity.Multiplayer.Netcode.Editor
98
{
109
[InitializeOnLoad]
1110
internal static class MLAPIProfilerModule

com.unity.multiplayer.mlapi/Editor/NetworkBehaviourEditor.cs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
11
using System;
22
using System.Collections.Generic;
33
using System.Reflection;
4-
using Unity.Multiplayer.Netcode;
5-
using Unity.Multiplayer.Netcode.NetworkVariable;
64
using UnityEngine;
5+
using UnityEditor;
76

8-
namespace UnityEditor
7+
namespace Unity.Multiplayer.Netcode.Editor
98
{
109
[CustomEditor(typeof(NetworkBehaviour), true)]
1110
[CanEditMultipleObjects]
12-
public class NetworkBehaviourEditor : Editor
11+
public class NetworkBehaviourEditor : UnityEditor.Editor
1312
{
1413
private bool m_Initialized;
1514
private readonly List<string> m_NetworkVariableNames = new List<string>();

com.unity.multiplayer.mlapi/Editor/NetworkManagerEditor.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
using UnityEditor;
44
using UnityEngine;
55
using UnityEditorInternal;
6-
using Unity.Multiplayer.Netcode.Configuration;
7-
using Unity.Multiplayer.Netcode.Transports;
86

97
namespace Unity.Multiplayer.Netcode.Editor
108
{
Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,11 @@
11
{
22
"name": "Unity.Multiplayer.MLAPI.Editor",
3-
"rootNamespace": "",
3+
"rootNamespace": "Unity.Multiplayer.Netcode.Editor",
44
"references": [
55
"Unity.Multiplayer.MLAPI.Runtime",
66
"Unity.Multiplayer.MLAPI.Prototyping"
77
],
88
"includePlatforms": [
99
"Editor"
10-
],
11-
"excludePlatforms": [],
12-
"allowUnsafeCode": false,
13-
"overrideReferences": false,
14-
"precompiledReferences": [],
15-
"autoReferenced": false,
16-
"defineConstraints": [],
17-
"versionDefines": [],
18-
"noEngineReferences": false
10+
]
1911
}

com.unity.multiplayer.mlapi/Prototyping/NetworkAnimator.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
using System.Linq;
22
using System.Collections.Generic;
3-
using Unity.Multiplayer.Netcode.Messaging;
4-
using Unity.Multiplayer.Netcode.Serialization;
53
using UnityEngine;
64

75
namespace Unity.Multiplayer.Netcode.Prototyping

com.unity.multiplayer.mlapi/Prototyping/NetworkNavMeshAgent.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
using System.Collections.Generic;
22
using UnityEngine;
33
using UnityEngine.AI;
4-
using Unity.Multiplayer.Netcode.Connection;
5-
using Unity.Multiplayer.Netcode.Messaging;
64

75
namespace Unity.Multiplayer.Netcode.Prototyping
86
{

com.unity.multiplayer.mlapi/Prototyping/NetworkTransform.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
11
using System;
2-
using Unity.Multiplayer.Netcode.NetworkVariable;
3-
using Unity.Multiplayer.Netcode.Serialization;
4-
using Unity.Multiplayer.Netcode.Transports;
52
using UnityEngine;
63

74
namespace Unity.Multiplayer.Netcode.Prototyping
Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
{
22
"name": "Unity.Multiplayer.MLAPI.Prototyping",
3-
"rootNamespace": "MLAPI.Prototyping",
3+
"rootNamespace": "Unity.Multiplayer.Netcode.Prototyping",
44
"references": [
55
"Unity.Multiplayer.MLAPI.Runtime"
6-
],
7-
"includePlatforms": [],
8-
"excludePlatforms": []
6+
]
97
}

com.unity.multiplayer.mlapi/Runtime/Collections/FixedQueue.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
using System;
22

3-
namespace Unity.Multiplayer.Netcode.Collections
3+
namespace Unity.Multiplayer.Netcode
44
{
55
/// <summary>
66
/// Queue with a fixed size

com.unity.multiplayer.mlapi/Runtime/Configuration/HashSize.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
namespace Unity.Multiplayer.Netcode.Configuration
1+
namespace Unity.Multiplayer.Netcode
22
{
33
/// <summary>
44
/// Represents the length of a var int encoded hash

com.unity.multiplayer.mlapi/Runtime/Configuration/NetworkConfig.cs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,8 @@
22
using System.Collections.Generic;
33
using UnityEngine;
44
using System.Linq;
5-
using Unity.Multiplayer.Netcode.Transports;
6-
using Unity.Multiplayer.Netcode.Hashing;
7-
using Unity.Multiplayer.Netcode.Serialization;
8-
using Unity.Multiplayer.Netcode.Serialization.Pooled;
95

10-
namespace Unity.Multiplayer.Netcode.Configuration
6+
namespace Unity.Multiplayer.Netcode
117
{
128
/// <summary>
139
/// The configuration object used to start server, client and hosts

com.unity.multiplayer.mlapi/Runtime/Configuration/NetworkConstants.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
namespace Unity.Multiplayer.Netcode.Configuration
1+
namespace Unity.Multiplayer.Netcode
22
{
33
/// <summary>
44
/// A static class containing MLAPI constants

com.unity.multiplayer.mlapi/Runtime/Configuration/NetworkPrefab.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
using System;
22
using UnityEngine;
33

4-
namespace Unity.Multiplayer.Netcode.Configuration
4+
namespace Unity.Multiplayer.Netcode
55
{
66
internal enum NetworkPrefabOverride
77
{

com.unity.multiplayer.mlapi/Runtime/Connection/NetworkClient.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
using System.Collections.Generic;
22

3-
namespace Unity.Multiplayer.Netcode.Connection
3+
namespace Unity.Multiplayer.Netcode
44
{
55
/// <summary>
66
/// A NetworkClient

com.unity.multiplayer.mlapi/Runtime/Connection/PendingClient.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
namespace Unity.Multiplayer.Netcode.Connection
1+
namespace Unity.Multiplayer.Netcode
22
{
33
/// <summary>
44
/// A class representing a client that is currently in the process of connecting

com.unity.multiplayer.mlapi/Runtime/Core/NetworkBehaviour.cs

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,6 @@
44
using System.Reflection;
55
using System.Linq;
66
using System.IO;
7-
using Unity.Multiplayer.Netcode.Logging;
8-
using Unity.Multiplayer.Netcode.Messaging;
9-
using Unity.Multiplayer.Netcode.NetworkVariable;
10-
using Unity.Multiplayer.Netcode.Profiling;
11-
using Unity.Multiplayer.Netcode.Reflection;
12-
using Unity.Multiplayer.Netcode.Serialization;
13-
using Unity.Multiplayer.Netcode.Serialization.Pooled;
14-
using Unity.Multiplayer.Netcode.Transports;
157

168
namespace Unity.Multiplayer.Netcode
179
{
@@ -633,7 +625,7 @@ internal static void HandleNetworkVariableDeltas(List<INetworkVariable> networkV
633625
{
634626
if (NetworkLog.CurrentLogLevel <= LogLevel.Normal)
635627
{
636-
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)}");
628+
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)}");
637629
NetworkLog.LogError($"[{networkVariableList[i].GetType().Name}]");
638630
}
639631

@@ -651,7 +643,7 @@ internal static void HandleNetworkVariableDeltas(List<INetworkVariable> networkV
651643

652644
if (NetworkLog.CurrentLogLevel <= LogLevel.Error)
653645
{
654-
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)}");
646+
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)}");
655647
NetworkLog.LogError($"[{networkVariableList[i].GetType().Name}]");
656648
}
657649

@@ -723,7 +715,7 @@ internal static void HandleNetworkVariableUpdate(List<INetworkVariable> networkV
723715
{
724716
if (NetworkLog.CurrentLogLevel <= LogLevel.Normal)
725717
{
726-
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)}");
718+
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)}");
727719
}
728720

729721
stream.Position += varSize;
@@ -739,7 +731,7 @@ internal static void HandleNetworkVariableUpdate(List<INetworkVariable> networkV
739731
// - TwoTen
740732
if (NetworkLog.CurrentLogLevel <= LogLevel.Error)
741733
{
742-
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)}");
734+
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)}");
743735
}
744736

745737
return;

com.unity.multiplayer.mlapi/Runtime/Core/NetworkManager.cs

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,6 @@
33
using System.Collections.Generic;
44
using System.Linq;
55
using UnityEngine;
6-
using Unity.Multiplayer.Netcode.Logging;
7-
using Unity.Multiplayer.Netcode.Configuration;
8-
using Unity.Multiplayer.Netcode.Profiling;
9-
using Unity.Multiplayer.Netcode.Serialization;
10-
using Unity.Multiplayer.Netcode.Transports;
11-
using Unity.Multiplayer.Netcode.Connection;
12-
using Unity.Multiplayer.Netcode.Messaging;
13-
using Unity.Multiplayer.Netcode.SceneManagement;
14-
using Unity.Multiplayer.Netcode.Spawning;
15-
using Unity.Multiplayer.Netcode.Exceptions;
16-
using Unity.Multiplayer.Netcode.Serialization.Pooled;
17-
using Unity.Multiplayer.Netcode.Transports.Tasks;
18-
using Unity.Multiplayer.Netcode.Timing;
196
using Unity.Profiling;
207
using Debug = UnityEngine.Debug;
218

com.unity.multiplayer.mlapi/Runtime/Core/NetworkObject.cs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,6 @@
33
using System.IO;
44
using System.Linq;
55
using System.Runtime.CompilerServices;
6-
using Unity.Multiplayer.Netcode.Exceptions;
7-
using Unity.Multiplayer.Netcode.Hashing;
8-
using Unity.Multiplayer.Netcode.Logging;
9-
using Unity.Multiplayer.Netcode.Messaging;
10-
using Unity.Multiplayer.Netcode.Transports;
11-
using Unity.Multiplayer.Netcode.Serialization;
126
using UnityEngine;
137

148
namespace Unity.Multiplayer.Netcode

com.unity.multiplayer.mlapi/Runtime/Core/SnapshotSystem.cs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,6 @@
11
using System;
22
using System.Collections.Generic;
33
using System.IO;
4-
using Unity.Multiplayer.Netcode.Messaging;
5-
using Unity.Multiplayer.Netcode.NetworkVariable;
6-
using Unity.Multiplayer.Netcode.Serialization;
7-
using Unity.Multiplayer.Netcode.Serialization.Pooled;
8-
using Unity.Multiplayer.Netcode.Timing;
9-
using Unity.Multiplayer.Netcode.Transports;
104
using UnityEngine;
115

126
namespace Unity.Multiplayer.Netcode

com.unity.multiplayer.mlapi/Runtime/Exceptions/InvalidParentException.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
using System;
22

3-
namespace Unity.Multiplayer.Netcode.Exceptions
3+
namespace Unity.Multiplayer.Netcode
44
{
55
/// <summary>
66
/// Exception thrown when the new parent candidate of the NetworkObject is not valid

com.unity.multiplayer.mlapi/Runtime/Exceptions/NetworkConfigurationException.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
using System;
22

3-
namespace Unity.Multiplayer.Netcode.Exceptions
3+
namespace Unity.Multiplayer.Netcode
44
{
55
/// <summary>
66
/// Exception thrown when the operation can only be done on the server

com.unity.multiplayer.mlapi/Runtime/Exceptions/NotListeningException.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
using System;
22

3-
namespace Unity.Multiplayer.Netcode.Exceptions
3+
namespace Unity.Multiplayer.Netcode
44
{
55
/// <summary>
66
/// Exception thrown when the operation require NetworkManager to be listening.

com.unity.multiplayer.mlapi/Runtime/Exceptions/NotServerException.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
using System;
22

3-
namespace Unity.Multiplayer.Netcode.Exceptions
3+
namespace Unity.Multiplayer.Netcode
44
{
55
/// <summary>
66
/// Exception thrown when the operation can only be done on the server

com.unity.multiplayer.mlapi/Runtime/Exceptions/SpawnStateException.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
using System;
22

3-
namespace Unity.Multiplayer.Netcode.Exceptions
3+
namespace Unity.Multiplayer.Netcode
44
{
55
/// <summary>
66
/// Exception thrown when an object is not yet spawned

com.unity.multiplayer.mlapi/Runtime/Exceptions/VisibilityChangeException.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
using System;
22

3-
namespace Unity.Multiplayer.Netcode.Exceptions
3+
namespace Unity.Multiplayer.Netcode
44
{
55
/// <summary>
66
/// Exception thrown when a visibility change fails

com.unity.multiplayer.mlapi/Runtime/Hashing/XXHash/XXHash.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
using System.Text;
99
using System.Runtime.CompilerServices;
1010

11-
namespace Unity.Multiplayer.Netcode.Hashing
11+
namespace Unity.Multiplayer.Netcode
1212
{
1313
/// <summary>
1414
/// XXHash implementation.

0 commit comments

Comments
 (0)