From b15c107f0be058fb50e07395dcfb365216083b80 Mon Sep 17 00:00:00 2001 From: Shane Handley Date: Sun, 20 Oct 2019 16:24:36 +0900 Subject: [PATCH] Re-add the handling of error when the player loses connection on the character select screen. --- voxygen/src/menu/char_selection/mod.rs | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/voxygen/src/menu/char_selection/mod.rs b/voxygen/src/menu/char_selection/mod.rs index 15ccecd63b..3e138833e0 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}; +use client::{self, Client, Error as ClientError}; use common::{assets, clock::Clock, comp, msg::ClientState}; use log::error; use scene::Scene; @@ -113,7 +113,20 @@ impl PlayState for CharSelectionState { .borrow_mut() .tick(comp::ControllerInputs::default(), clock.get_last_delta()) { - error!("Failed to tick the scene: {:?}", err); + 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); + } + } + return PlayStateResult::Pop; }