Cannot send op: 248 Not connected. PeerState: Disconnected in Offline mode

Options
Hi,
I am trying to add groups to the instantiation with:
int[] groups = new int[]
{
1,2,3,4,5
};
PhotonNetwork.SetReceivingEnabled(groups, null);

I call this after I call offline mode = true and join a room. I then get an error on that SetReceivingEnabled line:
Cannot send op: 248 Not connected. PeerState: Disconnected
LoadBalancingPeer:OpChangeGroups(Byte[], Byte[]) (at Assets/Photon Unity Networking/Plugins/PhotonNetwork/LoadbalancingPeer.cs:660)

I'm using Unity 5.4.2f2 and the latest version of PUN+ from the asset store (downloaded this week).
-JJ

Comments

  • Hi capitalj,

    to update interest groups you need to be connected to Photon. Also when using offlineMode you don't need to set interest groups, since you are not sending or receiving messages, which need to be filtered somehow. Can you maybe give us an example why you want to use groups in offlineMode?
  • capitalj
    Options
    Hi, I have set interest groups in general for all of my object instantiation and I use the same instantiation code in offline mode (ie: PhotonNetwork.Instantiate) but the objects don't instantiate if I don't set those groups to enabled first even in offline mode.

    So, I don't need the groups in offline mode, but I just want to use the same instantiation code in both offline and online.
  • capitalj
    Options
    Anyone have any thoughts on this?
  • capitalj
    Options
    So any help with this?
  • Sorry for the late response. When taking a look at the SetReceivingEnabled(int[] enableGroups, int[] disableGroups) function there is a this.OpChangeGroups(...) call at the end of this method, which actually throws the error mentioned in your origin post. You can try surrounding this by PhotonNetwork.offlineMode condition. Means:
    if (!PhotonNetwork.offlineMode)
    {
        this.OpChangeGroups(...);
    }
    Hopefully this is the solution you have waited for.
  • capitalj
    Options
    Thank you, I'll give that a try.