mirror of
https://github.com/MirrorNetworking/Mirror.git
synced 2024-11-18 02:50:32 +00:00
NetworkIdentity.DeserializeAll renamed to Deserialize, now that the other Deserialize method was moved to NetworkBehaviour
This commit is contained in:
parent
482d5777d9
commit
d2775e5d42
@ -1037,7 +1037,7 @@ internal static void ApplySpawnPayload(NetworkIdentity identity, SpawnMessage me
|
||||
{
|
||||
using (NetworkReaderPooled payloadReader = NetworkReaderPool.Get(message.payload))
|
||||
{
|
||||
identity.DeserializeAll(payloadReader, true);
|
||||
identity.Deserialize(payloadReader, true);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1283,7 +1283,7 @@ static void OnEntityStateMessage(EntityStateMessage message)
|
||||
if (spawned.TryGetValue(message.netId, out NetworkIdentity localObject) && localObject != null)
|
||||
{
|
||||
using (NetworkReaderPooled networkReader = NetworkReaderPool.Get(message.payload))
|
||||
localObject.DeserializeAll(networkReader, false);
|
||||
localObject.Deserialize(networkReader, false);
|
||||
}
|
||||
else Debug.LogWarning($"Did not find target for sync message for {message.netId} . Note: this can be completely normal because UDP messages may arrive out of order, so this message might have arrived after a Destroy message.");
|
||||
}
|
||||
|
@ -924,7 +924,7 @@ internal void Serialize(bool initialState, NetworkWriter ownerWriter, NetworkWri
|
||||
}
|
||||
}
|
||||
|
||||
internal void DeserializeAll(NetworkReader reader, bool initialState)
|
||||
internal void Deserialize(NetworkReader reader, bool initialState)
|
||||
{
|
||||
if (NetworkBehaviours == null)
|
||||
{
|
||||
|
@ -52,7 +52,7 @@ public void SerializeAndDeserializeAll()
|
||||
|
||||
// deserialize client object with OWNER payload
|
||||
NetworkReader reader = new NetworkReader(ownerWriter.ToArray());
|
||||
clientIdentity.DeserializeAll(reader, true);
|
||||
clientIdentity.Deserialize(reader, true);
|
||||
Assert.That(clientComp1.value, Is.EqualTo(42));
|
||||
Assert.That(clientComp2.value, Is.EqualTo("42"));
|
||||
|
||||
@ -62,7 +62,7 @@ public void SerializeAndDeserializeAll()
|
||||
|
||||
// deserialize client object with OBSERVERS payload
|
||||
reader = new NetworkReader(observersWriter.ToArray());
|
||||
clientIdentity.DeserializeAll(reader, true);
|
||||
clientIdentity.Deserialize(reader, true);
|
||||
Assert.That(clientComp1.value, Is.EqualTo(42)); // observers mode should be in data
|
||||
Assert.That(clientComp2.value, Is.EqualTo(null)); // owner mode shouldn't be in data
|
||||
}
|
||||
@ -100,7 +100,7 @@ public void SerializationException()
|
||||
// should work even if compExc throws an exception
|
||||
// error log because of the exception is expected
|
||||
NetworkReader reader = new NetworkReader(ownerWriter.ToArray());
|
||||
clientIdentity.DeserializeAll(reader, true);
|
||||
clientIdentity.Deserialize(reader, true);
|
||||
Assert.That(clientComp2.value, Is.EqualTo("42"));
|
||||
|
||||
// reset component values
|
||||
@ -110,7 +110,7 @@ public void SerializationException()
|
||||
// should work even if compExc throws an exception
|
||||
// error log because of the exception is expected
|
||||
reader = new NetworkReader(observersWriter.ToArray());
|
||||
clientIdentity.DeserializeAll(reader, true);
|
||||
clientIdentity.Deserialize(reader, true);
|
||||
Assert.That(clientComp2.value, Is.EqualTo(null)); // owner mode should be in data
|
||||
|
||||
// restore error checks
|
||||
@ -178,7 +178,7 @@ public void SerializationMismatch()
|
||||
// ignore warning log because of serialization mismatch
|
||||
LogAssert.ignoreFailingMessages = true;
|
||||
NetworkReader reader = new NetworkReader(ownerWriter.ToArray());
|
||||
clientIdentity.DeserializeAll(reader, true);
|
||||
clientIdentity.Deserialize(reader, true);
|
||||
LogAssert.ignoreFailingMessages = false;
|
||||
|
||||
// the mismatch component will fail, but the one before and after
|
||||
|
@ -414,7 +414,7 @@ public void TestSyncingAbstractNetworkBehaviour()
|
||||
|
||||
// apply all the data from the server object
|
||||
NetworkReader reader = new NetworkReader(ownerWriter.ToArray());
|
||||
clientIdentity.DeserializeAll(reader, true);
|
||||
clientIdentity.Deserialize(reader, true);
|
||||
|
||||
// check that the syncvars got updated
|
||||
Assert.That(clientBehaviour.monster1, Is.EqualTo(serverBehaviour.monster1), "Data should be synchronized");
|
||||
|
Loading…
Reference in New Issue
Block a user