Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
68 commits
Select commit Hold shift + click to select a range
885f9a8
remove csc.rsp and delete DISABLE_CRYPTOGRAPHY blocks
0xFA11 Feb 28, 2021
222dd76
fix order of shutdown and singleton=null on NetworkManager.OnDestroy()
0xFA11 Feb 28, 2021
022098e
remove hail handshake and constants
0xFA11 Feb 28, 2021
72d4884
remove aeskey fields
0xFA11 Feb 28, 2021
8399ff3
remove encryption/cryptography from networkconfig
0xFA11 Feb 28, 2021
80363ab
remove SecuritySendFlags
0xFA11 Feb 28, 2021
671ebd5
remove security parameter xmldoc
0xFA11 Feb 28, 2021
cb40497
fix BeginAddQueueItemToFrame
0xFA11 Feb 28, 2021
3554783
remove StdRpc transport channel and stdrpc profiler markers
0xFA11 Feb 28, 2021
6ef3a75
removed todo comment since removing messagepacker is non-trivial task…
0xFA11 Feb 28, 2021
850070b
rename NetworkingManager to NetworkManager
0xFA11 Feb 28, 2021
6eb2f71
rename NetworkedObject to NetworkObject
0xFA11 Feb 28, 2021
2dc3b41
rename NetworkedBehaviour to NetworkBehaviour
0xFA11 Feb 28, 2021
34b73d1
rename NetworkedClient to NetworkClient
0xFA11 Feb 28, 2021
c0727ea
rename NetworkedPrefab to NetworkPrefab
0xFA11 Feb 28, 2021
d6b04d6
rename NetworkedVar to NetworkVariable
0xFA11 Feb 28, 2021
579d0b3
rename NetworkedVar to NetworkVariable
0xFA11 Feb 28, 2021
c3a332e
rename NetworkedTransform to NetworkTransform
0xFA11 Feb 28, 2021
ff4caaa
rename NetworkedAnimator to NetworkAnimator
0xFA11 Feb 28, 2021
7056ae5
rename NetworkedAnimatorEditor to NetworkAnimatorEditor
0xFA11 Feb 28, 2021
65f3b0c
rename NetworkedNavMeshAgent to NetworkNavMeshAgent
0xFA11 Feb 28, 2021
30f2165
rename SpawnManager to NetworkSpawnManager
0xFA11 Feb 28, 2021
def0dda
rename BitStream/BitSerializer/... to NetworkStream/NetworkSerializer…
0xFA11 Mar 1, 2021
a654a56
rename NetEventType to NetworkEvent
0xFA11 Mar 1, 2021
5df4c74
rename ChannelType to NetworkDelivery
0xFA11 Mar 1, 2021
10a6df0
rename Channel to NetworkChannel
0xFA11 Mar 1, 2021
3fbbc97
rename Transport to NetworkTransport
0xFA11 Mar 1, 2021
df3e280
rename NetworkedDictionary to NetworkDictionary
0xFA11 Mar 1, 2021
2a28d1c
rename NetworkedList to NetworkList
0xFA11 Mar 1, 2021
9cc4f00
rename NetworkedSet to NetworkSet
0xFA11 Mar 1, 2021
c4d8312
replace remaining *networked* instances with *network*
0xFA11 Mar 1, 2021
b08d054
remove [Obsolete] API
0xFA11 Mar 1, 2021
e76ed08
refactor & rename MLAPIConstants to NetworkConstants
0xFA11 Mar 1, 2021
609d259
refactor (format & rename) Prototyping components
0xFA11 Mar 1, 2021
ec0a01a
refactor: reformat source files, rename types/methods/fields/properti…
0xFA11 Mar 1, 2021
2443cd8
fix ILPP on 2020.2+
0xFA11 Mar 1, 2021
8d1f998
merge branch develop into feature/refactor-rename
0xFA11 Mar 2, 2021
b581c3e
merge branch 'develop' into 'feature/refactor-rename'
0xFA11 Mar 2, 2021
9225368
rename NetworkStream to NetworkBuffer
0xFA11 Mar 2, 2021
593d8e7
remove unnecessary MLAPI.* namespace resolution prefix
0xFA11 Mar 2, 2021
1a11b0e
remove k_* prefixes from internal const fields
0xFA11 Mar 2, 2021
d4784d6
other QoL improvements
0xFA11 Mar 2, 2021
4c03459
make ids more explicit
0xFA11 Mar 2, 2021
0aa3361
merge branch 'feature/refactor-rename' into 'feature/reformat-rename'
0xFA11 Mar 2, 2021
f1e0298
another refactoring pass
0xFA11 Mar 2, 2021
da9d849
merge branch 'develop' into 'feature/reformat-rename'
0xFA11 Mar 2, 2021
ee6c201
rename Unet to UNet
0xFA11 Mar 2, 2021
d7186e6
revert k_* prefixes on public and internal constants
0xFA11 Mar 2, 2021
339a6bc
revert s_* prefixes on public and internal statics
0xFA11 Mar 2, 2021
2b9a723
revert all changes to MLAPIEditor (it's going away soon)
0xFA11 Mar 2, 2021
729b880
remove properties
0xFA11 Mar 2, 2021
8419a8a
Merge branch 'develop' into feature/reformat-rename
0xFA11 Mar 2, 2021
06033d0
refactor profiling stuff
0xFA11 Mar 2, 2021
ce7acf5
refactor Editor stuff
0xFA11 Mar 2, 2021
8d7565f
fix MLAPIProfilerModule
0xFA11 Mar 2, 2021
410f37e
collapse some back-to-back 'using (var ...)' statements
0xFA11 Mar 2, 2021
9893962
polish profiler stuff
0xFA11 Mar 2, 2021
02d2bb7
favor string interpolation rather than string concat with + (plus) op…
0xFA11 Mar 2, 2021
cb01b63
merge branch 'develop' into 'feature/reformat-rename'
0xFA11 Mar 2, 2021
e554077
remove MLAPIEditor meta file
0xFA11 Mar 2, 2021
fc0125a
merge branch 'develop' into 'feature/reformat-rename'
0xFA11 Mar 3, 2021
7f2c24b
redo refactorings
0xFA11 Mar 3, 2021
7d85280
favor using nameof and string interpolation for profilermarkers
0xFA11 Mar 3, 2021
c91b4b3
remove unnecessary MLAPI.* namespace scope resolution
0xFA11 Mar 3, 2021
d6fa246
Merge branch 'develop' into feature/reformat-rename
mattwalsh-unity Mar 4, 2021
d783e94
Merge branch 'develop' into feature/reformat-rename
0xFA11 Mar 4, 2021
f5e6719
minor tweaks after code-review
0xFA11 Mar 4, 2021
941ca8d
fix RpcQueueTests after merging develop branch
0xFA11 Mar 4, 2021
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
11 changes: 3 additions & 8 deletions com.unity.multiplayer.mlapi/Editor/CodeGen/CodeGenHelpers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,8 @@ public static bool HasInterface(this TypeReference typeReference, string Interfa
}
catch
{
return false;
}

return false;
}

public static bool IsSerializable(this TypeReference typeReference)
Expand Down Expand Up @@ -141,16 +140,12 @@ public static TypeReference GetEnumAsInt(this TypeReference typeReference)
try
{
var typeDef = typeReference.Resolve();
if (typeDef.IsEnum)
{
return typeDef.GetEnumUnderlyingType();
}
return typeDef.IsEnum ? typeDef.GetEnumUnderlyingType() : null;
}
catch
{
return null;
}

return null;
}

public static void AddError(this List<DiagnosticMessage> diagnostics, string message)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ private static ILPostProcessor[] FindAllPostProcessors()
}
catch (Exception exception)
{
Debug.LogError($"Could not create ILPostProcessor ({typeCollection.FullName}):{Environment.NewLine}{exception.StackTrace}");
Debug.LogError($"Could not create {nameof(ILPostProcessor)} ({typeCollection.FullName}):{Environment.NewLine}{exception.StackTrace}");
}
}

Expand Down Expand Up @@ -185,22 +185,21 @@ void WriteAssembly(InMemoryAssembly inMemoryAssembly, string outputPath, string
foreach (var i in s_ILPostProcessors)
{
var result = i.Process(targetCompiledAssembly);
if (result == null)
continue;
if (result == null) continue;

if (result.Diagnostics.Count > 0)
{
Debug.LogError($"ILPostProcessor - {i.GetType().Name} failed to run on {targetCompiledAssembly.Name}");
Debug.LogError($"{nameof(ILPostProcessor)} - {i.GetType().Name} failed to run on {targetCompiledAssembly.Name}");

foreach (var message in result.Diagnostics)
{
switch (message.DiagnosticType)
{
case DiagnosticType.Error:
Debug.LogError($"ILPostProcessor Error - {message.MessageData} {message.File}:{message.Line}");
Debug.LogError($"{nameof(ILPostProcessor)} Error - {message.MessageData} {message.File}:{message.Line}");
break;
case DiagnosticType.Warning:
Debug.LogWarning($"ILPostProcessor Warning - {message.MessageData} {message.File}:{message.Line}");
Debug.LogWarning($"{nameof(ILPostProcessor)} Warning - {message.MessageData} {message.File}:{message.Line}");
break;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,17 @@ namespace MLAPI.Editor.CodeGen
{
internal class PostProcessorReflectionImporter : DefaultReflectionImporter
{
private const string SystemPrivateCoreLib = "System.Private.CoreLib";
private const string k_SystemPrivateCoreLib = "System.Private.CoreLib";
private readonly AssemblyNameReference m_CorrectCorlib;

public PostProcessorReflectionImporter(ModuleDefinition module) : base(module)
{
m_CorrectCorlib = module.AssemblyReferences.FirstOrDefault(a => a.Name == "mscorlib" || a.Name == "netstandard" || a.Name == SystemPrivateCoreLib);
m_CorrectCorlib = module.AssemblyReferences.FirstOrDefault(a => a.Name == "mscorlib" || a.Name == "netstandard" || a.Name == k_SystemPrivateCoreLib);
}

public override AssemblyNameReference ImportReference(AssemblyName reference)
{
return m_CorrectCorlib != null && reference.Name == SystemPrivateCoreLib ? m_CorrectCorlib : base.ImportReference(reference);
return m_CorrectCorlib != null && reference.Name == k_SystemPrivateCoreLib ? m_CorrectCorlib : base.ImportReference(reference);
}
}
}
80 changes: 40 additions & 40 deletions com.unity.multiplayer.mlapi/Editor/CodeGen/XXHash/XXHash.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,17 @@ namespace MLAPI.Editor.CodeGen
/// </summary>
internal static class XXHash
{
private const ulong prime64v1 = 11400714785074694791ul;
private const ulong prime64v2 = 14029467366897019727ul;
private const ulong prime64v3 = 1609587929392839161ul;
private const ulong prime64v4 = 9650029242287828579ul;
private const ulong prime64v5 = 2870177450012600261ul;

private const uint prime32v1 = 2654435761u;
private const uint prime32v2 = 2246822519u;
private const uint prime32v3 = 3266489917u;
private const uint prime32v4 = 668265263u;
private const uint prime32v5 = 374761393u;
private const ulong k_Prime64v1 = 11400714785074694791ul;
private const ulong k_Prime64v2 = 14029467366897019727ul;
private const ulong k_Prime64v3 = 1609587929392839161ul;
private const ulong k_Prime64v4 = 9650029242287828579ul;
private const ulong k_Prime64v5 = 2870177450012600261ul;

private const uint k_Prime32v1 = 2654435761u;
private const uint k_Prime32v2 = 2246822519u;
private const uint k_Prime32v3 = 3266489917u;
private const uint k_Prime32v4 = 668265263u;
private const uint k_Prime32v5 = 374761393u;

/// <summary>
/// Generate a 32-bit xxHash value.
Expand All @@ -44,10 +44,10 @@ public static unsafe uint Hash32(byte* buffer, int bufferLength, uint seed = 0)
byte* pInput = buffer;
if (len >= stripeLength)
{
uint acc1 = seed + prime32v1 + prime32v2;
uint acc2 = seed + prime32v2;
uint acc1 = seed + k_Prime32v1 + k_Prime32v2;
uint acc2 = seed + k_Prime32v2;
uint acc3 = seed;
uint acc4 = seed - prime32v1;
uint acc4 = seed - k_Prime32v1;

do
{
Expand All @@ -57,7 +57,7 @@ public static unsafe uint Hash32(byte* buffer, int bufferLength, uint seed = 0)
}
else
{
acc = seed + prime32v5;
acc = seed + k_Prime32v5;
}

acc += (uint)len;
Expand All @@ -84,10 +84,10 @@ public static unsafe ulong Hash64(byte* buffer, int bufferLength, ulong seed = 0
byte* pInput = buffer;
if (len >= stripeLength)
{
ulong acc1 = seed + prime64v1 + prime64v2;
ulong acc2 = seed + prime64v2;
ulong acc1 = seed + k_Prime64v1 + k_Prime64v2;
ulong acc2 = seed + k_Prime64v2;
ulong acc3 = seed;
ulong acc4 = seed - prime64v1;
ulong acc4 = seed - k_Prime64v1;

do
{
Expand All @@ -97,7 +97,7 @@ public static unsafe ulong Hash64(byte* buffer, int bufferLength, ulong seed = 0
}
else
{
acc = seed + prime64v5;
acc = seed + k_Prime64v5;
}

acc += (ulong)len;
Expand Down Expand Up @@ -151,24 +151,24 @@ private static unsafe ulong processRemaining64(
lane = *(ulong*)pInput;

acc ^= round64(0, lane);
acc = Bits.RotateLeft(acc, 27) * prime64v1;
acc += prime64v4;
acc = Bits.RotateLeft(acc, 27) * k_Prime64v1;
acc += k_Prime64v4;
}

for (uint lane32; remainingLen >= 4; remainingLen -= 4, pInput += 4)
{
lane32 = *(uint*)pInput;

acc ^= lane32 * prime64v1;
acc = Bits.RotateLeft(acc, 23) * prime64v2;
acc += prime64v3;
acc ^= lane32 * k_Prime64v1;
acc = Bits.RotateLeft(acc, 23) * k_Prime64v2;
acc += k_Prime64v3;
}

for (byte lane8; remainingLen >= 1; remainingLen--, pInput++)
{
lane8 = *pInput;
acc ^= lane8 * prime64v5;
acc = Bits.RotateLeft(acc, 11) * prime64v1;
acc ^= lane8 * k_Prime64v5;
acc = Bits.RotateLeft(acc, 11) * k_Prime64v1;
}

return acc;
Expand All @@ -178,26 +178,26 @@ private static unsafe ulong processRemaining64(
private static ulong avalanche64(ulong acc)
{
acc ^= acc >> 33;
acc *= prime64v2;
acc *= k_Prime64v2;
acc ^= acc >> 29;
acc *= prime64v3;
acc *= k_Prime64v3;
acc ^= acc >> 32;
return acc;
}

[MethodImpl(MethodImplOptions.AggressiveInlining)]
private static ulong round64(ulong accn, ulong lane)
{
accn += lane * prime64v2;
return Bits.RotateLeft(accn, 31) * prime64v1;
accn += lane * k_Prime64v2;
return Bits.RotateLeft(accn, 31) * k_Prime64v1;
}

[MethodImpl(MethodImplOptions.AggressiveInlining)]
private static void mergeAccumulator64(ref ulong acc, ulong accn)
{
acc ^= round64(0, accn);
acc *= prime64v1;
acc += prime64v4;
acc *= k_Prime64v1;
acc += k_Prime64v4;
}

[MethodImpl(MethodImplOptions.AggressiveInlining)]
Expand Down Expand Up @@ -236,15 +236,15 @@ private static unsafe uint processRemaining32(
for (uint lane; remainingLen >= 4; remainingLen -= 4, pInput += 4)
{
lane = *(uint*)pInput;
acc += lane * prime32v3;
acc = Bits.RotateLeft(acc, 17) * prime32v4;
acc += lane * k_Prime32v3;
acc = Bits.RotateLeft(acc, 17) * k_Prime32v4;
}

for (byte lane; remainingLen >= 1; remainingLen--, pInput++)
{
lane = *pInput;
acc += lane * prime32v5;
acc = Bits.RotateLeft(acc, 11) * prime32v1;
acc += lane * k_Prime32v5;
acc = Bits.RotateLeft(acc, 11) * k_Prime32v1;
}

return acc;
Expand All @@ -253,19 +253,19 @@ private static unsafe uint processRemaining32(
[MethodImpl(MethodImplOptions.AggressiveInlining)]
private static uint round32(uint accn, uint lane)
{
accn += lane * prime32v2;
accn += lane * k_Prime32v2;
accn = Bits.RotateLeft(accn, 13);
accn *= prime32v1;
accn *= k_Prime32v1;
return accn;
}

[MethodImpl(MethodImplOptions.AggressiveInlining)]
private static uint avalanche32(uint acc)
{
acc ^= acc >> 15;
acc *= prime32v2;
acc *= k_Prime32v2;
acc ^= acc >> 13;
acc *= prime32v3;
acc *= k_Prime32v3;
acc ^= acc >> 16;
return acc;
}
Expand Down
Loading