RPCs stopped working in Offline Mode
Options
carmine
✭✭
If I'm in offline mode, and I send an RPC to MasterClient, this always errors inside of NetworkPeer.cs.
This is because mMasterClient is always NULL. (so it never executes the RPC) I fixed this by doing this:
But the problem is if the PUN updates my fix will get wiped out. Hoping Tobias or someone can investigate. (I have the most recent PUN)
else if (target == PhotonTargets.MasterClient) { if (this.mMasterClient.ID == this.mLocalActor.ID) { this.ExecuteRpc(rpcEvent, this.mLocalActor); } else { RaiseEventOptions options = new RaiseEventOptions() { Receivers = ReceiverGroup.MasterClient, Encrypt = encrypt }; this.OpRaiseEvent(PunEvent.RPC, rpcEvent, true, options); } }
This is because mMasterClient is always NULL. (so it never executes the RPC) I fixed this by doing this:
else if (target == PhotonTargets.MasterClient) { if (PhotonNetwork.offlineMode) { this.ExecuteRpc(rpcEvent, this.mLocalActor); } else if (this.mMasterClient.ID == this.mLocalActor.ID) { this.ExecuteRpc(rpcEvent, this.mLocalActor); } else { RaiseEventOptions options = new RaiseEventOptions() { Receivers = ReceiverGroup.MasterClient, Encrypt = encrypt }; this.OpRaiseEvent(PunEvent.RPC, rpcEvent, true, options); } }
But the problem is if the PUN updates my fix will get wiped out. Hoping Tobias or someone can investigate. (I have the most recent PUN)
0
Comments
-
I updated PUN to 1.53 for various fixes of the Master Client workflow but I missed the offline mode.
I will fix it in 1.54.
My idea would be to fix NetworkingPeer.mMasterClientId. It should return the local actor when in offline mode:
[code2=csharp]if (PhotonNetwork.offlineMode) return this.mLocalActor.ID;[/code2]
Sorry for the hassle and thanks for the report.0