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
- "Reflection Probe" borders disappear when interacting with the UI in the Inspector and one of the Reflection Probe editing tools is selected during the Baking process
- RenderGraph ContextData buffer leaks in IL2CPP when using Native Leak Detection
- Caret in "Add Default Preset" text field is vertically misaligned in Preset Manager
- Unused separation line is present at the bottom of the create GameObject sub menu when right clicking Scene in the Hierarchy
- Text cursor and text highlighting is misaligned and cut off in the search bar when typing something and highlighting text in the "Add Default Preset" window
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);