[code][fix] improvements for LAN 202503

- more robust client <-> server connection
  - new client event: DownloadGameFilesFailed
  - 3 seconds to reconnect
  - retry forever if server is gone and never lose a UI request

- code cleanup here and there (mostly server)
This commit is contained in:
2025-03-20 19:39:32 +01:00
parent 19434cd1b1
commit 765447e6d1
9 changed files with 405 additions and 239 deletions

View File

@ -152,13 +152,22 @@ pub struct GameFileDescription {
pub is_dir: bool,
}
impl GameFileDescription {
#[must_use]
pub fn is_version_ini(&self) -> bool {
self.relative_path.ends_with("/version.ini")
}
}
impl fmt::Debug for GameFileDescription {
#[allow(clippy::cast_precision_loss)]
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
write!(
f,
"game:{} path:{} dir:{}",
self.game_id, self.relative_path, self.is_dir
"{}: [{}] path:{}",
self.game_id,
if self.is_dir { 'D' } else { 'F' },
self.relative_path,
)
}
}