fixing typo (#1895)

This commit is contained in:
James Frowen 2020-05-15 12:51:38 +01:00 committed by GitHub
parent 55be68ba05
commit fe8e0c2e0e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 13 additions and 13 deletions

View File

@ -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);

View File

@ -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;

View File

@ -1088,7 +1088,7 @@ static ArraySegment<byte> 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

View File

@ -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<MyTestComponent>();
gameObject.AddComponent<SerializeTest1NetworkBehaviour>();
gameObject.AddComponent<SerializeTest2NetworkBehaviour>();
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));
}

View File

@ -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

View File

@ -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);

View File

@ -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]