Buffered RPCs not received when Master Client quits/rejoins

Options
Having an issue where Buffered RPCs are not sent to a user rejoining a room. It occurs if the RPCs were sent from a Master Client, which then disconnected (thereby passing Master Client to another player in the room), and then rejoins the room as a regular player.

Step-by-step:
Join room on Client 1. Becomes master client. Triggers some buffered RPCs.
Join room on Client 2. Receives buffered RPCs.
Client 1 Disconnects from room. Client 2 becomes master client.
Client 1 Rejoins room. Does not receive any of the original RPCs. (It does receive RPCs that were sent by Client 2 after it became the master client.)

Note: this happens even if I completely close the game on Client 1 and restart. The RPCs are 'lost forever' for that client until all players disconnect.

Also Note: Client 2 can disconnect and rejoin just fine and receive all the buffered RPCs. It's only when the master client disconnects and rejoins.

Some context: I'm relying on buffered RPCs to track the properties of various bots in the room, or else I would just use PhotonPlayer properties. Right now I have the Master Client keep track of all the bots, and when new players enter the room it updates all the properties of the bots using buffered 'Configure player' RPCs. I'd be open to suggestions if there is a more effective way of handling this task.

Comments

  • Tobias
    Options
    We have a feature called "auto cleanup", which is causing the issue here. By default, anything a client sent or stored will be cleared when that user leaves.
    This is usually a good thing, as a lot of players might join a room over time and if nothing gets cleaned up, "history" piles up.

    You can create "scene" owned Game Objects with InstanciateSceneObject (or similar, writing this out of my head). RPCs will still be cleared.
    You can also turn autocleanup off. I think anything aside from player properties will stay cached. You can clean the cache yourself or if all players leave the room, everything gets cleaned up, too.
  • 82apps
    Options
    Thanks for the information, this makes sense based on what I observed.

    I worked around the issue by having any new room joiners poll the current Master Client for the most up-to-date player information, rather than relying on buffered RPCs.
  • Tobias
    Options
    Depending on how often things change, you could also use room properties. These stay in the room, no matter who is master.
    The Master Client (and anyone else in the room) gets a callback when someone new joins, so you can actively send missing info to the new player, too.
  • 82apps
    Options
    Thanks, I'll take a look. Would custom room properties be appropriate for keeping track of something like scores in a first-person shooter? (Or would that create too much traffic?)
  • Tobias
    Options
    Scores should be a good match, if they are not constantly changing like in a bullet-hell shooter.