Search Unity

ReadByte out of range:NetBuf sz:24 pos:24

Discussion in 'Multiplayer' started by martaaay, Jun 21, 2017.

  1. martaaay

    martaaay

    Joined:
    Apr 13, 2009
    Posts:
    136
    I've been working on this for months, but it's still broken. It happened on Unity 5.5 and now on 5.6.1f1. I get this message when starting a round, and then nothing will ever sync again. It seems to happen very regularly with an Android build playing multiplayer with anybody else, and it's not consistent. I don't use any manual OnSerialize or OnDeserialize. Any ideas what could be causing this and where to go next in terms of debugging? This is now a blocker for shipping for me.

    IndexOutOfRangeException: NetworkReader:ReadByte out of range:NetBuf sz:24 pos:24
    UnityEngine.Networking.NetBuffer.ReadByte () (at /Users/builduser/buildslave/unity/build/Extensions/Networking/Runtime/NetworkBuffer.cs:35)
    UnityEngine.Networking.NetworkReader.ReadUInt32 () (at /Users/builduser/buildslave/unity/build/Extensions/Networking/Runtime/NetworkReader.cs:202)
    UnityEngine.Networking.NetworkReader.ReadSingle () (at /Users/builduser/buildslave/unity/build/Extensions/Networking/Runtime/NetworkReader.cs:283)
    UnityEngine.Networking.NetworkReader.ReadQuaternion () (at /Users/builduser/buildslave/unity/build/Extensions/Networking/Runtime/NetworkReader.cs:374)
    BetterNetworkTransform.OnDeserialize (UnityEngine.Networking.NetworkReader reader, Boolean initialState)
    UnityEngine.Networking.NetworkIdentity.OnUpdateVars (UnityEngine.Networking.NetworkReader reader, Boolean initialState) (at /Users/builduser/buildslave/unity/build/Extensions/Networking/Runtime/NetworkIdentity.cs:750)
    UnityEngine.Networking.ClientScene.ApplySpawnPayload (UnityEngine.Networking.NetworkIdentity uv, Vector3 position, System.Byte[] payload, NetworkInstanceId netId, UnityEngine.GameObject newGameObject) (at /Users/builduser/buildslave/unity/build/Extensions/Networking/Runtime/ClientScene.cs:491)
    UnityEngine.Networking.ClientScene.OnObjectSpawnScene (UnityEngine.Networking.NetworkMessage netMsg) (at /Users/builduser/buildslave/unity/build/Extensions/Networking/Runtime/ClientScene.cs:608)
    UnityEngine.Networking.NetworkConnection.HandleReader (UnityEngine.Networking.NetworkReader reader, Int32 receivedSize, Int32 channelId) (at /Users/builduser/buildslave/unity/build/Extensions/Networking/Runtime/NetworkConnection.cs:469)
    UnityEngine.Networking.NetworkConnection.HandleBytes (System.Byte[] buffer, Int32 receivedSize, Int32 channelId) (at /Users/builduser/buildslave/unity/build/Extensions/Networking/Runtime/NetworkConnection.cs:425)
    UnityEngine.Networking.NetworkConnection.TransportReceive (System.Byte[] bytes, Int32 numBytes, Int32 channelId) (at /User
     
  2. martaaay

    martaaay

    Joined:
    Apr 13, 2009
    Posts:
    136
    I turned on higher logging and found that it happens after loading this object. Incidentally, this prefab has multiple networkidentity's in it, which unity complains about ("doesn't support"). Does anybody know if this could be causing my problem? Reason I ask is pulling these apart is going to be a pain.