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 {
|
||||
if other_conn.pid == *pid {
|
||||
continue;
|
||||
}
|
||||
other_conn
|
||||
.remote
|
||||
.process_notification_event(NotificationEvent {
|
||||
|
|
@ -247,28 +250,31 @@ impl ExtendedMatchmakeSession {
|
|||
param_3: self.connected_players.len() as _,
|
||||
})
|
||||
.await;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for old_conns in &old_particip {
|
||||
let Some(old_conns) = old_conns.upgrade() else {
|
||||
continue;
|
||||
};
|
||||
if old_conns.pid != self.session.gathering.host_pid{
|
||||
continue;
|
||||
if old_conns.pid != self.session.gathering.host_pid {
|
||||
continue;
|
||||
}
|
||||
for new_conn_pid in conns.iter().filter_map(Weak::upgrade).map(|c| c.pid){
|
||||
old_conns
|
||||
.remote
|
||||
.process_notification_event(NotificationEvent {
|
||||
pid_source: initiating_pid,
|
||||
notif_type: 3001,
|
||||
param_1: self.session.gathering.self_gid as PID,
|
||||
param_2: new_conn_pid,
|
||||
str_param: join_msg.clone(),
|
||||
param_3: self.connected_players.len() as _,
|
||||
})
|
||||
.await;
|
||||
for new_conn_pid in conns.iter().filter_map(Weak::upgrade).map(|c| c.pid) {
|
||||
if old_conns.pid == new_conn_pid {
|
||||
continue;
|
||||
}
|
||||
old_conns
|
||||
.remote
|
||||
.process_notification_event(NotificationEvent {
|
||||
pid_source: initiating_pid,
|
||||
notif_type: 3001,
|
||||
param_1: self.session.gathering.self_gid as PID,
|
||||
param_2: new_conn_pid,
|
||||
str_param: join_msg.clone(),
|
||||
param_3: self.connected_players.len() as _,
|
||||
})
|
||||
.await;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue