Buffered PUNRPC is not called when a player reconnects (Closes the game and plays the game again)

I upgraded to the latest version of the Plugin UnityPUN 2.16 and before, which was like a couple of months ago, was working when I was testing multiplayer by doing the following:

1. Player 1 creates the room and is the master client
2. Player 2 joins the random room of Player 1 and the "_OnInstantiatePlayer" from a buffered all RPC from Player 1 is called.
3. Since Player 2 is new, Player 1 also receives the "_OnInstantiatePlayer" buffered all RPC from player 1
4. Player 1 leaves the room making Player 2, the new master client.
5. Player 2 Quits the game (Imagine the play button in unity editor is turned off) and rejoins tha same game and room (Imagine the play button in unity editor is turned on and shortcuts to the same mission).
6. The player is recognized as it Joins the room of Player 1 since it is in the player list.
7. Player 1 joins the random room of Player 2 and the "_OnInstantiatePlayer" from a buffered all RPC from Player 2 is called, instantiating the player in the client of Player 1

The problem is that, based on the latest update, Number 7, never happens anymore so the flow is broken and the buffered RPC call never reaches Player 1 anymore and Player 2 is not instantiated on Player 1's client. But Player 1 is instantiated on Player 2's client.

Is there something new to be done in this case or a setting to be changed?

Thank you very much for the assistance regarding this matter.

Comments

  • JohnTube
    JohnTube ✭✭✭✭✭
    Hi @hdavid_bpg,

    Thank you for choosing Photon!

    I don't think we changed something in PUN itself.

    So make sure that:

    Does player 1 become inactive and then rejoins the room as the same actor / user (same ActorNumber / UserId) ? Or player 1 leaves the room for good and joins it again as a new actor?

    In any case, in order for cached/buffered events to remain in the room even if the player leaves it:

    - make the cached event global (does not work w/ RPC, works w/ RaiseEvent)
    - make the player not leave the room (PlayerTTL != 0 and use RejoinRoom or ReconnectAndRejoin w/ the same UserId)
    - make the room not clean up cached events of players who leave (RoomOptions.CleanupCacheOnLeave = false)