mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
fix: show error on client failure again
This commit is contained in:
parent
4df7e95331
commit
b6552556e7
@ -5,7 +5,7 @@ use crate::{
|
|||||||
session::SessionState, window::Event as WinEvent, Direction, GlobalState, PlayState,
|
session::SessionState, window::Event as WinEvent, Direction, GlobalState, PlayState,
|
||||||
PlayStateResult,
|
PlayStateResult,
|
||||||
};
|
};
|
||||||
use client::{self, Client, Error as ClientError};
|
use client::{self, Client};
|
||||||
use common::{assets, clock::Clock, comp, msg::ClientState};
|
use common::{assets, clock::Clock, comp, msg::ClientState};
|
||||||
use log::error;
|
use log::error;
|
||||||
use scene::Scene;
|
use scene::Scene;
|
||||||
@ -113,19 +113,11 @@ impl PlayState for CharSelectionState {
|
|||||||
.borrow_mut()
|
.borrow_mut()
|
||||||
.tick(comp::ControllerInputs::default(), clock.get_last_delta())
|
.tick(comp::ControllerInputs::default(), clock.get_last_delta())
|
||||||
{
|
{
|
||||||
match err {
|
global_state.info_message = Some(
|
||||||
ClientError::ServerTimeout => {
|
"Connection lost!\nDid the server restart?\nIs the client up to date?"
|
||||||
global_state.info_message = Some(
|
.to_owned(),
|
||||||
"Connection lost!\nDid the server restart?\nIs the client up to date?"
|
);
|
||||||
.to_owned(),
|
error!("[session] Failed to tick the scene: {:?}", err);
|
||||||
);
|
|
||||||
|
|
||||||
error!("[session] ServerTimeout: {:?}", err);
|
|
||||||
}
|
|
||||||
_ => {
|
|
||||||
error!("[session] Failed to tick the scene: {:?}", err);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return PlayStateResult::Pop;
|
return PlayStateResult::Pop;
|
||||||
}
|
}
|
||||||
|
@ -6,7 +6,7 @@ use crate::{
|
|||||||
window::{Event, GameInput},
|
window::{Event, GameInput},
|
||||||
Direction, Error, GlobalState, PlayState, PlayStateResult,
|
Direction, Error, GlobalState, PlayState, PlayStateResult,
|
||||||
};
|
};
|
||||||
use client::{self, error::Error as ClientError, Client, Event::Chat};
|
use client::{self, Client, Event::Chat};
|
||||||
use common::{
|
use common::{
|
||||||
clock::Clock,
|
clock::Clock,
|
||||||
comp,
|
comp,
|
||||||
@ -337,19 +337,11 @@ impl PlayState for SessionState {
|
|||||||
|
|
||||||
// Perform an in-game tick.
|
// Perform an in-game tick.
|
||||||
if let Err(err) = self.tick(clock.get_avg_delta()) {
|
if let Err(err) = self.tick(clock.get_avg_delta()) {
|
||||||
match err {
|
global_state.info_message = Some(
|
||||||
Error::ClientError(ClientError::ServerTimeout) => {
|
"Connection lost!\nDid the server restart?\nIs the client up to date?"
|
||||||
global_state.info_message = Some(
|
.to_owned(),
|
||||||
"Connection lost!\nDid the server restart?\nIs the client up to date?"
|
);
|
||||||
.to_owned(),
|
error!("[session] Failed to tick the scene: {:?}", err);
|
||||||
);
|
|
||||||
|
|
||||||
error!("[session] ServerTimeout: {:?}", err);
|
|
||||||
}
|
|
||||||
_ => {
|
|
||||||
error!("[session] Failed to tick the scene: {:?}", err);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return PlayStateResult::Pop;
|
return PlayStateResult::Pop;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user