This commit is contained in:
2025-11-13 09:22:05 +01:00
parent f37d93c417
commit 16aeade138
4 changed files with 108 additions and 8 deletions
+6
View File
@@ -120,6 +120,9 @@ pub enum PeerEvent {
DownloadGameFilesFailed {
id: String,
},
NoPeersHaveGame {
id: String,
},
PeerConnected(SocketAddr),
PeerDisconnected(SocketAddr),
PeerDiscovered(SocketAddr),
@@ -1315,6 +1318,9 @@ async fn handle_get_game_command(ctx: &Ctx, tx_notify_ui: &UnboundedSender<PeerE
let peers = { ctx.peer_game_db.read().await.peers_with_game(&id) };
if peers.is_empty() {
log::warn!("No peers have game {id}");
if let Err(e) = tx_notify_ui.send(PeerEvent::NoPeersHaveGame { id: id.clone() }) {
log::error!("Failed to send NoPeersHaveGame event: {e}");
}
return;
}