Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Client.ClientDisconnected and Client.Disconnected not working #49

Closed
ameel opened this issue Jun 23, 2022 · 2 comments
Closed

Client.ClientDisconnected and Client.Disconnected not working #49

ameel opened this issue Jun 23, 2022 · 2 comments
Labels
User Error This issue was caused by user error

Comments

@ameel
Copy link

ameel commented Jun 23, 2022

Hi,

I have the following code in my Start():
Client.Disconnected += DidDisconnect; Client.ClientDisconnected += DidDisconnect; Client.ConnectionFailed += FailedToConnect;

and

private void DidDisconnect(object sender, EventArgs e){ Debug.Log("@DidDisconnect"); }

Client.ClientConnected += DidConnect; works

When server is closed, and client is disconnected, unity debug shows:

(CLIENT): Disconnected from server (initiated remotely).
UnityEngine.Debug:Log (object)
RiptideNetworking.Utils.RiptideLogger:Log (RiptideNetworking.Utils.LogType,string,string)
RiptideNetworking.Transports.RudpTransport.RudpClient:OnDisconnected ()
RiptideNetworking.Transports.RudpTransport.RudpClient:Heartbeat ()
RiptideNetworking.Transports.RudpTransport.RudpClient:b__54_0 (object)
System.Threading._ThreadPoolWaitCallback:PerformWaitCallback ()

However, DidDisconnect is not called at all. Any insight/ideas?

Thank you!

@tom-weiland
Copy link
Collaborator

Are you calling the client's Tick method in FixedUpdate? Without that, events won't be invoked.

@ameel
Copy link
Author

ameel commented Jun 23, 2022

@tom-weiland Yes, that was the issue. I had a checkin FixedUpdate but I forgot to update it and that stopped working.

Thanks for pointing it out!

@tom-weiland tom-weiland added the User Error This issue was caused by user error label Jun 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
User Error This issue was caused by user error
Projects
None yet
Development

No branches or pull requests

2 participants