MasterClient Application Pause

The whole answer can be found below.

Please note: The Photon forum is closed permanently. After many dedicated years of service we have made the decision to retire our forum and switch to read-only: we've saved the best to last! And we offer you support through these channels:

Try Our
Documentation

Please check if you can find an answer in our extensive documentation on PUN.

Join Us
on Discord

Meet and talk to our staff and the entire Photon-Community via Discord.

Read More on
Stack Overflow

Find more information on Stack Overflow (for Circle members only).

Write Us
an E-Mail

Feel free to send your question directly to our developers.

MasterClient Application Pause

ThomasKao_XRSpace
2021-11-19 07:21:59

Hi:

My mobile app recently meet a problem that Scene/Room Objects that maintained by MasterClient through OnPhotonSerializeView. As long as the MC working, it seems perfect fine.

Since it is mobile app, user can unexpectedly pause/ out of focus, when the master client hang and someone just join the room, those states are lost. Because of the new comer are not yet becoming master client, objects are network instantiated at the first position, last position which must be synced through OnPhotonSerializeView are lost.

Is there any method to alleviate this situation?

first thing come to my mind is to record these states in RoomProperties, is it reasonable to having husbands of scene objects in this scenario?

Comments

JohnTube
2021-11-19 21:01:41

Hi @ThomasKao_XRSpace,

Did you take a look at our recommendations for handling this case?

See last one at the bottom.

hyperbting
2021-11-20 04:33:43

Hi:

For the 4 "handle the background Master Client scenario"

Are the first two to PhotonNetwork.Disconnect() or LeaveRoom() When Application.OnApplicationPause(bool)?

I remember those two might not be finished in time at Application.OnApplicationPause. Did I have wrong concept about it?

And for the forth, I tried PhotonNetwork.networkingPeer.StopThread(), but the paused player was still linger for a while, even when setting PhotonHandler's KeepAliveinBackground and Room's playerTtl to 0.

For now, the last hope for me is the masterclient alive detection, I guess I will ping MasterClient onJoinRoom and takeover MasterClient if have to.

Back to top