PUN - Any way to disable auto disconnect?
I've been implementing a lobby system for a fighting game with PUN, and everything has been quite smooth but I have a problem with being disconnected from photon automatically. I want to be able to support AFK spectators that just watch matches (like a stream) for but right now the client will eventually receive the OnDisconnectedFromPhoton callback and be kicked from the room. Seems to be variable timing, sometimes pretty soon or sometimes after 15+ minutes, ideally should go for much longer (hours). Does anyone have any advice for this?
Thanks
Thanks
0
Best Answers
-
Decided to update to PUN2 and try setting the PhotonNetwork.BackgroundTimeout to <0.1, seems to have worked out.0
-
Ran through some of the things in this very helpful doc (https://doc.photonengine.com/en-us/realtime/current/reference/analyzing-disconnects#check__resent_reliable_commands) and it seems to be working now.
- Made sure to call the service functions regularly (SendOutgoingCommands() and DispatchIncomingCommands())
- Lowered my send rate (I don't really need it to be super fast, only used for navigating UX)
- Upped the QuickResendAttempts and SentCountAllowance values0
Answers
-
Decided to update to PUN2 and try setting the PhotonNetwork.BackgroundTimeout to <0.1, seems to have worked out.0
-
Nvm it didn't0
-
Ran through some of the things in this very helpful doc (https://doc.photonengine.com/en-us/realtime/current/reference/analyzing-disconnects#check__resent_reliable_commands) and it seems to be working now.
- Made sure to call the service functions regularly (SendOutgoingCommands() and DispatchIncomingCommands())
- Lowered my send rate (I don't really need it to be super fast, only used for navigating UX)
- Upped the QuickResendAttempts and SentCountAllowance values0 -
Hi I was facing a similar issue and this forum post was instrumental in helping me get on the right track to finding a solution. Here is a video where I walkthrough how I ultimately solved this problem for anyone else interested: https://www.youtube.com/watch?v=f4FEs1agWVw
0