diff --git a/Assets/Mirror/Tests/Editor/NetworkServerTest.cs b/Assets/Mirror/Tests/Editor/NetworkServerTest.cs index afa2213af..7a1c8961f 100644 --- a/Assets/Mirror/Tests/Editor/NetworkServerTest.cs +++ b/Assets/Mirror/Tests/Editor/NetworkServerTest.cs @@ -11,8 +11,11 @@ struct TestMessage1 : NetworkMessage {} struct VariableSizedMessage : NetworkMessage { + // weaver serializes byte[] wit WriteBytesAndSize public byte[] payload; - public VariableSizedMessage(int size) => payload = new byte[size]; + // so payload := size - 4 + // then the message is exactly maxed size. + public VariableSizedMessage(int size) => payload = new byte[size - 4]; } public class CommandTestNetworkBehaviour : NetworkBehaviour