Skip to content

Commit

Permalink
fix: compilation error on standalone build
Browse files Browse the repository at this point in the history
EndOfStreamException is not availble in standalone build
  • Loading branch information
paulpach committed Apr 26, 2020
1 parent f1f8b23 commit bb70bf9
Showing 1 changed file with 12 additions and 19 deletions.
31 changes: 12 additions & 19 deletions Assets/Mirror/Runtime/NetworkIdentity.cs
Original file line number Diff line number Diff line change
Expand Up @@ -815,29 +815,22 @@ internal void OnDeserializeAllSafely(NetworkReader reader, bool initialState)
{
// hack needed so that we can deserialize gameobjects and NI

try
{
NetworkClient.Current = Client;
// read component dirty mask
ulong dirtyComponentsMask = reader.ReadPackedUInt64();
NetworkClient.Current = Client;
// read component dirty mask
ulong dirtyComponentsMask = reader.ReadPackedUInt64();

NetworkBehaviour[] components = NetworkBehaviours;
// loop through all components and deserialize the dirty ones
for (int i = 0; i < components.Length; ++i)
NetworkBehaviour[] components = NetworkBehaviours;
// loop through all components and deserialize the dirty ones
for (int i = 0; i < components.Length; ++i)
{
// is the dirty bit at position 'i' set to 1?
ulong dirtyBit = 1UL << i;
if ((dirtyComponentsMask & dirtyBit) != 0L)
{
// is the dirty bit at position 'i' set to 1?
ulong dirtyBit = 1UL << i;
if ((dirtyComponentsMask & dirtyBit) != 0L)
{
OnDeserializeSafely(components[i], reader, initialState);
}
OnDeserializeSafely(components[i], reader, initialState);
}
}
catch(EndOfStreamException ex)
{
throw new InvalidMessageException("Could not deserialize message", ex);
}


}

// helper function to handle SyncEvent/Command/Rpc
Expand Down

0 comments on commit bb70bf9

Please sign in to comment.