From b6552556e73b4d08df8997fb26eb020f7ace2652 Mon Sep 17 00:00:00 2001 From: timokoesters Date: Wed, 6 Nov 2019 22:36:39 +0100 Subject: [PATCH] fix: show error on client failure again --- voxygen/src/menu/char_selection/mod.rs | 20 ++++++-------------- voxygen/src/session.rs | 20 ++++++-------------- 2 files changed, 12 insertions(+), 28 deletions(-) diff --git a/voxygen/src/menu/char_selection/mod.rs b/voxygen/src/menu/char_selection/mod.rs index 3e138833e0..a80b8acbde 100644 --- a/voxygen/src/menu/char_selection/mod.rs +++ b/voxygen/src/menu/char_selection/mod.rs @@ -5,7 +5,7 @@ use crate::{ session::SessionState, window::Event as WinEvent, Direction, GlobalState, PlayState, PlayStateResult, }; -use client::{self, Client, Error as ClientError}; +use client::{self, Client}; use common::{assets, clock::Clock, comp, msg::ClientState}; use log::error; use scene::Scene; @@ -113,19 +113,11 @@ impl PlayState for CharSelectionState { .borrow_mut() .tick(comp::ControllerInputs::default(), clock.get_last_delta()) { - match err { - ClientError::ServerTimeout => { - global_state.info_message = Some( - "Connection lost!\nDid the server restart?\nIs the client up to date?" - .to_owned(), - ); - - error!("[session] ServerTimeout: {:?}", err); - } - _ => { - error!("[session] Failed to tick the scene: {:?}", err); - } - } + global_state.info_message = Some( + "Connection lost!\nDid the server restart?\nIs the client up to date?" + .to_owned(), + ); + error!("[session] Failed to tick the scene: {:?}", err); return PlayStateResult::Pop; } diff --git a/voxygen/src/session.rs b/voxygen/src/session.rs index 2dc73aad92..8b91ed78f8 100644 --- a/voxygen/src/session.rs +++ b/voxygen/src/session.rs @@ -6,7 +6,7 @@ use crate::{ window::{Event, GameInput}, Direction, Error, GlobalState, PlayState, PlayStateResult, }; -use client::{self, error::Error as ClientError, Client, Event::Chat}; +use client::{self, Client, Event::Chat}; use common::{ clock::Clock, comp, @@ -337,19 +337,11 @@ impl PlayState for SessionState { // Perform an in-game tick. if let Err(err) = self.tick(clock.get_avg_delta()) { - match err { - Error::ClientError(ClientError::ServerTimeout) => { - global_state.info_message = Some( - "Connection lost!\nDid the server restart?\nIs the client up to date?" - .to_owned(), - ); - - error!("[session] ServerTimeout: {:?}", err); - } - _ => { - error!("[session] Failed to tick the scene: {:?}", err); - } - } + global_state.info_message = Some( + "Connection lost!\nDid the server restart?\nIs the client up to date?" + .to_owned(), + ); + error!("[session] Failed to tick the scene: {:?}", err); return PlayStateResult::Pop; }