Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ csharp_prefer_braces = true:error
csharp_using_directive_placement = outside_namespace:error

# naming rules
# namespace Unity.Multiplayer.Netcode { ... }
# namespace Unity.Netcode { ... }
# public class NetworkObject { ... }
# public void Spawn(...) { ... }
dotnet_naming_symbols.usertypes_naming_symbols.applicable_kinds = namespace, class, struct, enum, property, method, field, event, delegate, local_function
Expand Down
10 changes: 5 additions & 5 deletions com.unity.multiplayer.mlapi/Editor/CodeGen/CodeGenHelpers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@
using Unity.CompilationPipeline.Common.ILPostProcessing;
using UnityEngine;

namespace Unity.Multiplayer.Netcode.Editor.CodeGen
namespace Unity.Netcode.Editor.CodeGen
{
internal static class CodeGenHelpers
{
public const string RuntimeAssemblyName = "Unity.Multiplayer.MLAPI.Runtime";
public const string RuntimeAssemblyName = "Unity.Netcode.Runtime";

public static readonly string NetworkBehaviour_FullName = typeof(NetworkBehaviour).FullName;
public static readonly string ServerRpcAttribute_FullName = typeof(ServerRpcAttribute).FullName;
Expand Down Expand Up @@ -278,10 +278,10 @@ public static AssemblyDefinition AssemblyDefinitionFor(ICompiledAssembly compile

var assemblyDefinition = AssemblyDefinition.ReadAssembly(new MemoryStream(compiledAssembly.InMemoryAssembly.PeData), readerParameters);

//apparently, it will happen that when we ask to resolve a type that lives inside MLAPI.Runtime, and we
//are also postprocessing MLAPI.Runtime, type resolving will fail, because we do not actually try to resolve
//apparently, it will happen that when we ask to resolve a type that lives inside Unity.Netcode.Runtime, and we
//are also postprocessing Unity.Netcode.Runtime, type resolving will fail, because we do not actually try to resolve
//inside the assembly we are processing. Let's make sure we do that, so that we can use postprocessor features inside
//MLAPI.Runtime itself as well.
//Unity.Netcode.Runtime itself as well.
assemblyResolver.AddAssemblyDefinitionBeingOperatedOn(assemblyDefinition);

return assemblyDefinition;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
using ParameterAttributes = Mono.Cecil.ParameterAttributes;
using ILPPInterface = Unity.CompilationPipeline.Common.ILPostProcessing.ILPostProcessor;

namespace Unity.Multiplayer.Netcode.Editor.CodeGen
namespace Unity.Netcode.Editor.CodeGen
{
internal sealed class NetworkBehaviourILPP : ILPPInterface
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
using Mono.Cecil;
using Unity.CompilationPipeline.Common.ILPostProcessing;

namespace Unity.Multiplayer.Netcode.Editor.CodeGen
namespace Unity.Netcode.Editor.CodeGen
{
internal class PostProcessorAssemblyResolver : IAssemblyResolver
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
using System.Reflection;
using Mono.Cecil;

namespace Unity.Multiplayer.Netcode.Editor.CodeGen
namespace Unity.Netcode.Editor.CodeGen
{
internal class PostProcessorReflectionImporter : DefaultReflectionImporter
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using Mono.Cecil;

namespace Unity.Multiplayer.Netcode.Editor.CodeGen
namespace Unity.Netcode.Editor.CodeGen
{
internal class PostProcessorReflectionImporterProvider : IReflectionImporterProvider
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
using Unity.CompilationPipeline.Common.ILPostProcessing;
using ILPPInterface = Unity.CompilationPipeline.Common.ILPostProcessing.ILPostProcessor;

namespace Unity.Multiplayer.Netcode.Editor.CodeGen
namespace Unity.Netcode.Editor.CodeGen
{
internal sealed class RuntimeAccessModifiersILPP : ILPPInterface
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"name": "Unity.Multiplayer.MLAPI.Editor.CodeGen",
"rootNamespace": "Unity.Multiplayer.Netcode.Editor.CodeGen",
"name": "Unity.Netcode.Editor.CodeGen",
"rootNamespace": "Unity.Netcode.Editor.CodeGen",
"references": [
"Unity.Multiplayer.MLAPI.Runtime"
"Unity.Netcode.Runtime"
],
"includePlatforms": [
"Editor"
Expand All @@ -15,5 +15,5 @@
"Mono.Cecil.Pdb.dll",
"Mono.Cecil.Rocks.dll"
],
"autoReferenced": false
"autoReferenced": false
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using System;

namespace Unity.Multiplayer.Netcode.Editor
namespace Unity.Netcode.Editor
{
public class DontShowInTransportDropdownAttribute : Attribute
{
Expand Down
2 changes: 1 addition & 1 deletion com.unity.multiplayer.mlapi/Editor/MLAPIProfiler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
using UnityEditor;
using UnityEngine;

namespace Unity.Multiplayer.Netcode.Editor
namespace Unity.Netcode.Editor
{
public class MLAPIProfiler : EditorWindow
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
using UnityEditor;
using UnityEngine;

namespace Unity.Multiplayer.Netcode.Editor
namespace Unity.Netcode.Editor
{
[InitializeOnLoad]
internal static class MLAPIProfilerModule
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
using UnityEngine;
using UnityEditor;

namespace Unity.Multiplayer.Netcode.Editor
namespace Unity.Netcode.Editor
{
[CustomEditor(typeof(NetworkBehaviour), true)]
[CanEditMultipleObjects]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
using UnityEngine;
using UnityEditorInternal;

namespace Unity.Multiplayer.Netcode.Editor
namespace Unity.Netcode.Editor
{
[CustomEditor(typeof(NetworkManager), true)]
[CanEditMultipleObjects]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
using UnityEngine;
using UnityEditor;

namespace Unity.Multiplayer.Netcode.Editor
namespace Unity.Netcode.Editor
{
[CustomEditor(typeof(NetworkObject), true)]
[CanEditMultipleObjects]
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"name": "Unity.Netcode.Editor",
"rootNamespace": "Unity.Netcode.Editor",
"references": [
"Unity.Netcode.Runtime",
"Unity.Netcode.Prototyping"
],
"includePlatforms": [
"Editor"
]
}
9 changes: 4 additions & 5 deletions com.unity.multiplayer.mlapi/Prototyping/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
using System.Runtime.CompilerServices;

#if UNITY_EDITOR
[assembly: InternalsVisibleTo("Unity.Multiplayer.MLAPI.EditorTests")]
[assembly: InternalsVisibleTo("Unity.Multiplayer.MLAPI.RuntimeTests")]
[assembly: InternalsVisibleTo("Unity.Multiplayer.MLAPI.Editor.CodeGen")]
[assembly: InternalsVisibleTo("Unity.Multiplayer.MLAPI.Editor")]
[assembly: InternalsVisibleTo("Unity.Netcode.EditorTests")]
[assembly: InternalsVisibleTo("Unity.Netcode.RuntimeTests")]
[assembly: InternalsVisibleTo("Unity.Netcode.Editor.CodeGen")]
[assembly: InternalsVisibleTo("Unity.Netcode.Editor")]
[assembly: InternalsVisibleTo("TestProject.EditorTests")]
[assembly: InternalsVisibleTo("TestProject.RuntimeTests")]
[assembly: InternalsVisibleTo("TestProject.ManualTests")]
#endif
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
using System.Collections.Generic;
using UnityEngine;

namespace Unity.Multiplayer.Netcode.Prototyping
namespace Unity.Netcode.Prototyping
{
/// <summary>
/// A prototype component for syncing animations
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
using UnityEngine;
using UnityEngine.AI;

namespace Unity.Multiplayer.Netcode.Prototyping
namespace Unity.Netcode.Prototyping
{
/// <summary>
/// A prototype component for syncing NavMeshAgents
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using System;
using UnityEngine;

namespace Unity.Multiplayer.Netcode.Prototyping
namespace Unity.Netcode.Prototyping
{
/// <summary>
/// A prototype component for syncing transforms
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"name": "Unity.Netcode.Prototyping",
"rootNamespace": "Unity.Netcode.Prototyping",
"references": [
"Unity.Netcode.Runtime"
]
}
8 changes: 4 additions & 4 deletions com.unity.multiplayer.mlapi/Runtime/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
using System.Runtime.CompilerServices;

#if UNITY_EDITOR
[assembly: InternalsVisibleTo("Unity.Multiplayer.MLAPI.EditorTests")]
[assembly: InternalsVisibleTo("Unity.Multiplayer.MLAPI.RuntimeTests")]
[assembly: InternalsVisibleTo("Unity.Multiplayer.MLAPI.Editor.CodeGen")]
[assembly: InternalsVisibleTo("Unity.Multiplayer.MLAPI.Editor")]
[assembly: InternalsVisibleTo("Unity.Netcode.EditorTests")]
[assembly: InternalsVisibleTo("Unity.Netcode.RuntimeTests")]
[assembly: InternalsVisibleTo("Unity.Netcode.Editor.CodeGen")]
[assembly: InternalsVisibleTo("Unity.Netcode.Editor")]
[assembly: InternalsVisibleTo("TestProject.EditorTests")]
[assembly: InternalsVisibleTo("TestProject.RuntimeTests")]
#endif
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using System;

namespace Unity.Multiplayer.Netcode
namespace Unity.Netcode
{
/// <summary>
/// Queue with a fixed size
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace Unity.Multiplayer.Netcode
namespace Unity.Netcode
{
/// <summary>
/// Represents the length of a var int encoded hash
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
using UnityEngine;
using System.Linq;

namespace Unity.Multiplayer.Netcode
namespace Unity.Netcode
{
/// <summary>
/// The configuration object used to start server, client and hosts
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace Unity.Multiplayer.Netcode
namespace Unity.Netcode
{
/// <summary>
/// A static class containing MLAPI constants
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using System;
using UnityEngine;

namespace Unity.Multiplayer.Netcode
namespace Unity.Netcode
{
internal enum NetworkPrefabOverride
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using System.Collections.Generic;

namespace Unity.Multiplayer.Netcode
namespace Unity.Netcode
{
/// <summary>
/// A NetworkClient
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace Unity.Multiplayer.Netcode
namespace Unity.Netcode
{
/// <summary>
/// A class representing a client that is currently in the process of connecting
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using UnityEngine;

namespace Unity.Multiplayer.Netcode
namespace Unity.Netcode
{
internal struct IndexAllocatorEntry
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
using System.Linq;
using System.IO;

namespace Unity.Multiplayer.Netcode
namespace Unity.Netcode
{
/// <summary>
/// The base class to override to write network code. Inherits MonoBehaviour
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using System.Collections.Generic;
using Unity.Profiling;

namespace Unity.Multiplayer.Netcode
namespace Unity.Netcode
{
public class NetworkBehaviourUpdater
{
Expand Down
4 changes: 2 additions & 2 deletions com.unity.multiplayer.mlapi/Runtime/Core/NetworkManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
using Unity.Profiling;
using Debug = UnityEngine.Debug;

namespace Unity.Multiplayer.Netcode
namespace Unity.Netcode
{
/// <summary>
/// The main component of the library
Expand Down Expand Up @@ -172,7 +172,7 @@ public ulong LocalClientId
public ulong[] ConnectedClientsIds => ConnectedClientsList.Select(c => c.ClientId).ToArray();

/// <summary>
/// Gets a dictionary of the clients that have been accepted by the transport but are still pending by the MLAPI. This is only populated on the server.
/// Gets a dictionary of the clients that have been accepted by the transport but are still pending by the Netcode. This is only populated on the server.
/// </summary>
public readonly Dictionary<ulong, PendingClient> PendingClients = new Dictionary<ulong, PendingClient>();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
using System.Runtime.CompilerServices;
using UnityEngine;

namespace Unity.Multiplayer.Netcode
namespace Unity.Netcode
{
/// <summary>
/// A component used to identify that a GameObject in the network
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
using UnityEngine.LowLevel;
using UnityEngine.PlayerLoop;

namespace Unity.Multiplayer.Netcode
namespace Unity.Netcode
{
/// <summary>
/// Defines the required interface of a network update system being executed by the network update loop.
Expand Down
2 changes: 1 addition & 1 deletion com.unity.multiplayer.mlapi/Runtime/Core/SnapshotRTT.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using System;

namespace Unity.Multiplayer.Netcode
namespace Unity.Netcode
{
internal class ConnectionRtt
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
using System.IO;
using UnityEngine;

namespace Unity.Multiplayer.Netcode
namespace Unity.Netcode
{
// Structure that acts as a key for a NetworkVariable
// Allows telling which variable we're talking about.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using System;

namespace Unity.Multiplayer.Netcode
namespace Unity.Netcode
{
/// <summary>
/// Exception thrown when the new parent candidate of the NetworkObject is not valid
Expand Down
Loading