NetworkIdentity: remove redundant OnUpdateVars function

This commit is contained in:
vis2k 2020-02-28 16:26:05 +01:00
parent 782848094b
commit 1c356bff44
2 changed files with 2 additions and 7 deletions

View File

@ -501,7 +501,7 @@ static void ApplySpawnPayload(NetworkIdentity identity, SpawnMessage msg)
{ {
using (PooledNetworkReader payloadReader = NetworkReaderPool.GetReader(msg.payload)) using (PooledNetworkReader payloadReader = NetworkReaderPool.GetReader(msg.payload))
{ {
identity.OnUpdateVars(payloadReader, true); identity.OnDeserializeAllSafely(payloadReader, true);
} }
} }
@ -697,7 +697,7 @@ internal static void OnUpdateVarsMessage(UpdateVarsMessage msg)
if (NetworkIdentity.spawned.TryGetValue(msg.netId, out NetworkIdentity localObject) && localObject != null) if (NetworkIdentity.spawned.TryGetValue(msg.netId, out NetworkIdentity localObject) && localObject != null)
{ {
using (PooledNetworkReader networkReader = NetworkReaderPool.GetReader(msg.payload)) using (PooledNetworkReader networkReader = NetworkReaderPool.GetReader(msg.payload))
localObject.OnUpdateVars(networkReader, false); localObject.OnDeserializeAllSafely(networkReader, false);
} }
else else
{ {

View File

@ -885,11 +885,6 @@ internal void HandleRPC(int componentIndex, int rpcHash, NetworkReader reader)
HandleRemoteCall(componentIndex, rpcHash, MirrorInvokeType.ClientRpc, reader); HandleRemoteCall(componentIndex, rpcHash, MirrorInvokeType.ClientRpc, reader);
} }
internal void OnUpdateVars(NetworkReader reader, bool initialState)
{
OnDeserializeAllSafely(reader, initialState);
}
private static NetworkIdentity previousLocalPlayer = null; private static NetworkIdentity previousLocalPlayer = null;
internal void OnStartLocalPlayer() internal void OnStartLocalPlayer()
{ {