Disconnect from Photon when game running *idle* except for data collection on specific object

RayFRayF
Greetings, I am getting this strange disconnect after about 10-15 minutes from photon (unity). Do you keep a time out if no activity is going on in general? Otherwise I can't see what would make this happen. I literally start the game and leave it without doing anything.

This is my error
Operation RaiseEvent (253) can't be sent because peer is not connected, peer state: Disconnected
UnityEngine.Debug:LogError(Object)
Photon.Realtime.LoadBalancingClient:DebugReturn(DebugLevel, String) (at Assets/Photon/PhotonRealtime/Code/LoadBalancingClient.cs:2393)
Photon.Realtime.LoadBalancingClient:CheckIfOpCanBeSent(Byte, ServerConnection, String) (at Assets/Photon/PhotonRealtime/Code/LoadBalancingClient.cs:2330)
Photon.Realtime.LoadBalancingClient:OpRaiseEvent(Byte, Object, RaiseEventOptions, SendOptions) (at Assets/Photon/PhotonRealtime/Code/LoadBalancingClient.cs:2018)
Photon.Pun.PhotonNetwork:RaiseEvent(Byte, Object, RaiseEventOptions, SendOptions) (at Assets/Photon/PhotonUnityNetworking/Code/PhotonNetwork.cs:2207)
DataGatherer:SendPerFrame() (at Assets/TCXR/Scripts/Experience/Metrics/DataGatherer.cs:120)
DataGatherer:Update() (at Assets/TCXR/Scripts/Experience/Metrics/DataGatherer.cs:56)


The DataGatherer is where we call every frame to store information (so obviously all our code segments that are activated by Update() run, but other than data collection nothing else will do things. This code segment does a PhotonNetwork call
PhotonNetwork.RaiseEvent(ACTION_EVENT, data, new RaiseEventOptions { Receivers = ReceiverGroup.MasterClient }, SendOptions.SendReliable);

Any thoughts?

Comments

  • Hi @RayF,

    This is not Photon Voice specific so I'll move it to PUN category.

    First you need to figure out when, how often and especially why the client disconnected.
    Implement OnDisconnected callback.
    Read more about disconnects here.
Sign In or Register to comment.