--- a/rust/hedgewars-server/src/server/handlers.rs Mon Feb 04 19:22:21 2019 +0300
+++ b/rust/hedgewars-server/src/server/handlers.rs Mon Feb 04 20:25:35 2019 +0300
@@ -102,10 +102,10 @@
response.add(Pong.send_self());
}
HWProtocolMessage::Quit(Some(msg)) => {
- //ByeClient("User quit: ".to_string() + &msg)
+ common::remove_client(server, response, "User quit: ".to_string() + &msg);
}
HWProtocolMessage::Quit(None) => {
- //ByeClient("User quit".to_string())
+ common::remove_client(server, response, "User quit".to_string());
}
HWProtocolMessage::Malformed => warn!("Malformed/unknown message"),
HWProtocolMessage::Empty => warn!("Empty message"),
@@ -118,3 +118,7 @@
},
}
}
+
+pub fn handle_client_loss(server: &mut HWServer, client_id: ClientId, response: &mut Response) {
+ common::remove_client(server, response, "Connection reset".to_string());
+}