From eb4c894f2189ec6903dd4d81f9d5ca20be0b99eb Mon Sep 17 00:00:00 2001 From: "M. Fatih MAR" Date: Wed, 4 Aug 2021 23:34:09 +0100 Subject: [PATCH] chore: replace MLAPI with Netcode in C# source files --- .../Editor/CodeGen/RuntimeAccessModifiersILPP.cs | 4 ++-- .../Editor/NetcodeProfilerModule.cs | 13 +++++++------ .../Editor/NetworkManagerEditor.cs | 2 +- .../Prototyping/NetworkAnimator.cs | 2 +- .../Prototyping/NetworkNavMeshAgent.cs | 2 +- .../Prototyping/NetworkTransform.cs | 2 +- .../Runtime/Configuration/NetworkConfig.cs | 8 ++++---- .../Runtime/Configuration/NetworkConstants.cs | 2 +- .../Runtime/Core/NetworkManager.cs | 6 +++--- .../Runtime/Core/NetworkObject.cs | 10 +++++----- .../Runtime/Core/SnapshotSystem.cs | 2 +- .../Runtime/Logging/NetworkLog.cs | 14 +++++++------- .../Runtime/SceneManagement/NetworkSceneManager.cs | 2 +- .../Runtime/Serialization/SerializationManager.cs | 2 +- .../Transports/MultiplexTransportAdapter.cs | 2 +- .../Transports/Tests/Editor/TransportTest.cs | 4 ++-- .../Runtime/Transports/TransportChannel.cs | 2 +- .../Runtime/Transports/UNET/RelayTransport.cs | 2 +- .../Runtime/Transports/UNET/UNetChannel.cs | 2 +- .../Runtime/Transports/UNET/UNetTransport.cs | 4 ++-- .../NetworkManagerCustomMessageManagerTests.cs | 2 +- .../Editor/NetworkManagerMessageHandlerTests.cs | 2 +- .../Editor/NetworkManagerSceneManagerTests.cs | 2 +- .../Tests/Editor/NetworkObjectTests.cs | 10 +++++----- .../Tests/Runtime/Helpers/NetworkManagerHelper.cs | 4 ++-- .../Tests/Runtime/RpcQueueTests.cs | 2 +- .../Tests/Runtime/Transport/SIPTransport.cs | 6 +++--- testproject/Assets/Scripts/CommandLineHandler.cs | 12 ++++++------ testproject/Assets/Scripts/ConnectionModeScript.cs | 6 +++--- .../Assets/Scripts/MenuManagement/MenuReference.cs | 8 ++++---- .../Scripts/MenuManagement/SceneReference.cs | 6 +++--- testproject/Assets/Scripts/SyncTransform.cs | 2 +- .../Manual/HybridScripts/RpcQueueManualTests.cs | 2 +- .../Assets/Tests/Manual/Scripts/BandwidthTest.cs | 2 +- .../Scripts/NetworkSceneManagerCallbackTests.cs | 2 +- .../Helpers/BuildMultiprocessTestPlayer.cs | 2 +- .../Runtime/MultiprocessRuntime/TestCoordinator.cs | 4 ++-- 37 files changed, 81 insertions(+), 80 deletions(-) diff --git a/com.unity.multiplayer.mlapi/Editor/CodeGen/RuntimeAccessModifiersILPP.cs b/com.unity.multiplayer.mlapi/Editor/CodeGen/RuntimeAccessModifiersILPP.cs index 4a1b86f51a..8281fa8c18 100644 --- a/com.unity.multiplayer.mlapi/Editor/CodeGen/RuntimeAccessModifiersILPP.cs +++ b/com.unity.multiplayer.mlapi/Editor/CodeGen/RuntimeAccessModifiersILPP.cs @@ -29,7 +29,7 @@ public override ILPostProcessResult Process(ICompiledAssembly compiledAssembly) var assemblyDefinition = CodeGenHelpers.AssemblyDefinitionFor(compiledAssembly); if (assemblyDefinition == null) { - m_Diagnostics.AddError($"Cannot read MLAPI Runtime assembly definition: {compiledAssembly.Name}"); + m_Diagnostics.AddError($"Cannot read Netcode Runtime assembly definition: {compiledAssembly.Name}"); return null; } @@ -60,7 +60,7 @@ public override ILPostProcessResult Process(ICompiledAssembly compiledAssembly) } else { - m_Diagnostics.AddError($"Cannot get main module from MLAPI Runtime assembly definition: {compiledAssembly.Name}"); + m_Diagnostics.AddError($"Cannot get main module from Netcode Runtime assembly definition: {compiledAssembly.Name}"); } // write diff --git a/com.unity.multiplayer.mlapi/Editor/NetcodeProfilerModule.cs b/com.unity.multiplayer.mlapi/Editor/NetcodeProfilerModule.cs index 98c35eff62..953236656c 100644 --- a/com.unity.multiplayer.mlapi/Editor/NetcodeProfilerModule.cs +++ b/com.unity.multiplayer.mlapi/Editor/NetcodeProfilerModule.cs @@ -10,9 +10,9 @@ namespace Unity.Netcode.Editor internal static class NetcodeProfilerModule { #if UNITY_2020_2_OR_NEWER && ENABLE_PROFILER - private const string k_RpcModuleName = "MLAPI RPCs"; - private const string k_OperationModuleName = "MLAPI Operations"; - private const string k_MessageModuleName = "MLAPI Messages"; + private const string k_RpcModuleName = "Netcode RPCs"; + private const string k_OperationModuleName = "Netcode Operations"; + private const string k_MessageModuleName = "Netcode Messages"; #pragma warning disable IDE1006 // disable naming rule violation check /// @@ -75,9 +75,9 @@ private class NetcodeModules private delegate List CounterListFactoryDelegate(); - private static bool CreateNetcodeDynamicModule(ref NetcodeModules mlapiModules, string moduleName, CounterListFactoryDelegate counterListFactoryDelegate) + private static bool CreateNetcodeDynamicModule(ref NetcodeModules netcodeModules, string moduleName, CounterListFactoryDelegate counterListFactoryDelegate) { - var module = mlapiModules.m_Modules.Find(x => x.m_Name == moduleName); + var module = netcodeModules.m_Modules.Find(x => x.m_Name == moduleName); if (module == null) { var newModule = new NetcodeProfilerModuleData @@ -86,7 +86,8 @@ private static bool CreateNetcodeDynamicModule(ref NetcodeModules mlapiModules, m_ChartCounters = counterListFactoryDelegate(), m_DetailCounters = counterListFactoryDelegate(), }; - mlapiModules.m_Modules.Add(newModule); + netcodeModules.m_Modules.Add(newModule); + return true; } diff --git a/com.unity.multiplayer.mlapi/Editor/NetworkManagerEditor.cs b/com.unity.multiplayer.mlapi/Editor/NetworkManagerEditor.cs index ec21badf76..c337feb5b0 100644 --- a/com.unity.multiplayer.mlapi/Editor/NetworkManagerEditor.cs +++ b/com.unity.multiplayer.mlapi/Editor/NetworkManagerEditor.cs @@ -260,7 +260,7 @@ public override void OnInspectorGUI() if (m_NetworkTransportProperty.objectReferenceValue == null) { - EditorGUILayout.HelpBox("You have no transport selected. A transport is required for the MLAPI to work. Which one do you want?", MessageType.Warning); + EditorGUILayout.HelpBox("You have no transport selected. A transport is required for netcode to work. Which one do you want?", MessageType.Warning); int selection = EditorGUILayout.Popup(0, m_TransportNames); diff --git a/com.unity.multiplayer.mlapi/Prototyping/NetworkAnimator.cs b/com.unity.multiplayer.mlapi/Prototyping/NetworkAnimator.cs index 5a3df308df..a13bb2d201 100644 --- a/com.unity.multiplayer.mlapi/Prototyping/NetworkAnimator.cs +++ b/com.unity.multiplayer.mlapi/Prototyping/NetworkAnimator.cs @@ -7,7 +7,7 @@ namespace Unity.Netcode.Prototyping /// /// A prototype component for syncing animations /// - [AddComponentMenu("MLAPI/NetworkAnimator")] + [AddComponentMenu("Netcode/" + nameof(NetworkAnimator))] public class NetworkAnimator : NetworkBehaviour { diff --git a/com.unity.multiplayer.mlapi/Prototyping/NetworkNavMeshAgent.cs b/com.unity.multiplayer.mlapi/Prototyping/NetworkNavMeshAgent.cs index 930234a57a..6163f4a965 100644 --- a/com.unity.multiplayer.mlapi/Prototyping/NetworkNavMeshAgent.cs +++ b/com.unity.multiplayer.mlapi/Prototyping/NetworkNavMeshAgent.cs @@ -7,7 +7,7 @@ namespace Unity.Netcode.Prototyping /// /// A prototype component for syncing NavMeshAgents /// - [AddComponentMenu("MLAPI/NetworkNavMeshAgent")] + [AddComponentMenu("Netcode/" + nameof(NetworkNavMeshAgent))] [RequireComponent(typeof(NavMeshAgent))] public class NetworkNavMeshAgent : NetworkBehaviour { diff --git a/com.unity.multiplayer.mlapi/Prototyping/NetworkTransform.cs b/com.unity.multiplayer.mlapi/Prototyping/NetworkTransform.cs index a6b8a72a09..38300cf668 100644 --- a/com.unity.multiplayer.mlapi/Prototyping/NetworkTransform.cs +++ b/com.unity.multiplayer.mlapi/Prototyping/NetworkTransform.cs @@ -6,7 +6,7 @@ namespace Unity.Netcode.Prototyping /// /// A prototype component for syncing transforms /// - [AddComponentMenu("MLAPI/NetworkTransform")] + [AddComponentMenu("Netcode/" + nameof(NetworkTransform))] public class NetworkTransform : NetworkBehaviour { /// diff --git a/com.unity.multiplayer.mlapi/Runtime/Configuration/NetworkConfig.cs b/com.unity.multiplayer.mlapi/Runtime/Configuration/NetworkConfig.cs index 57d3af533b..a16d8963f4 100644 --- a/com.unity.multiplayer.mlapi/Runtime/Configuration/NetworkConfig.cs +++ b/com.unity.multiplayer.mlapi/Runtime/Configuration/NetworkConfig.cs @@ -60,9 +60,9 @@ public class NetworkConfig /// - /// The tickrate of network ticks. This value controls how often MLAPI runs user code and sends out data. + /// The tickrate of network ticks. This value controls how often netcode runs user code and sends out data. /// - [Tooltip("The tickrate. This value controls how often MLAPI runs user code and sends out data. The value is in 'ticks per seconds' which means a value of 50 will result in 50 ticks being executed per second or a fixed delta time of 0.02.")] + [Tooltip("The tickrate. This value controls how often netcode runs user code and sends out data. The value is in 'ticks per seconds' which means a value of 50 will result in 50 ticks being executed per second or a fixed delta time of 0.02.")] public int TickRate = 30; /// @@ -117,10 +117,10 @@ public class NetworkConfig public bool EnableSceneManagement = true; /// - /// Whether or not the MLAPI should check for differences in the prefabs at connection. + /// Whether or not the netcode should check for differences in the prefabs at connection. /// If you dynamically add prefabs at runtime, turn this OFF /// - [Tooltip("Whether or not the MLAPI should check for differences in the prefab lists at connection")] + [Tooltip("Whether or not the netcode should check for differences in the prefab lists at connection")] public bool ForceSamePrefabs = true; /// diff --git a/com.unity.multiplayer.mlapi/Runtime/Configuration/NetworkConstants.cs b/com.unity.multiplayer.mlapi/Runtime/Configuration/NetworkConstants.cs index 2ef032e7cd..55facaf746 100644 --- a/com.unity.multiplayer.mlapi/Runtime/Configuration/NetworkConstants.cs +++ b/com.unity.multiplayer.mlapi/Runtime/Configuration/NetworkConstants.cs @@ -1,7 +1,7 @@ namespace Unity.Netcode { /// - /// A static class containing MLAPI constants + /// A static class containing network constants /// internal static class NetworkConstants { diff --git a/com.unity.multiplayer.mlapi/Runtime/Core/NetworkManager.cs b/com.unity.multiplayer.mlapi/Runtime/Core/NetworkManager.cs index 3a253bfa14..bcc8e9b9b2 100644 --- a/com.unity.multiplayer.mlapi/Runtime/Core/NetworkManager.cs +++ b/com.unity.multiplayer.mlapi/Runtime/Core/NetworkManager.cs @@ -11,7 +11,7 @@ namespace Unity.Netcode /// /// The main component of the library /// - [AddComponentMenu("MLAPI/NetworkManager", -100)] + [AddComponentMenu("Netcode/" + nameof(NetworkManager), -100)] public class NetworkManager : MonoBehaviour, INetworkUpdateSystem, IProfilableTransportProvider { #pragma warning disable IDE1006 // disable naming rule violation check @@ -273,7 +273,7 @@ private void OnValidate() { if (NetworkLog.CurrentLogLevel <= LogLevel.Normal) { - NetworkLog.LogWarning("Active scene is not registered as a network scene. The MLAPI has added it"); + NetworkLog.LogWarning("Active scene is not registered as a network scene. Netcode has added it"); } NetworkConfig.RegisteredScenes.Add(activeSceneName); @@ -725,7 +725,7 @@ public void StopHost() IsClient = false; StopServer(); - //We don't stop client since we dont actually have a transport connection to our own host. We just handle host messages directly in the MLAPI + //We don't stop client since we dont actually have a transport connection to our own host. We just handle host messages directly in the netcode } /// diff --git a/com.unity.multiplayer.mlapi/Runtime/Core/NetworkObject.cs b/com.unity.multiplayer.mlapi/Runtime/Core/NetworkObject.cs index 661e350d48..fd4f6d533f 100644 --- a/com.unity.multiplayer.mlapi/Runtime/Core/NetworkObject.cs +++ b/com.unity.multiplayer.mlapi/Runtime/Core/NetworkObject.cs @@ -10,7 +10,7 @@ namespace Unity.Netcode /// /// A component used to identify that a GameObject in the network /// - [AddComponentMenu("MLAPI/NetworkObject", -99)] + [AddComponentMenu("Netcode/" + nameof(NetworkObject), -99)] [DisallowMultipleComponent] public sealed class NetworkObject : MonoBehaviour { @@ -151,7 +151,7 @@ internal set public delegate bool VisibilityDelegate(ulong clientId); /// - /// Delegate invoked when the MLAPI needs to know if the object should be visible to a client, if null it will assume true + /// Delegate invoked when the netcode needs to know if the object should be visible to a client, if null it will assume true /// public VisibilityDelegate CheckObjectVisibility = null; @@ -162,7 +162,7 @@ internal set public delegate bool SpawnDelegate(ulong clientId); /// - /// Delegate invoked when the MLAPI needs to know if it should include the transform when spawning the object, if null it will assume true + /// Delegate invoked when the netcode needs to know if it should include the transform when spawning the object, if null it will assume true /// public SpawnDelegate IncludeTransformWhenSpawning = null; @@ -259,7 +259,7 @@ public static void NetworkShow(List networkObjects, ulong clientI } - // Do the safety loop first to prevent putting the MLAPI in an invalid state. + // Do the safety loop first to prevent putting the netcode in an invalid state. for (int i = 0; i < networkObjects.Count; i++) { if (!networkObjects[i].IsSpawned) @@ -366,7 +366,7 @@ public static void NetworkHide(List networkObjects, ulong clientI throw new VisibilityChangeException("Cannot hide an object from the server"); } - // Do the safety loop first to prevent putting the MLAPI in an invalid state. + // Do the safety loop first to prevent putting the netcode in an invalid state. for (int i = 0; i < networkObjects.Count; i++) { if (!networkObjects[i].IsSpawned) diff --git a/com.unity.multiplayer.mlapi/Runtime/Core/SnapshotSystem.cs b/com.unity.multiplayer.mlapi/Runtime/Core/SnapshotSystem.cs index f99186cba9..0050ff3f55 100644 --- a/com.unity.multiplayer.mlapi/Runtime/Core/SnapshotSystem.cs +++ b/com.unity.multiplayer.mlapi/Runtime/Core/SnapshotSystem.cs @@ -407,7 +407,7 @@ private void WriteBuffer(NetworkBuffer buffer) // todo: consider using a Key, instead of 3 ints, if it can be exposed /// - /// Called by the rest of MLAPI when a NetworkVariable changed and need to go in our snapshot + /// Called by the rest of the netcode when a NetworkVariable changed and need to go in our snapshot /// Might not happen for all variable on every frame. Might even happen more than once. /// /// The NetworkVariable to write, or rather, its INetworkVariable diff --git a/com.unity.multiplayer.mlapi/Runtime/Logging/NetworkLog.cs b/com.unity.multiplayer.mlapi/Runtime/Logging/NetworkLog.cs index f07af19f91..008a1ff6ed 100644 --- a/com.unity.multiplayer.mlapi/Runtime/Logging/NetworkLog.cs +++ b/com.unity.multiplayer.mlapi/Runtime/Logging/NetworkLog.cs @@ -13,10 +13,10 @@ public static class NetworkLog /// The current log level. internal static LogLevel CurrentLogLevel => NetworkManager.Singleton == null ? LogLevel.Normal : NetworkManager.Singleton.LogLevel; - // MLAPI internal logging - internal static void LogInfo(string message) => Debug.Log($"[MLAPI] {message}"); - internal static void LogWarning(string message) => Debug.LogWarning($"[MLAPI] {message}"); - internal static void LogError(string message) => Debug.LogError($"[MLAPI] {message}"); + // internal logging + internal static void LogInfo(string message) => Debug.Log($"[Netcode] {message}"); + internal static void LogWarning(string message) => Debug.LogWarning($"[Netcode] {message}"); + internal static void LogError(string message) => Debug.LogError($"[Netcode] {message}"); /// /// Logs an info log locally and on the server if possible. @@ -70,9 +70,9 @@ private static void LogServer(string message, LogType logType) } } - internal static void LogInfoServerLocal(string message, ulong sender) => Debug.Log($"[MLAPI_SERVER Sender={sender}] {message}"); - internal static void LogWarningServerLocal(string message, ulong sender) => Debug.LogWarning($"[MLAPI_SERVER Sender={sender}] {message}"); - internal static void LogErrorServerLocal(string message, ulong sender) => Debug.LogError($"[MLAPI_SERVER Sender={sender}] {message}"); + internal static void LogInfoServerLocal(string message, ulong sender) => Debug.Log($"[Netcode-Server Sender={sender}] {message}"); + internal static void LogWarningServerLocal(string message, ulong sender) => Debug.LogWarning($"[Netcode-Server Sender={sender}] {message}"); + internal static void LogErrorServerLocal(string message, ulong sender) => Debug.LogError($"[Netcode-Server Sender={sender}] {message}"); internal enum LogType { diff --git a/com.unity.multiplayer.mlapi/Runtime/SceneManagement/NetworkSceneManager.cs b/com.unity.multiplayer.mlapi/Runtime/SceneManagement/NetworkSceneManager.cs index a2c98842fd..c96e2b8f22 100644 --- a/com.unity.multiplayer.mlapi/Runtime/SceneManagement/NetworkSceneManager.cs +++ b/com.unity.multiplayer.mlapi/Runtime/SceneManagement/NetworkSceneManager.cs @@ -335,7 +335,7 @@ private void OnSceneLoaded(Guid switchSceneGuid, Stream objectStream) private void OnServerLoadedScene(Guid switchSceneGuid) { - // Register in-scene placed NetworkObjects with MLAPI + // Register in-scene placed NetworkObjects with the netcode foreach (var keyValuePair in ScenePlacedObjects) { if (!keyValuePair.Value.IsPlayerObject) diff --git a/com.unity.multiplayer.mlapi/Runtime/Serialization/SerializationManager.cs b/com.unity.multiplayer.mlapi/Runtime/Serialization/SerializationManager.cs index 031d12a5dc..4d0614b04d 100644 --- a/com.unity.multiplayer.mlapi/Runtime/Serialization/SerializationManager.cs +++ b/com.unity.multiplayer.mlapi/Runtime/Serialization/SerializationManager.cs @@ -8,7 +8,7 @@ namespace Unity.Netcode { /// - /// Helper class to manage the MLAPI serialization. + /// Helper class to manage the netcode serialization /// public static class SerializationManager { diff --git a/com.unity.multiplayer.mlapi/Runtime/Transports/MultiplexTransportAdapter.cs b/com.unity.multiplayer.mlapi/Runtime/Transports/MultiplexTransportAdapter.cs index 1cc4309776..ecf660b8ac 100644 --- a/com.unity.multiplayer.mlapi/Runtime/Transports/MultiplexTransportAdapter.cs +++ b/com.unity.multiplayer.mlapi/Runtime/Transports/MultiplexTransportAdapter.cs @@ -29,7 +29,7 @@ public enum ConnectionIdSpreadMethod /// /// Drops the last few bits (right side) and replaces them with the transport index. /// Ensure that ALL transports dont use the last bits in their produced clientId. - /// This option is for advanced users and will not work with the official MLAPI transports as they use the last bits. + /// This option is for advanced users and will not work with the official netcode transports as they use the last bits. /// ReplaceLastBits, 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 efa0085e37..c9d5b73600 100644 --- a/com.unity.multiplayer.mlapi/Runtime/Transports/Tests/Editor/TransportTest.cs +++ b/com.unity.multiplayer.mlapi/Runtime/Transports/Tests/Editor/TransportTest.cs @@ -51,13 +51,13 @@ public void UNetCustomChannelRegistrationTest() nm.Shutdown(); ut.Channels.Clear(); - // test 2: add a bogus channel (one that intersects with the MLAPI built-in ones.) Expect failure + // test 2: add a bogus channel (one that intersects with the netcode built-in ones.) Expect failure ut.Channels.Add(new UNetChannel { Id = (byte)NetworkChannel.Internal, Type = QosType.Unreliable }); try { nm.StartServer(); - Assert.Fail("The UNet transport allowed registration of an MLAPI-reserved channel"); + Assert.Fail("The UNet transport allowed registration of an netcode-reserved channel"); } catch (Exception ex) { diff --git a/com.unity.multiplayer.mlapi/Runtime/Transports/TransportChannel.cs b/com.unity.multiplayer.mlapi/Runtime/Transports/TransportChannel.cs index c9cb65c07b..af35804a93 100644 --- a/com.unity.multiplayer.mlapi/Runtime/Transports/TransportChannel.cs +++ b/com.unity.multiplayer.mlapi/Runtime/Transports/TransportChannel.cs @@ -3,7 +3,7 @@ namespace Unity.Netcode { /// - /// A transport channel used by the MLAPI + /// A transport channel used by the netcode /// [Serializable] public struct TransportChannel diff --git a/com.unity.multiplayer.mlapi/Runtime/Transports/UNET/RelayTransport.cs b/com.unity.multiplayer.mlapi/Runtime/Transports/UNET/RelayTransport.cs index 02318b8400..c5edda9267 100644 --- a/com.unity.multiplayer.mlapi/Runtime/Transports/UNET/RelayTransport.cs +++ b/com.unity.multiplayer.mlapi/Runtime/Transports/UNET/RelayTransport.cs @@ -519,7 +519,7 @@ private static NetworkEventType BaseReceive(NetworkEventType netEvent, int hostI { if ((NetworkError)error == NetworkError.CRCMismatch) { - Debug.LogError("[Netcode.Relay] The MLAPI Relay detected a CRC mismatch. This could be due to the maxClients or other connectionConfig settings not being the same"); + Debug.LogError("[Netcode.Relay] Relay detected a CRC mismatch. This could be due to the maxClients or other connectionConfig settings not being the same"); } return NetworkEventType.DisconnectEvent; diff --git a/com.unity.multiplayer.mlapi/Runtime/Transports/UNET/UNetChannel.cs b/com.unity.multiplayer.mlapi/Runtime/Transports/UNET/UNetChannel.cs index a2d0a7f0f5..1e1afc0065 100644 --- a/com.unity.multiplayer.mlapi/Runtime/Transports/UNET/UNetChannel.cs +++ b/com.unity.multiplayer.mlapi/Runtime/Transports/UNET/UNetChannel.cs @@ -8,7 +8,7 @@ namespace Unity.Netcode.Transports.UNET { /// - /// A transport channel used by the MLAPI + /// A transport channel used by the netcode /// [Serializable] public class UNetChannel diff --git a/com.unity.multiplayer.mlapi/Runtime/Transports/UNET/UNetTransport.cs b/com.unity.multiplayer.mlapi/Runtime/Transports/UNET/UNetTransport.cs index e7148d119d..ece8aa1149 100644 --- a/com.unity.multiplayer.mlapi/Runtime/Transports/UNET/UNetTransport.cs +++ b/com.unity.multiplayer.mlapi/Runtime/Transports/UNET/UNetTransport.cs @@ -35,7 +35,7 @@ public enum SendMode // transport.Channels.Add( // new UNetChannel() // { - // Id = Channel.ChannelUnused + MY_CHANNEL, <<-- must offset from reserved channel offset in MLAPI SDK + // Id = Channel.ChannelUnused + MY_CHANNEL, <<-- must offset from reserved channel offset in netcode SDK // Type = QosType.Unreliable // } // ); @@ -395,7 +395,7 @@ public ConnectionConfig GetConfig() { var connectionConfig = new ConnectionConfig(); - // MLAPI built-in channels + // Built-in netcode channels for (int i = 0; i < NETCODE_CHANNELS.Length; i++) { int channelId = AddNetcodeChannel(NETCODE_CHANNELS[i].Delivery, connectionConfig); diff --git a/com.unity.multiplayer.mlapi/Tests/Editor/NetworkManagerCustomMessageManagerTests.cs b/com.unity.multiplayer.mlapi/Tests/Editor/NetworkManagerCustomMessageManagerTests.cs index 2593688ef8..2da24c6d38 100644 --- a/com.unity.multiplayer.mlapi/Tests/Editor/NetworkManagerCustomMessageManagerTests.cs +++ b/com.unity.multiplayer.mlapi/Tests/Editor/NetworkManagerCustomMessageManagerTests.cs @@ -14,7 +14,7 @@ public void CustomMessageManagerAssigned() var networkManager = gameObject.AddComponent(); var transport = gameObject.AddComponent(); - // MLAPI sets this in validate + // Netcode sets this in validate networkManager.NetworkConfig = new NetworkConfig() { // Set the current scene to prevent unexpected log messages which would trigger a failure diff --git a/com.unity.multiplayer.mlapi/Tests/Editor/NetworkManagerMessageHandlerTests.cs b/com.unity.multiplayer.mlapi/Tests/Editor/NetworkManagerMessageHandlerTests.cs index 34150595dc..0aafc0754a 100644 --- a/com.unity.multiplayer.mlapi/Tests/Editor/NetworkManagerMessageHandlerTests.cs +++ b/com.unity.multiplayer.mlapi/Tests/Editor/NetworkManagerMessageHandlerTests.cs @@ -19,7 +19,7 @@ public void MessageHandlerReceivedMessageServerClient() var networkManager = gameObject.AddComponent(); var transport = gameObject.AddComponent(); - // MLAPI sets this in validate + // Netcode sets this in validate networkManager.NetworkConfig = new NetworkConfig() { // Set the current scene to prevent unexpected log messages which would trigger a failure diff --git a/com.unity.multiplayer.mlapi/Tests/Editor/NetworkManagerSceneManagerTests.cs b/com.unity.multiplayer.mlapi/Tests/Editor/NetworkManagerSceneManagerTests.cs index 45daa164bb..c641b2f4b1 100644 --- a/com.unity.multiplayer.mlapi/Tests/Editor/NetworkManagerSceneManagerTests.cs +++ b/com.unity.multiplayer.mlapi/Tests/Editor/NetworkManagerSceneManagerTests.cs @@ -14,7 +14,7 @@ public void SceneManagerAssigned() var networkManager = gameObject.AddComponent(); var transport = gameObject.AddComponent(); - // MLAPI sets this in validate + // Netcode sets this in validate networkManager.NetworkConfig = new NetworkConfig() { // Set the current scene to prevent unexpected log messages which would trigger a failure diff --git a/com.unity.multiplayer.mlapi/Tests/Editor/NetworkObjectTests.cs b/com.unity.multiplayer.mlapi/Tests/Editor/NetworkObjectTests.cs index 186da8377c..d887dcf75b 100644 --- a/com.unity.multiplayer.mlapi/Tests/Editor/NetworkObjectTests.cs +++ b/com.unity.multiplayer.mlapi/Tests/Editor/NetworkObjectTests.cs @@ -37,9 +37,9 @@ public void GetBehaviourIndexNone() var networkObject = gameObject.AddComponent(); // TODO: Maybe not hardcode message? - LogAssert.Expect(LogType.Error, $"[MLAPI] Behaviour index was out of bounds. Did you mess up the order of your {nameof(NetworkBehaviour)}s?"); - LogAssert.Expect(LogType.Error, $"[MLAPI] Behaviour index was out of bounds. Did you mess up the order of your {nameof(NetworkBehaviour)}s?"); - LogAssert.Expect(LogType.Error, $"[MLAPI] Behaviour index was out of bounds. Did you mess up the order of your {nameof(NetworkBehaviour)}s?"); + LogAssert.Expect(LogType.Error, $"[Netcode] Behaviour index was out of bounds. Did you mess up the order of your {nameof(NetworkBehaviour)}s?"); + LogAssert.Expect(LogType.Error, $"[Netcode] Behaviour index was out of bounds. Did you mess up the order of your {nameof(NetworkBehaviour)}s?"); + LogAssert.Expect(LogType.Error, $"[Netcode] Behaviour index was out of bounds. Did you mess up the order of your {nameof(NetworkBehaviour)}s?"); Assert.That(networkObject.GetNetworkBehaviourAtOrderIndex(0), Is.Null); Assert.That(networkObject.GetNetworkBehaviourAtOrderIndex(1), Is.Null); @@ -57,8 +57,8 @@ public void GetBehaviourIndexOne() var networkBehaviour = gameObject.AddComponent(); // TODO: Maybe not hardcode message? - LogAssert.Expect(LogType.Error, $"[MLAPI] Behaviour index was out of bounds. Did you mess up the order of your {nameof(NetworkBehaviour)}s?"); - LogAssert.Expect(LogType.Error, $"[MLAPI] Behaviour index was out of bounds. Did you mess up the order of your {nameof(NetworkBehaviour)}s?"); + LogAssert.Expect(LogType.Error, $"[Netcode] Behaviour index was out of bounds. Did you mess up the order of your {nameof(NetworkBehaviour)}s?"); + LogAssert.Expect(LogType.Error, $"[Netcode] Behaviour index was out of bounds. Did you mess up the order of your {nameof(NetworkBehaviour)}s?"); Assert.That(networkObject.GetNetworkBehaviourAtOrderIndex(0), Is.EqualTo(networkBehaviour)); Assert.That(networkObject.GetNetworkBehaviourAtOrderIndex(1), Is.Null); diff --git a/com.unity.multiplayer.mlapi/Tests/Runtime/Helpers/NetworkManagerHelper.cs b/com.unity.multiplayer.mlapi/Tests/Runtime/Helpers/NetworkManagerHelper.cs index 2501a93460..91cbe0a571 100644 --- a/com.unity.multiplayer.mlapi/Tests/Runtime/Helpers/NetworkManagerHelper.cs +++ b/com.unity.multiplayer.mlapi/Tests/Runtime/Helpers/NetworkManagerHelper.cs @@ -185,7 +185,7 @@ private static void StartNetworkManagerMode(NetworkManagerOperatingMode managerM } } - // If we started an MLAPI session + // If we started an netcode session if (CurrentNetworkManagerMode != NetworkManagerOperatingMode.None) { // With some unit tests the Singleton can still be from a previous unit test @@ -195,7 +195,7 @@ private static void StartNetworkManagerMode(NetworkManagerOperatingMode managerM NetworkManagerObject.SetSingleton(); } - // Only log this if we started an MLAPI session + // Only log this if we started an netcode session Debug.Log($"{CurrentNetworkManagerMode} started."); } } diff --git a/com.unity.multiplayer.mlapi/Tests/Runtime/RpcQueueTests.cs b/com.unity.multiplayer.mlapi/Tests/Runtime/RpcQueueTests.cs index 0d1a9b12a3..4cc85f24d1 100644 --- a/com.unity.multiplayer.mlapi/Tests/Runtime/RpcQueueTests.cs +++ b/com.unity.multiplayer.mlapi/Tests/Runtime/RpcQueueTests.cs @@ -24,7 +24,7 @@ public void Setup() /// /// Tests to make sure providing different - /// ** This does not include any of the MLAPI to Transport code ** + /// ** This does not include any of the Netcode to Transport code ** /// /// IEnumerator [UnityTest, Order(1)] diff --git a/com.unity.multiplayer.mlapi/Tests/Runtime/Transport/SIPTransport.cs b/com.unity.multiplayer.mlapi/Tests/Runtime/Transport/SIPTransport.cs index 909a061a89..5381a22fb3 100644 --- a/com.unity.multiplayer.mlapi/Tests/Runtime/Transport/SIPTransport.cs +++ b/com.unity.multiplayer.mlapi/Tests/Runtime/Transport/SIPTransport.cs @@ -7,8 +7,8 @@ namespace Unity.Netcode.RuntimeTests { /// /// 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 + /// is a NetworkTransport designed to be used with multiple network instances in a single process + /// it's designed for the netcode 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] @@ -226,7 +226,7 @@ public override void Send(ulong clientId, ArraySegment data, NetworkChanne { if (m_LocalConnection != null) { - // Create copy since MLAPI wants the byte array back straight after the method call. + // Create copy since netcode 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); diff --git a/testproject/Assets/Scripts/CommandLineHandler.cs b/testproject/Assets/Scripts/CommandLineHandler.cs index 4c5740b642..bf833aa88d 100644 --- a/testproject/Assets/Scripts/CommandLineHandler.cs +++ b/testproject/Assets/Scripts/CommandLineHandler.cs @@ -13,7 +13,7 @@ /// -ip | IP address of the host-server. /// -p | The connection listening port. /// -fr | Set the target frame rate. -/// -m (?)| Start MLAPI in one of 3 modes: client, host, server +/// -m (?)| Start network in one of 3 modes: client, host, server /// public class CommandLineProcessor { @@ -58,9 +58,9 @@ public CommandLineProcessor(string[] args) public bool AutoConnectEnabled() { - if (m_CommandLineArguments.TryGetValue("-m", out string mlapiValue)) + if (m_CommandLineArguments.TryGetValue("-m", out string netcodeValue)) { - switch (mlapiValue) + switch (netcodeValue) { case "server": case "host": @@ -106,9 +106,9 @@ public void ProcessCommandLine() m_CommandLineArguments.Remove("-fr"); } - if (m_CommandLineArguments.TryGetValue("-m", out string mlapiValue)) + if (m_CommandLineArguments.TryGetValue("-m", out string netcodeValue)) { - switch (mlapiValue) + switch (netcodeValue) { case "server": StartServer(); @@ -120,7 +120,7 @@ public void ProcessCommandLine() StartClient(); break; default: - Debug.LogWarning($"Invalid MLAPI argument: {mlapiValue}"); + Debug.LogWarning($"Invalid netcode argument: {netcodeValue}"); break; } } diff --git a/testproject/Assets/Scripts/ConnectionModeScript.cs b/testproject/Assets/Scripts/ConnectionModeScript.cs index 4ab904676b..cb87892cec 100644 --- a/testproject/Assets/Scripts/ConnectionModeScript.cs +++ b/testproject/Assets/Scripts/ConnectionModeScript.cs @@ -57,7 +57,7 @@ private void Start() } /// - /// Handles starting MLAPI in server mode + /// Handles starting netcode in server mode /// public void OnStartServer() { @@ -71,7 +71,7 @@ public void OnStartServer() } /// - /// Handles starting MLAPI in host mode + /// Handles starting netcode in host mode /// public void OnStartHost() { @@ -84,7 +84,7 @@ public void OnStartHost() } /// - /// Handles starting MLAPI in client mode + /// Handles starting netcode in client mode /// public void OnStartClient() { diff --git a/testproject/Assets/Scripts/MenuManagement/MenuReference.cs b/testproject/Assets/Scripts/MenuManagement/MenuReference.cs index 1b9a80d310..81143b7daf 100644 --- a/testproject/Assets/Scripts/MenuManagement/MenuReference.cs +++ b/testproject/Assets/Scripts/MenuManagement/MenuReference.cs @@ -1,14 +1,14 @@ using System.Collections.Generic; using UnityEngine; -#if UNITY_EDITOR +#if UNITY_EDITOR using UnityEditor; #endif -[CreateAssetMenu(fileName = "MenuReference", menuName = "MLAPI/MenuReference")] +[CreateAssetMenu(fileName = nameof(MenuReference), menuName = "Netcode/" + nameof(MenuReference))] public class MenuReference : ScriptableObject, ISceneReference { -#if UNITY_EDITOR +#if UNITY_EDITOR public SceneAsset MenuScene; #endif [SerializeField] @@ -18,7 +18,7 @@ public class MenuReference : ScriptableObject, ISceneReference [SerializeField] private List m_ReferencedScenes; -#if UNITY_EDITOR +#if UNITY_EDITOR private void OnValidate() { if (m_ReferencedScenes == null) diff --git a/testproject/Assets/Scripts/MenuManagement/SceneReference.cs b/testproject/Assets/Scripts/MenuManagement/SceneReference.cs index b509980155..7fed48716f 100644 --- a/testproject/Assets/Scripts/MenuManagement/SceneReference.cs +++ b/testproject/Assets/Scripts/MenuManagement/SceneReference.cs @@ -5,11 +5,11 @@ using UnityEditor; #endif -[CreateAssetMenu(fileName = "SceneReference", menuName = "MLAPI/SceneReference")] +[CreateAssetMenu(fileName = nameof(SceneReference), menuName = "Netcode/" + nameof(SceneReference))] [Serializable] public class SceneReference : ScriptableObject, ISceneReference { -#if UNITY_EDITOR +#if UNITY_EDITOR public SceneAsset SceneToReference; [SerializeField] private List m_IncludedScenes; @@ -21,7 +21,7 @@ public class SceneReference : ScriptableObject, ISceneReference [SerializeField] private List m_ReferencedScenes; -#if UNITY_EDITOR +#if UNITY_EDITOR private void OnValidate() { if (m_ReferencedScenes == null) diff --git a/testproject/Assets/Scripts/SyncTransform.cs b/testproject/Assets/Scripts/SyncTransform.cs index 059b3a9369..9d774757f7 100644 --- a/testproject/Assets/Scripts/SyncTransform.cs +++ b/testproject/Assets/Scripts/SyncTransform.cs @@ -7,7 +7,7 @@ namespace Unity.Netcode /// Initial goal: allow an FPS-style snapshot /// with variables updating at specific place in the frame /// - [AddComponentMenu("MLAPI/SyncTransform")] + [AddComponentMenu("Netcode/" + nameof(SyncTransform))] // todo: check inheriting from NetworkBehaviour. Currently needed for IsOwner, to synchronize position public class SyncTransform : NetworkBehaviour { diff --git a/testproject/Assets/Tests/Manual/HybridScripts/RpcQueueManualTests.cs b/testproject/Assets/Tests/Manual/HybridScripts/RpcQueueManualTests.cs index e587477aae..6fa3a56325 100644 --- a/testproject/Assets/Tests/Manual/HybridScripts/RpcQueueManualTests.cs +++ b/testproject/Assets/Tests/Manual/HybridScripts/RpcQueueManualTests.cs @@ -316,7 +316,7 @@ private void InitializeNetworkManager() } /// - /// Invoked upon the attached NetworkObject component being initialized by MLAPI + /// Invoked upon the attached NetworkObject component being initialized by the netcode /// public override void OnNetworkSpawn() { diff --git a/testproject/Assets/Tests/Manual/Scripts/BandwidthTest.cs b/testproject/Assets/Tests/Manual/Scripts/BandwidthTest.cs index 264414d1e9..17244686f4 100644 --- a/testproject/Assets/Tests/Manual/Scripts/BandwidthTest.cs +++ b/testproject/Assets/Tests/Manual/Scripts/BandwidthTest.cs @@ -6,7 +6,7 @@ namespace TestProject.ManualTests /// /// A prototype component for syncing transforms /// - [AddComponentMenu("MLAPI/BandwidthTest")] + [AddComponentMenu("Netcode/" + nameof(BandwidthTest))] public class BandwidthTest : NetworkBehaviour { private int m_IdCount = 2000; diff --git a/testproject/Assets/Tests/Manual/Scripts/NetworkSceneManagerCallbackTests.cs b/testproject/Assets/Tests/Manual/Scripts/NetworkSceneManagerCallbackTests.cs index a4b04d458e..619d8d804f 100644 --- a/testproject/Assets/Tests/Manual/Scripts/NetworkSceneManagerCallbackTests.cs +++ b/testproject/Assets/Tests/Manual/Scripts/NetworkSceneManagerCallbackTests.cs @@ -3,7 +3,7 @@ namespace TestProject.ManualTests { - [AddComponentMenu("MLAPI/NetworkSceneManagerCallbackTests")] + [AddComponentMenu("Netcode/" + nameof(NetworkSceneManagerCallbackTests))] public class NetworkSceneManagerCallbackTests : NetworkBehaviour { public void StartHost() diff --git a/testproject/Assets/Tests/Runtime/MultiprocessRuntime/Helpers/BuildMultiprocessTestPlayer.cs b/testproject/Assets/Tests/Runtime/MultiprocessRuntime/Helpers/BuildMultiprocessTestPlayer.cs index 8f344061aa..ba104069cb 100644 --- a/testproject/Assets/Tests/Runtime/MultiprocessRuntime/Helpers/BuildMultiprocessTestPlayer.cs +++ b/testproject/Assets/Tests/Runtime/MultiprocessRuntime/Helpers/BuildMultiprocessTestPlayer.cs @@ -14,7 +14,7 @@ namespace Unity.Netcode.MultiprocessRuntimeTests /// public static class BuildMultiprocessTestPlayer { - public const string MultiprocessBaseMenuName = "MLAPI/Multiprocess Test"; + public const string MultiprocessBaseMenuName = "Netcode/Multiprocess Test"; public const string BuildAndExecuteMenuName = MultiprocessBaseMenuName + "/Build Test Player #t"; public const string MainSceneName = "MultiprocessTestScene"; diff --git a/testproject/Assets/Tests/Runtime/MultiprocessRuntime/TestCoordinator.cs b/testproject/Assets/Tests/Runtime/MultiprocessRuntime/TestCoordinator.cs index 8664a7c3e1..b9ddc01220 100644 --- a/testproject/Assets/Tests/Runtime/MultiprocessRuntime/TestCoordinator.cs +++ b/testproject/Assets/Tests/Runtime/MultiprocessRuntime/TestCoordinator.cs @@ -15,7 +15,7 @@ /// to coordinate test execution between client and server with that model. /// The only per tests communication already existing is to get the results per test as they are running /// With this test coordinator, it's not possible to start a main test node with the test runner and have that server start other worker nodes -/// on which to execute client tests. We use MLAPI as both a test framework and as the target of our performance tests. +/// on which to execute client tests. We use netcode as both a test framework and as the target of our performance tests. /// [RequireComponent(typeof(NetworkObject))] public class TestCoordinator : NetworkBehaviour @@ -54,7 +54,7 @@ public void Start() bool isClient = Environment.GetCommandLineArgs().Any(value => value == MultiprocessOrchestration.IsWorkerArg); if (isClient) { - Debug.Log("starting MLAPI client"); + Debug.Log("starting netcode client"); NetworkManager.Singleton.StartClient(); }