Using "public void OnDisconnected ()"
Options
Hello. Sorry for wasting your time but I am a noob! (total noob! even in c#).
After Connecting to a server:
And:
I'd liked to use:
to trigger some events (methods) ... So as a dumb I turned off my Wi-Fi but method is not triggered (a simple Debug.Log saying "Your Connection with Server is Lost").
What Am I doing wrong? I was expecting that message to pop out in my console!
Thanks!
After Connecting to a server:
PhotonNetwork.ConnectUsingSettings();
And:
public override void OnConnectedToMaster () { }
I'd liked to use:
public void OnDisconnected () {}
to trigger some events (methods) ... So as a dumb I turned off my Wi-Fi but method is not triggered (a simple Debug.Log saying "Your Connection with Server is Lost").
What Am I doing wrong? I was expecting that message to pop out in my console!
Thanks!
0
Comments
-
Hi @Funesto,
You are probably extending
so you need to overrideOnDisconnected(DisconnectCause)
like did forOnConnectedToMaster
.public override void OnDisconnected(DisconnectCause) { Debug.Log("Your Connection with Server is Lost"); }
And you may need to wait up to 10 seconds (client timeout period) for the disconnection callback to be triggered in some cases.1