0
votes

We need to create a game with 10 + 1 users. 10 players will be real users - in this multiplayer online game. The 1 player is a dealer which will be the app software - who will work like a dealer. This dealer will NOT be a real player. This dealer will be throwing DICE.

How can we do it in photon PUN ? We are using the FREE version of photon right now.

1

1 Answers

1
votes

Depending on the Photon client SDK you use, you should have a callback of when Master Client is changed (should be "OnMasterClientSwitched"). This is triggered when server detects that Master Client is disconnected. Master Client should be the actor with the lowest actor number but there is a way to force the Master Client (change it from client). If you save data in room properties or send events and maybe cache them, then there is no risk of data loss as it will be there as long as the room is still "alive". Actor properties on the other side, should be cleaned up when the respective actor leaves the room.

One tricky situation though: when the Master Client is not responding and did not explicitly disconnect, there may be few seconds (default timeout 10seconds) before the server detects that that actor timed out and switches to new one. If this situation concerns you, for instance if you target mobile, we can discuss possible solutions.