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)
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 Scene View becomes gray and "NullReferenceException" errors are thrown when attaching the Unity Editor process to RenderDoc
- Memory usage rapidly rises when changing colors in the color wheel
- Physically Based Sky's Horizon and Zenith Tint Color Selection Bars don't have immediate access to color pickers
- EmptyAdditionalLightShadowmapTexture leaks from memory when URP quality level is changed using QualitySettings.SetQualityLevel
- Referenced ScriptableObject field does not get updated and cannot be set to "None" when there are no Objects of that type
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);