From 19f23cb8f6172da209c72fe81a01a35db059c2da Mon Sep 17 00:00:00 2001 From: mischa Date: Mon, 15 Jul 2024 14:05:58 +0200 Subject: [PATCH] NetworkIdentitySerializationTests: fix SerializeClient_NotInitial_NotDirty test setup so it actually would serialize if dirty --- .../NetworkIdentity/NetworkIdentitySerializationTests.cs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Assets/Mirror/Tests/Editor/NetworkIdentity/NetworkIdentitySerializationTests.cs b/Assets/Mirror/Tests/Editor/NetworkIdentity/NetworkIdentitySerializationTests.cs index 25e8c8dc9..9b8eab08e 100644 --- a/Assets/Mirror/Tests/Editor/NetworkIdentity/NetworkIdentitySerializationTests.cs +++ b/Assets/Mirror/Tests/Editor/NetworkIdentity/NetworkIdentitySerializationTests.cs @@ -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)); }