watch for the correct string, and use client.close()

master
rasul 5 years ago
parent 541698f452
commit dece6fa7ce

@ -36,7 +36,8 @@ impl Game {
client.send_with_prompt(message); client.send_with_prompt(message);
} else { } else {
client.send_without_prompt(&message); client.send_without_prompt(&message);
if message == "Goodbye".to_string() { if message == "Goodbye\n\n".to_string() {
let _ = client.close();
log::info!("Disconnect from {}", client); log::info!("Disconnect from {}", client);
self.clients.remove(&token); self.clients.remove(&token);
self.tokens.push_back(token); self.tokens.push_back(token);

Loading…
Cancel
Save