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
- There is no way to adjust the HDR Paper White value of the Unity Editor's interface, making it difficult/uncomfortable for some developers to work on very dark/bright scenes in HDR
- Animator window has a dropdown button that throws “MissingReferenceException” error on a new project when the previous project had a GameObject with an animation
- Animator State name overflows outside the visual box when the State has a long name
- UI Document file remains marked as Dirty after Undoing made changes
- Switching between UI Documents with different Canvas sizes marks the UXML file as dirty
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);