fix self holepunch
This commit is contained in:
parent
a09c1c3d79
commit
e874bf142d
1 changed files with 21 additions and 15 deletions
|
|
@ -236,6 +236,9 @@ impl ExtendedMatchmakeSession {
|
||||||
}*/
|
}*/
|
||||||
|
|
||||||
for pid in &list_of_connected_pids {
|
for pid in &list_of_connected_pids {
|
||||||
|
if other_conn.pid == *pid {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
other_conn
|
other_conn
|
||||||
.remote
|
.remote
|
||||||
.process_notification_event(NotificationEvent {
|
.process_notification_event(NotificationEvent {
|
||||||
|
|
@ -247,28 +250,31 @@ impl ExtendedMatchmakeSession {
|
||||||
param_3: self.connected_players.len() as _,
|
param_3: self.connected_players.len() as _,
|
||||||
})
|
})
|
||||||
.await;
|
.await;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for old_conns in &old_particip {
|
for old_conns in &old_particip {
|
||||||
let Some(old_conns) = old_conns.upgrade() else {
|
let Some(old_conns) = old_conns.upgrade() else {
|
||||||
continue;
|
continue;
|
||||||
};
|
};
|
||||||
if old_conns.pid != self.session.gathering.host_pid{
|
if old_conns.pid != self.session.gathering.host_pid {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
for new_conn_pid in conns.iter().filter_map(Weak::upgrade).map(|c| c.pid){
|
for new_conn_pid in conns.iter().filter_map(Weak::upgrade).map(|c| c.pid) {
|
||||||
old_conns
|
if old_conns.pid == new_conn_pid {
|
||||||
.remote
|
continue;
|
||||||
.process_notification_event(NotificationEvent {
|
}
|
||||||
pid_source: initiating_pid,
|
old_conns
|
||||||
notif_type: 3001,
|
.remote
|
||||||
param_1: self.session.gathering.self_gid as PID,
|
.process_notification_event(NotificationEvent {
|
||||||
param_2: new_conn_pid,
|
pid_source: initiating_pid,
|
||||||
str_param: join_msg.clone(),
|
notif_type: 3001,
|
||||||
param_3: self.connected_players.len() as _,
|
param_1: self.session.gathering.self_gid as PID,
|
||||||
})
|
param_2: new_conn_pid,
|
||||||
.await;
|
str_param: join_msg.clone(),
|
||||||
|
param_3: self.connected_players.len() as _,
|
||||||
|
})
|
||||||
|
.await;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue