From f6c70bc7178aa2081464cf00490fe809f2cb5e21 Mon Sep 17 00:00:00 2001 From: Sem van der Hoeven Date: Tue, 20 Oct 2020 18:17:42 +0200 Subject: [PATCH] [FIX] message can now be 4 bytes long --- SharedClientServer/JSONConvert.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SharedClientServer/JSONConvert.cs b/SharedClientServer/JSONConvert.cs index 74f526c..a2b655a 100644 --- a/SharedClientServer/JSONConvert.cs +++ b/SharedClientServer/JSONConvert.cs @@ -59,7 +59,7 @@ namespace SharedClientServer // put the identifier at the start of the payload part res[4] = identifier; // put the length of the payload at the start of the res array - res[0] = BitConverter.GetBytes(payloadBytes.Length+5); + Array.Copy(BitConverter.GetBytes(payloadBytes.Length+5),0,res,0,4); return res; } }