Skip to content

Commit

Permalink
fixes Send(string, object).
Browse files Browse the repository at this point in the history
  • Loading branch information
endel committed Apr 23, 2020
1 parent 91d457a commit cafff75
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,7 @@ indent_size = 4
[*.{js,ts}]
indent_style = space
indent_size = 2

[*.{cs}]
indent_style = tab
indent_size = 4
2 changes: 1 addition & 1 deletion Assets/Plugins/Colyseus/Room.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit cafff75

Please sign in to comment.