Unity SDK version 2.0.1
Hello developers,
This release contains a critical fix for an issue happening when the server sends large packets to the clients (which can happen for instance during high lobby activity).
When this bug is triggered, the client is able to send packets, but no packets can be received from the server, leading to an apparent disconnection.
It’s compatible with the SDK 2.0.0 and changes very few lines. So be sure to get the Asmodee.net Unity SDK 2.0.1.
Alternatively, if you are not ready to move to a 2.x.x version, we highly recommend to apply the following patch to your installed SDK to avoid the issue.
In ServerConnection.cs
, change the method GetSize()
as follows:
- private int? GetSize(byte[] array)
+ public static int? GetSize(byte[] data)
{
- if (array.Length < 4)
+ if (data.Length < 4)
return null;
- byte[] sizeByte = new byte[4];
- Array.Copy(array, sizeByte, 4);
- Array.Reverse(sizeByte);
- int size = BitConverter.ToInt16(sizeByte, 0);
+ int size = data[0] << 24;
+ size += data[1] << 16;
+ size += data[2] << 8;
+ size += data[3] << 0;
if (size == 0)
return null;
Got an issue? Write us at support-dev@asmodee.net.
The Asmodee Digital team