mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
laying the groundwork
This commit is contained in:
@ -64,6 +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::ServerIsFull => "Server is Full!",
|
||||
InitError::ConnectionFailed(_) => "Connection failed",
|
||||
InitError::ClientCrashed => "Client crashed",
|
||||
@ -82,10 +83,12 @@ impl PlayState for MainMenuState {
|
||||
match event {
|
||||
MainMenuEvent::LoginAttempt {
|
||||
username,
|
||||
password,
|
||||
server_address,
|
||||
} => {
|
||||
let mut net_settings = &mut global_state.settings.networking;
|
||||
net_settings.username = username.clone();
|
||||
net_settings.password = password.clone();
|
||||
if !net_settings.servers.contains(&server_address) {
|
||||
net_settings.servers.push(server_address.clone());
|
||||
}
|
||||
@ -107,7 +110,7 @@ impl PlayState for MainMenuState {
|
||||
)));
|
||||
} else {
|
||||
self.main_menu_ui
|
||||
.login_error("Invalid username".to_string());
|
||||
.login_error("Invalid username or password".to_string());
|
||||
}
|
||||
}
|
||||
MainMenuEvent::StartSingleplayer => {
|
||||
|
Reference in New Issue
Block a user