Transfer Master Client, SPAWN

Options
Conflict Master of Clients

In my online game there is an advertisement that stops the game.

In this regard, I introduced the Master Client transfer function (the client will be picked up by the Master Client if the previous Master Client is not in focus for 4 seconds)

But there is one problem

Advertising can start during spawn and the Master Client can first spawn itself and fall asleep (advertising or out of focus), but Photon does not have time to send a signal to the server and customers continue to wait in the lobby. The next client after the timeout takes the Master Client and spawns all the players. Then the old Master Client gets out of sleep and sends a spawn signal to the server and everyone will spawn again, breaking the room and the game.

Please, prompt the decision. How to simultaneously send a signal for 1 frame.

Comments

  • Hi @Dimar,

    have you tried using either the OnApplicationFocus(bool) or the OnApplicationPause(bool) function? Inside those functions, you can try to use PhotonNetwork.SendOutgoingCommands() in order to send something immediately.
  • Dimar
    Options
    Thank you. PhotonNetwork.SendOutgoingCommands() was really what i looked for. It wasnt working in OnApplicationPause though, so I used it after important RPC calls.