Search Issue Tracker
Fixed in 5.3.0
Votes
1
Found in
5.2.1p3
Issue ID
736703
Regression
Yes
[UNET] SyncList passes wrong itemIndex to callback method when the operation is OP_ADD
Reproduction steps:
1. Open attached project
2. Open and play the "offline" scene
3. Start host (the "LAN Host (H)" button)
4. Observe console, the itemIndex is 1 when the operation is OP_ADD.
Expected result: The itemIndex should be 0 when the operation is OP_ADD.
Note: With other operations such as OP_SET, the itemIndex is 0.
Regression from first not working version: 5.2.0f1 (89160207ce1a)
Comments (2)
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- The Game view and Scene view fail to render when launching the Editor with a maximized Render Graph Viewer window
- "List is empty" is poorly visible in the "Create Node" window
- [Android] GameObject with a custom shader becomes invisible when deployed with the Vulkan Graphics API
- “ReferenceError: Pointer_stringify is not defined” error is thrown when downloading a file
- GameObjects are not rendered when using a fragment shader with RWStructuredBuffer in URP
RikuTheFuffs
Jul 18, 2017 12:06
Looks like it appeared again on 5.5.4p3, same thing for the OP_REMOVE. Using OP_REMOVEAT works as a workaround
ekleban
Feb 09, 2016 16:43
I have the same issue with OP_UPDATE. See the code inside the networking dll below.
Unity passes itemIndex=0 as it was written at the server side.
I have no way to know what item was removed at the client side!
Moreover, if I knew the index, it would already be removed from the list!
Thanks.
server:
this.SendMsg(SyncList<T>.Operation.OP_REMOVE, 0, item);
...
writer.WritePackedUInt32((uint) itemIndex);
client:
int index = (int) reader.ReadPackedUInt32();
T obj = this.DeserializeItem(reader);
...
this.m_Objects.Remove(obj);
...
this.m_Callback((SyncList<T>.Operation) num, index);