|
|
|
@ -1,6 +1,7 @@
|
|
|
|
|
use crate::game::Game;
|
|
|
|
|
use crate::queue::SendQueue;
|
|
|
|
|
use crate::result::RudeResult;
|
|
|
|
|
use crate::state::State;
|
|
|
|
|
use crate::try_log;
|
|
|
|
|
|
|
|
|
|
impl Game {
|
|
|
|
@ -36,12 +37,13 @@ impl Game {
|
|
|
|
|
client.send_with_prompt(message);
|
|
|
|
|
} else {
|
|
|
|
|
client.send_without_prompt(&message);
|
|
|
|
|
if message == "Goodbye\n\n".to_string() {
|
|
|
|
|
let _ = client.close();
|
|
|
|
|
log::info!("Disconnect from {}", client);
|
|
|
|
|
self.clients.remove(&token);
|
|
|
|
|
self.tokens.push_back(token);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if state == Some(State::Quit) {
|
|
|
|
|
let _ = client.close();
|
|
|
|
|
log::info!("Disconnect from {}", client);
|
|
|
|
|
self.clients.remove(&token);
|
|
|
|
|
self.tokens.push_back(token);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|