PUN and room persistence

Hi!

I've looked through this topic on forums and all posts I found are quite old. So I'd like to refresh this info.
Can I use PUN in case I want to persist rooms after all players disconnect?
Does it support the ability to reconnect the game later?
I'm going to use Webhooks with Microsoft Azure for storage and will start with Turnbased backend example.

What features in PUN can or cannot be persisted? For example, can cached RPCs be stored?

Thanks

Comments

  • Hi @alandyshev,

    The Do's and Don'ts did not change for using PUN in a turn-based, async. or "persistent" games.

    What features in PUN can or cannot be persisted? For example, can cached RPCs be stored?
    Technically all buffered RPCs are cached and can be persisted and loaded but PUN's scene or room state can't be fully reconstructed out-of-the box.

    I saw that my colleague already recommended Plugins for you on another discussion.
    That's the best option but you can try the other ones if you want.
  • edited July 2017
    @JohnTube Thanks for your answer. I'm working on 2 games simultaneously, so I ask this for another game that has no server authoritative logic but needs to store room state between sessions.

    I cannot find OpLeave(false) and Rejoin analogs in PUN, so not sure how to persist room state.

    Do you recommend using PUN for such games or is it better to use LoadBalancing API?

    Thanks.
  • @JohnTube , what do you mean PUN's scene and room state can't be fully reconstructed out of the box? What doesn't end up not being reconstructed and what would one need to do to make that happen? Does Realtime support full scene reconstruction out of the box?
  • Hi @alandyshev,

    I'm really sorry I missed your comment or must have forgotten about it otherwise.
    I see it's from July 2017!

    I cannot find OpLeave(false) and Rejoin analogs in PUN, so not sure how to persist room state.
    It should be available now. Please re check.

    Do you recommend using PUN for such games or is it better to use LoadBalancing API?
    It depends on what PUN features do you rely on.

    Hi @talothman,

    Thank you for choosing Photon!

    I mean, there are some PUN features that do not play well with rejoin or room loading features.
    Meaning if someone leaves or rejoins or if the room is removed from Photon servers then loaded using webhooks the room state could not be 100% as when the player left.
    It's because parts of the room state are not saved as is but rather built step by step using buffered events and other sequences of events.
  • Hello, sorry but i can't use opLeave() without LoadBalancingClient, which i can't use as i'm using PUN 2 for my async game. how are we supposed to use it ?
  • Use PhotonNetwork.LeaveRoom(bool becomeInactive = true).
Sign In or Register to comment.