|
|
|
@ -11,13 +11,13 @@ use crate::state::*;
|
|
|
|
|
impl Game {
|
|
|
|
|
pub fn login(&mut self, token: Token, message: String, state: &Login) -> SendQueue {
|
|
|
|
|
let mut send_queue = SendQueue::new();
|
|
|
|
|
let mut client = {
|
|
|
|
|
if let Some(client) = self.clients.remove(&token) {
|
|
|
|
|
client
|
|
|
|
|
} else {
|
|
|
|
|
warn!("Can't find a client with token: {:?}", &token);
|
|
|
|
|
return send_queue;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
let mut client = if let Some(client) = self.clients.remove(&token) {
|
|
|
|
|
client
|
|
|
|
|
} else {
|
|
|
|
|
warn!("Can't find a client with token: {:?}", &token);
|
|
|
|
|
self.tokens.push_back(token);
|
|
|
|
|
return send_queue
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
match state {
|
|
|
|
|