} else if status.is_none() {
let stmt = match dbclient.prepare("select p.player_name from games.players p where p.game_uid = $1 and p.client_type = 'p';").await {
Ok(stmt) => stmt,
Err(e) => {
log::error!("{}", e);
return HttpResponse::ServiceUnavailable().body(actix_web::body::None::new());
}
};
let rows = match dbclient.query(&stmt, &[&gameuid]).await {
Ok(rows) => rows,
Err(e) => {
log::error!("{}", e);
return HttpResponse::ServiceUnavailable().body(actix_web::body::None::new());
}
};
let mut users = Vec::with_capacity(rows.len());
for row in rows {
users.push(PlayerInfo {
player_name: row.get::<_, String>(0),
delegate_name: None,
player_itself: false,
delegate_itself: false,
revoke_delegate_data: None,
query_delegate_data: None,
pending_delegates: None,
});
}
(Some(users), None, None)