unused peerconnection removed

This commit is contained in:
2025-11-11 21:44:18 +01:00
parent 81abf4801d
commit bcda99d3a8
2 changed files with 4 additions and 11 deletions
-5
View File
@@ -282,7 +282,6 @@ pub enum PeerCommand {
file_descriptions: Vec<GameFileDescription>, file_descriptions: Vec<GameFileDescription>,
}, },
SetGameDir(String), SetGameDir(String),
ConnectToPeer(SocketAddr),
} }
async fn initial_peer_alive_check(conn: &mut Connection) -> bool { async fn initial_peer_alive_check(conn: &mut Connection) -> bool {
@@ -868,10 +867,6 @@ pub async fn run_peer(
PeerCommand::SetGameDir(game_dir) => { PeerCommand::SetGameDir(game_dir) => {
handle_set_game_dir_command(&ctx, game_dir).await; handle_set_game_dir_command(&ctx, game_dir).await;
} }
PeerCommand::ConnectToPeer(peer_addr) => {
log::info!("Connecting to peer: {peer_addr}");
// TODO: Implement direct peer connection
}
} }
} }
@@ -399,15 +399,13 @@ async fn find_peers(app: AppHandle) {
Ok(peer_addr) => { Ok(peer_addr) => {
log::info!("Found peer at {peer_addr}"); log::info!("Found peer at {peer_addr}");
let state: tauri::State<LanSpreadState> = app.state(); let state: tauri::State<LanSpreadState> = app.state();
let peer_ctrl = state.peer_ctrl.read().await.clone(); if state.peer_ctrl.read().await.is_some() {
if let Some(peer_ctrl) = peer_ctrl { // Peer discovery is handled by the peer system itself
if let Err(e) = peer_ctrl.send(PeerCommand::ConnectToPeer(peer_addr)) { // No need to establish explicit connections
log::error!("Failed to send PeerCommand::ConnectToPeer: {e}");
}
request_games(state); request_games(state);
} else { } else {
log::warn!( log::warn!(
"Peer system not initialized yet, cannot connect to discovered peer" "Peer system not initialized yet, cannot request games from discovered peer"
); );
} }
break; break;