mirror of
https://github.com/GIKExe/rust_mc_serv.git
synced 2025-06-24 10:22:57 +03:00
fix players find
This commit is contained in:
parent
dc02f22545
commit
7f6bc59d14
@ -38,6 +38,7 @@ impl ServerContext {
|
|||||||
self
|
self
|
||||||
.clients
|
.clients
|
||||||
.iter()
|
.iter()
|
||||||
|
.filter(|o| o.entity_info_opt().is_some())
|
||||||
.find(|o| {
|
.find(|o| {
|
||||||
let info = o.player_info();
|
let info = o.player_info();
|
||||||
if let Some(info) = info {
|
if let Some(info) = info {
|
||||||
@ -53,6 +54,7 @@ impl ServerContext {
|
|||||||
self
|
self
|
||||||
.clients
|
.clients
|
||||||
.iter()
|
.iter()
|
||||||
|
.filter(|o| o.entity_info_opt().is_some())
|
||||||
.find(|o| {
|
.find(|o| {
|
||||||
let info = o.player_info();
|
let info = o.player_info();
|
||||||
if let Some(info) = info {
|
if let Some(info) = info {
|
||||||
@ -69,6 +71,7 @@ impl ServerContext {
|
|||||||
.clients
|
.clients
|
||||||
.iter()
|
.iter()
|
||||||
.filter(|o| o.player_info().is_some())
|
.filter(|o| o.player_info().is_some())
|
||||||
|
.filter(|o| o.entity_info_opt().is_some())
|
||||||
.map(|o| o.clone())
|
.map(|o| o.clone())
|
||||||
.collect()
|
.collect()
|
||||||
}
|
}
|
||||||
|
@ -107,6 +107,10 @@ impl ClientContext {
|
|||||||
self.player_info.read().unwrap().clone()
|
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> {
|
pub fn entity_info(self: &Arc<Self>) -> Arc<EntityInfo> {
|
||||||
self.entity_info.read().unwrap().clone().unwrap()
|
self.entity_info.read().unwrap().clone().unwrap()
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user