Periodically throwed exception when in a room

I use PUN 1.76 with Photon Cloud.
When in a room it periodically throws exception (not permanent but very often):

IndexOutOfRangeException: Array index is out of range.
PhotonStream.ReceiveNext () (at Assets/Photon Unity Networking/Plugins/PhotonNetwork/PhotonClasses.cs:1006)
PhotonView.DeserializeComponent (UnityEngine.Component component, .PhotonStream stream, PhotonMessageInfo info) (at Assets/Photon Unity Networking/Plugins/PhotonNetwork/PhotonView.cs:378)
PhotonView.DeserializeView (.PhotonStream stream, PhotonMessageInfo info) (at Assets/Photon Unity Networking/Plugins/PhotonNetwork/PhotonView.cs:340)
NetworkingPeer.OnSerializeRead (System.Object[] data, .PhotonPlayer sender, Int32 networkTime, Int16 correctPrefix) (at Assets/Photon Unity Networking/Plugins/PhotonNetwork/NetworkingPeer.cs:4102)
NetworkingPeer.OnEvent (ExitGames.Client.Photon.EventData photonEvent) (at Assets/Photon Unity Networking/Plugins/PhotonNetwork/NetworkingPeer.cs:2394)
ExitGames.Client.Photon.PeerBase.DeserializeMessageAndCallback (System.Byte[] inBuff)
ExitGames.Client.Photon.TPeer.DispatchIncomingCommands ()
ExitGames.Client.Photon.PhotonPeer.DispatchIncomingCommands ()
PhotonHandler.Update () (at Assets/Photon Unity Networking/Plugins/PhotonNetwork/PhotonHandler.cs:156)

There is no my functions in call-stack, so i don't understand what it means. Can you help?


  • Hi @Demetri,

    This could be an issue with the custom data you're sending in the Photon event that is not supported by Photon Serialization. Probably related to a complex dictionary structure.

    Can you give us more information about the data you're sending? Log it maybe with C# types.
  • Demetri
    edited October 2016
    Hi, JohnTube!
    Sorry for long silence:)

    In OnPhotonSerializeView we send only single values of types supported by Photon (Vector3, Quaternion, float). Also (for other cases) we have several own types but their serializers/deserializers works well. Described error appears more seldom than we send our own type values.
  • Looks like the problem is gone.
    All, that we needed for we are transferring in OnPhotonSerializeView() at our script, which (script) included in ObservedComponents of PhotonView.
    The second component from this list was one from other child transforms. But, after the removing it from the list of "ObservedComponents", the errors was gone. It's working now.
    Looks like errors located somewhere in synchronization via "Transform" as one of PhotonView.ObservedComponents.