diff --git a/.editorconfig b/.editorconfig index a8edecbc..9bc50990 100644 --- a/.editorconfig +++ b/.editorconfig @@ -8,3 +8,7 @@ indent_size = 4 [*.{js,ts}] indent_style = space indent_size = 2 + +[*.{cs}] +indent_style = tab +indent_size = 4 diff --git a/Assets/Plugins/Colyseus/Room.cs b/Assets/Plugins/Colyseus/Room.cs index 159a939b..3767725c 100644 --- a/Assets/Plugins/Colyseus/Room.cs +++ b/Assets/Plugins/Colyseus/Room.cs @@ -178,7 +178,7 @@ public async Task Send(string type, object message) byte[] initialBytes = { Protocol.ROOM_DATA, (byte) (encodedType.Length | 0xa0) }; byte[] encodedMessage = serializationOutput.ToArray(); - byte[] bytes = new byte[1 + encodedType.Length + encodedMessage.Length]; + byte[] bytes = new byte[encodedType.Length + encodedMessage.Length + initialBytes.Length]; Buffer.BlockCopy(initialBytes, 0, bytes, 0, initialBytes.Length); Buffer.BlockCopy(encodedType, 0, bytes, initialBytes.Length, encodedType.Length); Buffer.BlockCopy(encodedMessage, 0, bytes, initialBytes.Length + encodedType.Length, encodedMessage.Length);