Disconnect client when quiting application

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Bornide

Hi,

I’m working on a mini networking project. My clients are able to connect to a godot “dedicated” server. However, when my client closed the game, the server doesn’t know that.

I need to catch the “quit game” event and “notify” the server that the player must be disconnected from the server.

:bust_in_silhouette: Reply From: raksom

I’m pretty sure the ‘peer_disconnected’ signal is fired on the NetworkedMultiplayerENet class when a client quits, you should be able to listen to that and do the cleanup from that.

Oh ok. I guess i should handle the signal and delete the client node on the server side.
I’m gonna try tomorow.

Bornide | 2020-05-21 20:02