From fe8e0c2e0ee327e1f18116d680c8727679bbf53a Mon Sep 17 00:00:00 2001 From: James Frowen Date: Fri, 15 May 2020 12:51:38 +0100 Subject: [PATCH] fixing typo (#1895) --- .../Weaver/Processors/SyncObjectInitializer.cs | 2 +- Assets/Mirror/Runtime/NetworkIdentity.cs | 2 +- Assets/Mirror/Runtime/NetworkServer.cs | 2 +- Assets/Mirror/Tests/Editor/NetworkIdentityTests.cs | 14 +++++++------- Assets/Mirror/Tests/Editor/SyncVarTest.cs | 2 +- Assets/Mirror/Tests/Editor/SyncVarVirtualTest.cs | 2 +- .../Tests/Editor/Weaver/WeaverSyncListTests.cs | 2 +- 7 files changed, 13 insertions(+), 13 deletions(-) diff --git a/Assets/Mirror/Editor/Weaver/Processors/SyncObjectInitializer.cs b/Assets/Mirror/Editor/Weaver/Processors/SyncObjectInitializer.cs index 191b6aa1f..758da6610 100644 --- a/Assets/Mirror/Editor/Weaver/Processors/SyncObjectInitializer.cs +++ b/Assets/Mirror/Editor/Weaver/Processors/SyncObjectInitializer.cs @@ -41,7 +41,7 @@ static void GenerateSyncObjectInstanceInitializer(ILProcessor ctorWorker, FieldD MethodDefinition ctor = fieldType.Methods.FirstOrDefault(x => x.Name == ".ctor" && !x.HasParameters); if (ctor == null) { - Weaver.Error($"Can not intialize field {fd.Name} because no default constructor was found. Manually intialize the field (call the constructor) or add constructor without Parameter", fd); + Weaver.Error($"Can not initialize field {fd.Name} because no default constructor was found. Manually initialize the field (call the constructor) or add constructor without Parameter", fd); return; } MethodReference objectConstructor = Weaver.CurrentAssembly.MainModule.ImportReference(ctor); diff --git a/Assets/Mirror/Runtime/NetworkIdentity.cs b/Assets/Mirror/Runtime/NetworkIdentity.cs index b340098a2..76b4d4781 100644 --- a/Assets/Mirror/Runtime/NetworkIdentity.cs +++ b/Assets/Mirror/Runtime/NetworkIdentity.cs @@ -877,7 +877,7 @@ internal ulong GetDirtyComponentsMask() return dirtyComponentsMask; } - internal ulong GetIntialComponentsMask() + internal ulong GetInitialComponentsMask() { // loop through all components only once and then write dirty+payload into the writer afterwards ulong dirtyComponentsMask = 0UL; diff --git a/Assets/Mirror/Runtime/NetworkServer.cs b/Assets/Mirror/Runtime/NetworkServer.cs index b53ef24a8..1121eacac 100644 --- a/Assets/Mirror/Runtime/NetworkServer.cs +++ b/Assets/Mirror/Runtime/NetworkServer.cs @@ -1088,7 +1088,7 @@ static ArraySegment CreateSpawnMessagePayload(bool isOwner, NetworkIdentit // serialize all components with initialState = true // (can be null if has none) - ulong dirtyComponentsMask = identity.GetIntialComponentsMask(); + ulong dirtyComponentsMask = identity.GetInitialComponentsMask(); identity.OnSerializeAllSafely(true, dirtyComponentsMask, ownerWriter, out int ownerWritten, observersWriter, out int observersWritten); // convert to ArraySegment to avoid reader allocations diff --git a/Assets/Mirror/Tests/Editor/NetworkIdentityTests.cs b/Assets/Mirror/Tests/Editor/NetworkIdentityTests.cs index aa3f1b46c..b272f3869 100644 --- a/Assets/Mirror/Tests/Editor/NetworkIdentityTests.cs +++ b/Assets/Mirror/Tests/Editor/NetworkIdentityTests.cs @@ -891,7 +891,7 @@ public void OnSerializeAndDeserializeAllSafely() // serialize all - should work even if compExc throws an exception NetworkWriter ownerWriter = new NetworkWriter(); NetworkWriter observersWriter = new NetworkWriter(); - ulong mask = identity.GetIntialComponentsMask(); + ulong mask = identity.GetInitialComponentsMask(); // error log because of the exception is expected LogAssert.ignoreFailingMessages = true; identity.OnSerializeAllSafely(true, mask, ownerWriter, out int ownerWritten, observersWriter, out int observersWritten); @@ -952,7 +952,7 @@ public void OnSerializeAllSafelyShouldNotLogErrorsForTooManyComponents() NetworkWriter ownerWriter = new NetworkWriter(); NetworkWriter observersWriter = new NetworkWriter(); - ulong mask = identity.GetIntialComponentsMask(); + ulong mask = identity.GetInitialComponentsMask(); identity.OnSerializeAllSafely(true, mask, ownerWriter, out int ownerWritten, observersWriter, out int observersWritten); // Should still write with too mnay Components because NetworkBehavioursCache should handle the error @@ -996,7 +996,7 @@ public void OnDeserializeSafelyShouldDetectAndHandleDeSerializationMismatch() // serialize NetworkWriter ownerWriter = new NetworkWriter(); NetworkWriter observersWriter = new NetworkWriter(); - ulong mask = identity.GetIntialComponentsMask(); + ulong mask = identity.GetInitialComponentsMask(); identity.OnSerializeAllSafely(true, mask, ownerWriter, out int ownerWritten, observersWriter, out int observersWritten); // reset component values @@ -1734,22 +1734,22 @@ public void RebuildObserversReturnsIfNull() } [Test] - public void GetIntialComponentsMaskShouldReturn1BitPerNetworkBehaviour() + public void GetInitialComponentsMaskShouldReturn1BitPerNetworkBehaviour() { gameObject.AddComponent(); gameObject.AddComponent(); gameObject.AddComponent(); - ulong mask = identity.GetIntialComponentsMask(); + ulong mask = identity.GetInitialComponentsMask(); // 1 + 2 + 4 = 7 Assert.That(mask, Is.EqualTo(7UL)); } [Test] - public void GetIntialComponentsMaskShouldReturnZeroWhenNoNetworkBehaviours() + public void GetInitialComponentsMaskShouldReturnZeroWhenNoNetworkBehaviours() { - ulong mask = identity.GetIntialComponentsMask(); + ulong mask = identity.GetInitialComponentsMask(); Assert.That(mask, Is.EqualTo(0UL)); } diff --git a/Assets/Mirror/Tests/Editor/SyncVarTest.cs b/Assets/Mirror/Tests/Editor/SyncVarTest.cs index 997a8a3bf..60a4ae686 100644 --- a/Assets/Mirror/Tests/Editor/SyncVarTest.cs +++ b/Assets/Mirror/Tests/Editor/SyncVarTest.cs @@ -123,7 +123,7 @@ public void TestSynchronizingObjects() NetworkWriter ownerWriter = new NetworkWriter(); // not really used in this Test NetworkWriter observersWriter = new NetworkWriter(); - ulong mask = identity1.GetIntialComponentsMask(); + ulong mask = identity1.GetInitialComponentsMask(); identity1.OnSerializeAllSafely(true, mask, ownerWriter, out int ownerWritten, observersWriter, out int observersWritten); // set up a "client" object diff --git a/Assets/Mirror/Tests/Editor/SyncVarVirtualTest.cs b/Assets/Mirror/Tests/Editor/SyncVarVirtualTest.cs index a00695c45..7ea7bef24 100644 --- a/Assets/Mirror/Tests/Editor/SyncVarVirtualTest.cs +++ b/Assets/Mirror/Tests/Editor/SyncVarVirtualTest.cs @@ -77,7 +77,7 @@ void SyncValuesWithClient() NetworkWriter ownerWriter = new NetworkWriter(); // not really used in this Test NetworkWriter observersWriter = new NetworkWriter(); - ulong mask = netIdServer.GetIntialComponentsMask(); + ulong mask = netIdServer.GetInitialComponentsMask(); netIdServer.OnSerializeAllSafely(true, mask, ownerWriter, out int ownerWritten, observersWriter, out int observersWritten); diff --git a/Assets/Mirror/Tests/Editor/Weaver/WeaverSyncListTests.cs b/Assets/Mirror/Tests/Editor/Weaver/WeaverSyncListTests.cs index 6db9a4f9b..e9bb0acfb 100644 --- a/Assets/Mirror/Tests/Editor/Weaver/WeaverSyncListTests.cs +++ b/Assets/Mirror/Tests/Editor/Weaver/WeaverSyncListTests.cs @@ -43,7 +43,7 @@ public void SyncListInheritance() [Test] public void SyncListMissingParamlessCtor() { - Assert.That(weaverErrors, Contains.Item("Can not intialize field Foo because no default constructor was found. Manually intialize the field (call the constructor) or add constructor without Parameter (at WeaverSyncListTests.SyncListMissingParamlessCtor.SyncListMissingParamlessCtor/SyncListString2 WeaverSyncListTests.SyncListMissingParamlessCtor.SyncListMissingParamlessCtor::Foo)")); + Assert.That(weaverErrors, Contains.Item("Can not initialize field Foo because no default constructor was found. Manually initialize the field (call the constructor) or add constructor without Parameter (at WeaverSyncListTests.SyncListMissingParamlessCtor.SyncListMissingParamlessCtor/SyncListString2 WeaverSyncListTests.SyncListMissingParamlessCtor.SyncListMissingParamlessCtor::Foo)")); } [Test]