Mirror
Mirror copied to clipboard
After updating to version 95.1.6, desynchronization was observed,
After updating to version 95.1.6, desynchronization was observed, and the issue appears to be caused by this particular logic segment.
byte[] payloadCopy = new byte[message.payload.Count];
Array.Copy(message.payload.Array, message.payload.Offset, payloadCopy, 0, message.payload.Count);
SpawnMessage messageCopy = new SpawnMessage
{
netId = message.netId,
spawnFlags = message.spawnFlags, // Preserves isOwner and isLocalPlayer via flags
sceneId = message.sceneId,
assetId = message.assetId,
position = message.position,
rotation = message.rotation,
scale = message.scale,
payload = new ArraySegment<byte>(payloadCopy)
};
spawned[message.netId] = identity;
pendingSpawns[identity] = messageCopy;
The issue still persists after updating to version v96.0.1.
The issue still persists after updating to version v96.0.1.
Elaborate on what you mean by "desynchronization". How to reproduce using any of our examples?
I've found that this is the cause of the problem. Calling SetClientReady multiple times under certain error conditions may lead to pendingSpawns.Clear();. Should I add if (conn.isReady) return; inside SetClientReady?