lucaspoffo / renet

Server/Client network library for multiplayer games with authentication and connection management made with Rust
Apache License 2.0
662 stars 68 forks source link

Client disconnection not working in demo_bevy #63

Closed claytondavidson closed 1 year ago

claytondavidson commented 1 year ago

In the demo_bevy project, players can connect but cannot disconnect. I'm not sure what causes this, as the disconnect messages are handled by ServerEvent::ClientDisconnected. I've read that there's an around 15 second disconnect timer, but this is not emanating in that example. The print immediately following that event call is never logged to the console. Has anyone run into a problem similar?

lucaspoffo commented 1 year ago

Hey, didn't manage to replicate the problem. The timeout is working for me on the demo_bevy.

But we shouldn't be relying on the timeout when we close the window, so I added an exit system for the client to disconnect on close, so it should be instant now, same thing for the server: 00310d0634c94b239ac3b9859be58107925d57e2

lucaspoffo commented 1 year ago

So I tested again this, using (Windows/Linux/Mac) and the disconnect event is working fine. There has been an internal protocol rewrite by https://github.com/lucaspoffo/renet/pull/82 so it may have fixed this problem.

If this still occurs with you, please re-open the issue.