fix players find
This commit is contained in:
parent
dc02f22545
commit
7f6bc59d14
@ -38,6 +38,7 @@ impl ServerContext {
|
||||
self
|
||||
.clients
|
||||
.iter()
|
||||
.filter(|o| o.entity_info_opt().is_some())
|
||||
.find(|o| {
|
||||
let info = o.player_info();
|
||||
if let Some(info) = info {
|
||||
@ -53,6 +54,7 @@ impl ServerContext {
|
||||
self
|
||||
.clients
|
||||
.iter()
|
||||
.filter(|o| o.entity_info_opt().is_some())
|
||||
.find(|o| {
|
||||
let info = o.player_info();
|
||||
if let Some(info) = info {
|
||||
@ -69,6 +71,7 @@ impl ServerContext {
|
||||
.clients
|
||||
.iter()
|
||||
.filter(|o| o.player_info().is_some())
|
||||
.filter(|o| o.entity_info_opt().is_some())
|
||||
.map(|o| o.clone())
|
||||
.collect()
|
||||
}
|
||||
|
@ -107,6 +107,10 @@ impl ClientContext {
|
||||
self.player_info.read().unwrap().clone()
|
||||
}
|
||||
|
||||
pub fn entity_info_opt(self: &Arc<Self>) -> Option<Arc<EntityInfo>> {
|
||||
self.entity_info.read().unwrap().clone()
|
||||
}
|
||||
|
||||
pub fn entity_info(self: &Arc<Self>) -> Arc<EntityInfo> {
|
||||
self.entity_info.read().unwrap().clone().unwrap()
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user