good structure

This commit is contained in:
2025-03-13 21:58:48 +01:00
parent c750dbd8f1
commit 663f395c6e
5 changed files with 59 additions and 1 deletions
+21
View File
@@ -0,0 +1,21 @@
use mongodb::bson::doc;
use crate::response::{Response, Result};
use super::Session;
pub fn player(session: &Session, uuid: String) -> Result {
let player = session
.database
.players
.find(doc! {
"uuid": uuid.clone(),
})
.run()?
.deserialize_current()
.unwrap();
Ok(Response::Player {
cloak: player.cloak,
})
}