Skip to content

Commit

Permalink
Handle connection failures more gracefully
Browse files Browse the repository at this point in the history
  • Loading branch information
vE5li committed Jun 1, 2024
1 parent e6ca424 commit 6f23784
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions korangar/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -556,7 +556,8 @@ fn main() {
interface.open_window(&application, &mut focus_state, &SelectServerWindow::new(character_servers));
}
NetworkEvent::LoginServerConnectionFailed { message, .. } => {
interface.open_window(&application, &mut focus_state, &ErrorWindow::new(message.to_owned()))
networking_system.disconnect_from_login_server();
interface.open_window(&application, &mut focus_state, &ErrorWindow::new(message.to_owned()));
}
NetworkEvent::LoginServerDisconnected { reason } => {
if reason != DisconnectReason::ClosedByClient {
Expand All @@ -573,7 +574,8 @@ fn main() {
let _ = networking_system.request_character_list();
},
NetworkEvent::CharacterServerConnectionFailed { message, .. } => {
interface.open_window(&application, &mut focus_state, &ErrorWindow::new(message.to_owned()))
networking_system.disconnect_from_character_server();
interface.open_window(&application, &mut focus_state, &ErrorWindow::new(message.to_owned()));
},
NetworkEvent::CharacterServerDisconnected { reason } => {
if reason != DisconnectReason::ClosedByClient {
Expand Down

0 comments on commit 6f23784

Please sign in to comment.