Some checks failed
Build and Test / friends (push) Failing after 4m3s
Build and Test / wii-u-chat (push) Successful in 5m33s
Build and Test / fast-racing-neo (push) Successful in 6m5s
Build and Test / puyopuyo (push) Successful in 6m7s
Build and Test / minecraft-wiiu (push) Successful in 6m14s
Build and Test / super-mario-maker (push) Successful in 6m34s
Build and Test / sonic-transformed (push) Successful in 10m14s
Build and Test / wii-sports-club (push) Successful in 10m53s
Build and Test / splatoon (push) Successful in 10m59s
Build and Test / splatoon-testfire (push) Successful in 10m59s
Build and Test / mario-tennis (push) Successful in 11m23s
36 lines
1.1 KiB
Rust
36 lines
1.1 KiB
Rust
use rnex_server_api::meta::{
|
|
ApiFeature, ApiFeatures, BuildInfo, server_meta_service_server::ServerMetaService,
|
|
};
|
|
use tonic::{Request, Response, Status, async_trait, transport::Server};
|
|
|
|
pub struct ServerMeta;
|
|
|
|
#[async_trait]
|
|
impl ServerMetaService for ServerMeta {
|
|
async fn get_build_info(&self, request: Request<()>) -> Result<Response<BuildInfo>, Status> {
|
|
Ok(Response::new(BuildInfo {
|
|
version: env!("CARGO_PKG_VERSION").to_owned(),
|
|
edition: env!("EDITION").to_owned(),
|
|
build_hash: env!("GIT_HASH").to_owned(),
|
|
feature_set: env!("FEATURESET").to_owned(),
|
|
}))
|
|
}
|
|
async fn get_api_features(
|
|
&self,
|
|
request: Request<()>,
|
|
) -> Result<Response<ApiFeatures>, Status> {
|
|
let mut api_features = vec![ApiFeature {
|
|
name: "meta".to_owned(),
|
|
needs_admin: false,
|
|
version: 0,
|
|
}];
|
|
|
|
#[cfg(not(feature = "friends"))]
|
|
api_features.push(ApiFeature {
|
|
name: "gatherings".to_owned(),
|
|
version: 0,
|
|
needs_admin: true,
|
|
});
|
|
Ok(Response::new(ApiFeatures { api_features }))
|
|
}
|
|
}
|