Cached Events vs. Live Events

When our client disconnects, we rejoin the room using OpReJoinRoom.

This does rejoin the room, but when it does it receives ALL the cached events, including the items that were originally added by the current actor.

Am I missing something? The documentation says that the original actor should not get those events on a join.

Also, is there a way to determine if an event coming in a a cached or live event? Right now we're keeping a count of event "processed" prior to a disconnect, and then ignoring that many events on a rejoin; is this good practice?

Comments

  • JohnTube
    JohnTube ✭✭✭✭✭
    Hi @Treadon,

    Thank you for choosing Photon!

    Am I missing something? The documentation says that the original actor should not get those events on a join.
    Could you point me to which documentation page I can read this? behavior depends on multiple factors like: if event was cached using AddToRoomCache vs. AddToRoomCacheGlobal and if the room is created with DeleteCacheOnLeave/CleanUpCacheOnLeave enabled or not.

    Also, is there a way to determine if an event coming in a a cached or live event?
    No sorry. But there is a possible hint, if the sender ActorNr is not present or is 0 and the event code is custom then it can only be a ("global") cached event (re)sent.
    is this good practice?
    Personnally I think it's a good idea to keep track locally of which events are pending/received/sent successfully/processed etc. So you could have a cached list/queue on client side.
  • On the cached events documentation, it says events added to the actor cache are sent to any joining member except the original sender.

    But if I rejoin a room, I get all the events, including the ones in my actor cache.


  • JohnTube
    JohnTube ✭✭✭✭✭
    Hi @Treadon,

    OK. I see, thanks.

    What do you use? AddToRoomCache or AddToRoomCacheGlobal?

    how do you rejoin rooms? Do you re use same UserId and call Rejoin or ReconnectAndRejoin?
    I just want to make sure you rejoin with the same ActorNr.
  • I am using Rejoin.

    I am unity C#/Unity, I did not see a "ReconnectAndRejoin" option, how can it be accessed?
  • JohnTube
    JohnTube ✭✭✭✭✭
    I see. ReconnectAndRejoin is a PUN1/2 feature only for now. It will be available in the next major release of Photon Realtime's Unity/C#/.Net SDKs.
    What about this: "AddToRoomCache or AddToRoomCacheGlobal?"
  • I ended up assigning a unique hash to each message and logging all messages that are processed, then ignoring and dupes.

  • Hi treadon,
    hope you are doing well.
    I want to know how you are doing that, If possible can you help me that.