Switching MasterClient

Options
I'm relatively new to Photon and an unsure of the best way to design a multi-player application to cope with the MasterClient leaving the game. The application is for a relatively small number of players (up to 10) but manages quite a large amount of data (about 50K). This data is currently managed by the masterclient in the form of a number of singleton manager scripts. The data is gradually built up during the game and is used to determine much of the AI. All of these scripts are currently only populated on the masterclient. This causes a problem if the masterclient leaves as the new masterclient doesn't have any of the control data. I'm unsure on the best way of passing this data to the new masterclient. I could send all data changes to all clients by RPC whenever a change occurs so that all clients are in sync, but this seems quite a performance overhead to cater for what should be a very unlikely event (masterclient leaving). Is there a better approach that I should be considering?

Comments

  • vadim
    Options
    Since master client may leave room suddenly any time, the only reliable way to supply new master with current data is keeping it up-to-date on all clients. RPC is most efficient way do so. You may also consider custom room properties for storing shared data. These properties are easier to handle than RPC.
  • vadim - thanks for the feedback. That was the conclusion I was reaching, but just wanted to make sure I wasn't missing anything.