fix checking if a session has active players
This commit is contained in:
parent
949c347569
commit
4de04a4627
1 changed files with 7 additions and 3 deletions
|
|
@ -240,17 +240,21 @@ impl ExtendedMatchmakeSession{
|
|||
}).await;
|
||||
}
|
||||
}
|
||||
pub fn has_active_players(&self) -> bool{
|
||||
self.connected_players.iter().filter(|v| v.upgrade().is_some()).count() != 0
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn is_reachable(&self) -> bool{
|
||||
(if self.session.gathering.flags & PERSISTENT_GATHERING != 0{
|
||||
if !self.connected_players.is_empty(){
|
||||
if self.has_active_players(){
|
||||
true
|
||||
} else {
|
||||
self.session.open_participation
|
||||
}
|
||||
} else {
|
||||
!self.connected_players.is_empty()
|
||||
}) & !self.connected_players.is_empty()
|
||||
!self.has_active_players()
|
||||
}) & !self.has_active_players()
|
||||
}
|
||||
#[inline]
|
||||
pub fn is_joinable(&self) -> bool{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue