Skip to content

Commit

Permalink
NetworkIdentitySerializationTests: fix SerializeClient_NotInitial_Not…
Browse files Browse the repository at this point in the history
…Dirty test setup so it actually would serialize if dirty
  • Loading branch information
mischa committed Jul 15, 2024
1 parent 394ba40 commit 19f23cb
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -232,11 +232,18 @@ public void SerializeClient_NotInitial_NotDirty_WritesNothing()
out _, out NetworkIdentity serverIdentity, out SerializeTest1NetworkBehaviour serverComp1, out SerializeTest2NetworkBehaviour serverComp2,
out _, out NetworkIdentity clientIdentity, out SerializeTest1NetworkBehaviour clientComp1, out SerializeTest2NetworkBehaviour clientComp2);

// client only serializes owned ClientToServer components
clientIdentity.isOwned = true;
serverComp1.syncDirection = SyncDirection.ClientToServer;
serverComp2.syncDirection = SyncDirection.ClientToServer;
clientComp1.syncDirection = SyncDirection.ClientToServer;
clientComp2.syncDirection = SyncDirection.ClientToServer;

// change nothing
// clientComp.value = "42";

// serialize client object
serverIdentity.SerializeClient(ownerWriter);
clientIdentity.SerializeClient(ownerWriter);
Assert.That(ownerWriter.Position, Is.EqualTo(0));
}

Expand Down

0 comments on commit 19f23cb

Please sign in to comment.