mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
fixed the silent kick, made it actually proper
This commit is contained in:
parent
3a9bbc4927
commit
07d3384b01
@ -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`.
|
||||
|
@ -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")]
|
||||
|
@ -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",
|
||||
|
Loading…
Reference in New Issue
Block a user