mirror of
https://github.com/YGGverse/hlstate-rs.git
synced 2026-03-31 17:15:37 +00:00
make tmp cli scrape impl
This commit is contained in:
parent
105409a76b
commit
e52ed711ba
8 changed files with 312 additions and 47 deletions
33
crates/httpd/src/scrape.rs
Normal file
33
crates/httpd/src/scrape.rs
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
use rocket::serde::{Deserialize, Serialize};
|
||||
use std::net::SocketAddr;
|
||||
|
||||
#[derive(Debug, Deserialize, Serialize)]
|
||||
#[serde(crate = "rocket::serde")]
|
||||
pub struct Result {
|
||||
pub protocol: Vec<i32>,
|
||||
pub master_timeout: u32,
|
||||
pub server_timeout: u32,
|
||||
pub masters: Vec<SocketAddr>,
|
||||
pub filter: String,
|
||||
pub servers: Vec<Info>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Deserialize, Serialize)]
|
||||
#[serde(crate = "rocket::serde")]
|
||||
pub struct Info {
|
||||
pub time: i64,
|
||||
pub address: SocketAddr,
|
||||
pub ping: f64,
|
||||
pub status: String,
|
||||
pub gamedir: String,
|
||||
pub map: String,
|
||||
pub host: String,
|
||||
pub protocol: i32,
|
||||
pub numcl: u32,
|
||||
pub maxcl: u32,
|
||||
pub dm: bool,
|
||||
pub team: bool,
|
||||
pub coop: bool,
|
||||
pub password: bool,
|
||||
pub dedicated: bool,
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue