mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Fix issue with the timeout error showing when there is an intentional logout from the game.
This commit is contained in:
parent
bcd214187b
commit
c9de7a0ae6
@ -114,12 +114,9 @@ impl PlayState for CharSelectionState {
|
||||
.tick(comp::ControllerInputs::default(), clock.get_last_delta())
|
||||
{
|
||||
error!("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(),
|
||||
);
|
||||
return PlayStateResult::Pop;
|
||||
}
|
||||
|
||||
self.client.borrow_mut().cleanup();
|
||||
|
||||
// Finish the frame.
|
||||
|
@ -6,7 +6,7 @@ use crate::{
|
||||
window::{Event, GameInput},
|
||||
Direction, Error, GlobalState, PlayState, PlayStateResult,
|
||||
};
|
||||
use client::{self, Client, Event::Chat};
|
||||
use client::{self, error::Error as ClientError, Client, Event::Chat};
|
||||
use common::{
|
||||
clock::Clock,
|
||||
comp,
|
||||
@ -332,11 +332,20 @@ impl PlayState for SessionState {
|
||||
|
||||
// Perform an in-game tick.
|
||||
if let Err(err) = self.tick(clock.get_avg_delta()) {
|
||||
error!("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(),
|
||||
);
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
return PlayStateResult::Pop;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user