Cached Events being sent twice on rejoin

Im only getting getting this problem when I create a room, raise some events (they go to a webhook and are addedToRoomCache, webhook doesnt do anything), then i click a onGui button to OpLeaveRoom(true), (300000 emptyRoomTtl and -1 PlayerTtl) and then it loads a different scene. without exiting the app, i click another button that loads the game scene and calls ReJoinRoom("roomname"). If i do this, each of my cached events is sent twice. If I leave room by using clientDisconnect (pressing the play button in unity editor), the cached events are only sent once the next time i join. Any guess as to why?

I also noticed that when sending OpLeaveRoom(true) to webhooks, the type is "LeaveRequest" rather than "ClientDisconnect" as the Photon Docs state it should be. Dont know if this is a bug, or a problem on my side. Thanks for any help given!

Best Answer

  • LaundryOnMyAbs
    Answer ✓
    I solved this. Problem was that i was OnEventCall += event in the start method of the gameObject that controlled the gameScene. This meant that unless Disconnect() was called from photon, it would add each event a second time to the photon network. Just in case anyone has a similar problem in the future.

Answers

  • LaundryOnMyAbs
    Answer ✓
    I solved this. Problem was that i was OnEventCall += event in the start method of the gameObject that controlled the gameScene. This meant that unless Disconnect() was called from photon, it would add each event a second time to the photon network. Just in case anyone has a similar problem in the future.