Skip to content

Commit cafff75

Browse files
committed
fixes Send(string, object).
1 parent 91d457a commit cafff75

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

.editorconfig

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,7 @@ indent_size = 4
88
[*.{js,ts}]
99
indent_style = space
1010
indent_size = 2
11+
12+
[*.{cs}]
13+
indent_style = tab
14+
indent_size = 4

Assets/Plugins/Colyseus/Room.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ public async Task Send(string type, object message)
178178
byte[] initialBytes = { Protocol.ROOM_DATA, (byte) (encodedType.Length | 0xa0) };
179179
byte[] encodedMessage = serializationOutput.ToArray();
180180

181-
byte[] bytes = new byte[1 + encodedType.Length + encodedMessage.Length];
181+
byte[] bytes = new byte[encodedType.Length + encodedMessage.Length + initialBytes.Length];
182182
Buffer.BlockCopy(initialBytes, 0, bytes, 0, initialBytes.Length);
183183
Buffer.BlockCopy(encodedType, 0, bytes, initialBytes.Length, encodedType.Length);
184184
Buffer.BlockCopy(encodedMessage, 0, bytes, initialBytes.Length + encodedType.Length, encodedMessage.Length);

0 commit comments

Comments
 (0)