diff --git a/client/src/lib.rs b/client/src/lib.rs index 64c49f4a78..80921ec42f 100644 --- a/client/src/lib.rs +++ b/client/src/lib.rs @@ -132,23 +132,19 @@ impl Client { } /// Request a state transition to `ClientState::Registered`. - pub fn register(&mut self, player: comp::Player, password: String) /*-> Result<(), Error>*/ - { + pub fn register(&mut self, player: comp::Player, password: String) -> Result<(), Error> { self.postbox .send_message(ClientMsg::Register { player, password }); self.client_state = ClientState::Pending; - /*loop { + loop { match self.postbox.next_message() { Some(ServerMsg::StateAnswer(Err((RequestStateError::Denied, _)))) => { break Err(Error::InvalidAuth) - }, - Some(ServerMsg::StateAnswer(Ok(ClientState::Registered))) => { - break Ok(()) } + Some(ServerMsg::StateAnswer(Ok(ClientState::Registered))) => break Ok(()), _ => {} - } - }*/ + } } /// Request a state transition to `ClientState::Character`. diff --git a/voxygen/src/menu/main/client_init.rs b/voxygen/src/menu/main/client_init.rs index 69ada9fd9a..a6095e9eb2 100644 --- a/voxygen/src/menu/main/client_init.rs +++ b/voxygen/src/menu/main/client_init.rs @@ -62,11 +62,13 @@ impl ClientInit { for socket_addr in first_addrs.into_iter().chain(second_addrs) { match Client::new(socket_addr, player.view_distance) { Ok(mut client) => { - /*if let Err(ClientError::InvalidAuth) == client.register(player, password) { + if let Err(ClientError::InvalidAuth) = + client.register(player, password) + { last_err = Some(Error::InvalidAuth); break; - }*/ - client.register(player, password); + } + //client.register(player, password); let _ = tx.send(Ok(client)); #[cfg(feature = "discord")] diff --git a/voxygen/src/menu/main/mod.rs b/voxygen/src/menu/main/mod.rs index 8ed9b98357..eb2ce26018 100644 --- a/voxygen/src/menu/main/mod.rs +++ b/voxygen/src/menu/main/mod.rs @@ -64,7 +64,7 @@ impl PlayState for MainMenuState { self.main_menu_ui.login_error( match err { InitError::BadAddress(_) | InitError::NoAddress => "Server not found", - InitError::InvalidAuth => "Invalid username or password", + InitError::InvalidAuth => "Invalid credentials", InitError::ServerIsFull => "Server is Full!", InitError::ConnectionFailed(_) => "Connection failed", InitError::ClientCrashed => "Client crashed",