|
|
|
@ -27,8 +27,7 @@ impl Game {
|
|
|
|
|
send_queue.push(token, "\n\nUsername: ", false, None);
|
|
|
|
|
} else {
|
|
|
|
|
match self.check_player_name(message) {
|
|
|
|
|
PlayerCheck::Ok(name) => {
|
|
|
|
|
match self.db.find_player_by_name(&name) {
|
|
|
|
|
PlayerCheck::Ok(name) => match self.db.find_player_by_name(&name) {
|
|
|
|
|
Ok(Some(_)) => {
|
|
|
|
|
send_queue.push(token, "\nPassword: ", false, None);
|
|
|
|
|
client.state = State::Login(Login::Password(name));
|
|
|
|
@ -45,7 +44,6 @@ impl Game {
|
|
|
|
|
Err(_) => {
|
|
|
|
|
send_queue.push(token, "\nError\n\nUsername: ", false, None);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
PlayerCheck::Err(err) => {
|
|
|
|
|
send_queue.push(token, "\nInvalid username:\n", false, None);
|
|
|
|
@ -53,7 +51,7 @@ impl Game {
|
|
|
|
|
send_queue.push(token, format!("{}\n", line), false, None);
|
|
|
|
|
}
|
|
|
|
|
send_queue.push(token, "\n\nUsername: ", false, None);
|
|
|
|
|
},
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|