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