Mirror icon indicating copy to clipboard operation
Mirror copied to clipboard

After updating to version 95.1.6, desynchronization was observed,

Open dannisliang opened this issue 1 year ago • 2 comments

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;

dannisliang avatar Mar 17 '25 03:03 dannisliang

The issue still persists after updating to version v96.0.1.

dannisliang avatar Mar 17 '25 05:03 dannisliang

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?

MrGadget1024 avatar Mar 18 '25 17:03 MrGadget1024

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?

dannisliang avatar Jun 17 '25 06:06 dannisliang