Managing buffered RPCs when clients are rejoining

Hello!

How to manage the situaton where any player temporarily (perhaps for just a minute or so) leaves the game fo something, i.e. check sms, and thereafter would lika to continue tha game.

The challenge I have is that alrady executed RPCs are executed again when client rejoinsroom.

I am happy for any ideas on these matters. Good tutorials, Youtube videos, Lessons on Udemy or similar. If there is anyone having the knowledge and may be willing to spend some time to look at the code (maybe over teams-meeting) that would be really awesome.

Gameplay:

- Letters are being instatiated on a shared game board

- Each player (once it is their turn) may click on them to crate words which gives scores

- Each turn lasts less than a minute

- During each turn the player which is not in turn sees tha other players selections in realtime

- There is also an element of each player have cards to be played which effects gameplay and needs to be visisble in realtime for both players

Answers

  • Hi @Mikael,

    You are probably using Buffered RPCs which are cached events.

    You need to remove or clear those buffered RPCs once you don't need them.

    Or keep track locally per client of which buffered RPCs (events/moves/turns) were already received and ignore/skip those already received/processed.


    There is also PunTurnManager utility class in case you missed it, it might not be what you are looking for but it's worth checking out.

  • Mikael
    Mikael
    edited October 13

    Thanks @JohnTube for your reply,

    Yes I am using Buffered RPCs. I would very much appreciate some info/example on how I locally may keep track per client of wich buffered RPCs that were already received and run and thereby skip those.

    Many thanks in advance.

  • There is no built-in ID for the events. If you want to deliberately remember and later skip repeats of RPCs, then you probably have to add an id per RPCs (e.g. an int).