In pohton fusion How do i disconnect session in Shared mode and Can I know the cause of the disconn
The whole answer can be found below.
Try Our
Documentation
Please check if you can find an answer in our extensive documentation on Fusion.
Join Us
on Discord
Meet and talk to our staff and the entire Photon-Community via Discord.
Read More on
Stack Overflow
Find more information on Stack Overflow (for Circle members only).
In pohton fusion How do i disconnect session in Shared mode and Can I know the cause of the disconn
Dust101
2023-01-04 05:48:11
sorry because it's a google translator
I understand that disconnect session in Shared mode, NetworkRunner instance Release.
Is there another way to disconnect session?
If Disconnencted in an unexpected way (ex : app Forced Termination, Disconnect from the Internet)
How can i know Disconnencted Reasons? and How to Reconnect?
Comments
Isaac_Augusto
2023-01-04 12:46:11
Hi,
The NetworkRunnerCallbacks
gives you the OnShutdown callback, which have a ShutdownReason that you can use to know what cause the disconnection.
To reconnect, simply create a new NetworkRunner
and start it again. (Do not reuse NetworkRunners)
Isaac Augusto
Photon Fusion Team
Thank you very much for the help
Hi,
@Isaac_Augusto can you elaborate or point me to the documentation why not to reuse NetworkRunners?
Because I use runner.Shutdown and runner.StartGame on the same runner instance to move the player between different network sessions without problems (yet). But when the player gets disconnected due to some technical issues (ShutdownReason != OK) then it seems like I cannot reconnect using the runner.StartGame on the same instance.
Isaac_Augusto
2023-01-23 14:28:20
Hi @ManuKo ,
I cannot point to the specific motive, but the NetworkRunner was made to be discarded after you shutdown, that's the general rule.
Even if you're not having problems with it right now, I recommend you to create a new one every time you need it start a connection again.
This way, you can discard this as a cause for any problem that you might have. (I had problems with this myself)
Isaac Augusto
Photon Fusion Team
Hi! I am trying to implement a reconnect feature in the case of a network problem. When calling Runner.shutdown we can specify whether we want to destroy the associated game object. But, it seems we don't have this option when the runner is shutdown due to a Photon cloud timeout error for example. Is there a way to prevent the automatic destruction of the game object?
Back to top