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