Search Issue Tracker

Fixed

Fixed in 1.2.1

Votes

0

Found in [Package]

1.1.0

Issue ID

NCCBUG-187

Regression

Yes

Netcode package throws an OverflowException when connecting a second client to the host and trying to read ConnectionApprovedMessage

Package: Multiplayer Netcode for GameObjects

-

Reproduction steps:

# Open the attached “NGO-Repro” project
# Press File → Build Settings → Build
# Launch two instances of the Player
# In the first instance press the Host button
# In the second instance press the Join button
# In the Editor open the “Bootstrap” scene
# Enter the Play Mode
# In the Game view press the Join button
# Observe the Console in the editor

Expected result: OverflowException is not thrown
Actual result: OverflowException is thrown

Reproducible with: 1.1.0 (2022.1.23f1, 2022.2.0b16, 2023.1.0a20)
Not reproducible with: 1.0.2 (2022.1.23f1, 2022.2.0b16, 2023.1.0a20)
Could not test with: 1.0.2, 1.1.0 (2020.3.42f1, 2021.3.14f1) (either errors during build or before building)

Reproduced on: Windows 10

First lines of exception:
OverflowException: Reading past the end of the buffer
Unity.Netcode.FastBufferReader.ReadBytesSafe (System.Byte* value, System.Int32 size, System.Int32 offset) (at Library/PackageCache/com.unity.netcode.gameobjects@1.1.0/Runtime/Serialization/FastBufferReader.cs:679)
Unity.Netcode.FastBufferReader.ReadUnmanagedSafe[T] (T& value) (at Library/PackageCache/com.unity.netcode.gameobjects@1.1.0/Runtime/Serialization/FastBufferReader.cs:733)
Unity.Netcode.FastBufferReader.ReadValueSafe[T] (T& value, Unity.Netcode.FastBufferWriter+ForStructs unused) (at Library/PackageCache/com.unity.netcode.gameobjects@1.1.0/Runtime/Serialization/FastBufferReader.cs:832)

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.