|
|
@ -7,6 +7,7 @@ use crate::password::Password;
|
|
|
|
use crate::player::Player;
|
|
|
|
use crate::player::Player;
|
|
|
|
use crate::queue::SendQueue;
|
|
|
|
use crate::queue::SendQueue;
|
|
|
|
use crate::state::*;
|
|
|
|
use crate::state::*;
|
|
|
|
|
|
|
|
use crate::log_error;
|
|
|
|
|
|
|
|
|
|
|
|
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 {
|
|
|
@ -194,7 +195,7 @@ impl Game {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
Ok(None) => {
|
|
|
|
Ok(None) => {
|
|
|
|
log::error!("Player has no password: {}", player.id);
|
|
|
|
log_error!("Player has no password: {}", player.id);
|
|
|
|
send_queue.push(token, "Error\n", false, None);
|
|
|
|
send_queue.push(token, "Error\n", false, None);
|
|
|
|
send_queue.push(
|
|
|
|
send_queue.push(
|
|
|
|
token,
|
|
|
|
token,
|
|
|
@ -204,7 +205,7 @@ impl Game {
|
|
|
|
);
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
Err(e) => {
|
|
|
|
Err(e) => {
|
|
|
|
log::error!("Database error: {}", e);
|
|
|
|
log_error!("Database error :: {}", e);
|
|
|
|
send_queue.push(token, "Error\n", false, None);
|
|
|
|
send_queue.push(token, "Error\n", false, None);
|
|
|
|
send_queue.push(
|
|
|
|
send_queue.push(
|
|
|
|
token,
|
|
|
|
token,
|
|
|
|