NetworkServerTest: VariableSize message size adjusted for WriteBytesAndSize header

This commit is contained in:
vis2k 2021-06-18 13:51:24 +08:00
parent 8ded81fa20
commit e78304c465

View File

@ -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