mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
90% there
This commit is contained in:
@ -530,11 +530,16 @@ impl Server {
|
||||
// Valid player
|
||||
ClientMsg::Register { player, password } if player.is_valid() => {
|
||||
if let Some(pass) = accounts.get(&player.alias) {
|
||||
println!("Verifying {} with {} against {}",
|
||||
player.alias, password, pass);
|
||||
if pass != &password {
|
||||
client.error_state(RequestStateError::Denied);
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
|
||||
println!("Adding user {} with password {}",
|
||||
player.alias, password);
|
||||
accounts.insert(player.alias.clone(), password);
|
||||
}
|
||||
println!("{:?}", accounts);
|
||||
@ -545,6 +550,7 @@ impl Server {
|
||||
// Use RequestState instead (No need to send `player` again).
|
||||
_ => client.error_state(RequestStateError::Impossible),
|
||||
}
|
||||
//client.allow_state(ClientState::Registered);
|
||||
}
|
||||
// Invalid player
|
||||
ClientMsg::Register { .. } => {
|
||||
|
Reference in New Issue
Block a user