RPCs after user reconnects

Options
Hi,

I'm trying to ask 3rd time here, please :)

Is there any possibility in photon to resend all rpc's which weren't received by photon server. Or at least get their list ? For us this is major issue after user lost connection and reconnects back to game. We want those RPC's to be executed.


Thanks

Comments

  • Tobias
    Tobias admin
    edited August 2016
    Options
    Sorry you didn't get a reply in the first attempt.

    I guess you have to refactor how your game's state is kept.
    RPCs are Photon events. Those can be buffered but if you do that for a longer time, the buffer might become too big to be sent to new/returning players.
    Unless you need the (growing) history of the gameplay, you might want to use Custom Properties, to store the current state of the game.

    Did you find and read this?
    https://doc.photonengine.com/en/pun/current/tutorials/synchronization-and-state
  • Tobias
    Options
    Aside from that: If the server didn't get the RPC, it's of course not able to repeat that. How should it know?
    Can you give us a brief example what you're experiencing?
  • wawro1
    Options
    Thanks a lot,

    All I want is to minimize problems for users with bad connection. I guess when RPC is recieved by server it will send back to client confirmation packet - we are using UDP here, is this right ? So client could know which RPC's weren't received by server and after reconnection do something about it.

    We have 1v1 game, where players can send theirs units. We had some problems with desyncing game states after master client looses his connection and doesn't know about it for a while. He can send some units by RPC's and client will not recieve them after master reconnects.

    Since the game is 1v1 and no other players can join to game later, for us repeating of not received RPC's would be enough, but I know that proper syncing solution is better. Units in game can die and re-spawn pretty quickly, so using buffered RPC's is not good solution. Also because of this fact storing those units to player custom properties would cost some data overhead. I would need to store all players units with every spawn or death. I think, that I will design some "big RPC" which will send whole battlefield state and will be send after some of the players will reconnect to game.



  • Tobias
    Options
    Our reliable UDP protocol does send ACKs for commands but we don't expose that in the API for developers. On a lower level, it just makes sure we can re-send something, should it fail to arrive (and be ACKd) in time.
    As said: When a connection drops and you re-connect, we don't know how much of the data is still relevant, so we clear outgoing queues.

    The game itself has to make sure it can make sense of the last state that arrived at the server and if there is anything that was not yet applied/forwarded by the server, the game has to send whatever it needs to send still.

    When a player's connection drops, the game's state can be kept in Unity. You need to use that to re-send and sync both players once more. Make sure the "big RPC" is not huge and you should be fine :)