mirror of
https://github.com/Tribufu/rust-gamedig
synced 2026-08-17 02:41:06 +00:00
refator: copy cli into mono
This commit is contained in:
parent
66ae3c296e
commit
80f6b87991
63 changed files with 244 additions and 34 deletions
|
|
@ -1,24 +0,0 @@
|
|||
use crate::protocols::quake::client::{client_query, QuakeClient};
|
||||
use crate::protocols::quake::two::QuakeTwo;
|
||||
use crate::protocols::quake::Response;
|
||||
use crate::protocols::types::TimeoutSettings;
|
||||
use crate::GDResult;
|
||||
use std::net::SocketAddr;
|
||||
use std::slice::Iter;
|
||||
|
||||
pub use crate::protocols::quake::two::Player;
|
||||
|
||||
struct QuakeThree;
|
||||
impl QuakeClient for QuakeThree {
|
||||
type Player = Player;
|
||||
|
||||
fn get_send_header<'a>() -> &'a str { "getstatus" }
|
||||
|
||||
fn get_response_header<'a>() -> &'a str { "statusResponse\n" }
|
||||
|
||||
fn parse_player_string(data: Iter<&str>) -> GDResult<Self::Player> { QuakeTwo::parse_player_string(data) }
|
||||
}
|
||||
|
||||
pub fn query(address: &SocketAddr, timeout_settings: Option<TimeoutSettings>) -> GDResult<Response<Player>> {
|
||||
client_query::<QuakeThree>(address, timeout_settings)
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue