Disconnect client if connected and the application is closed by the user
Added types to SystemMessage so that the Client sends a login and logout message to server