mirror of
https://github.com/tribufu/rust-gamedig
synced 2026-06-01 09:42:41 +00:00
CSGO support.
This commit is contained in:
parent
8a93d2fb7d
commit
40912bb192
1 changed files with 8 additions and 4 deletions
|
|
@ -290,7 +290,11 @@ impl ValveProtocol {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
fn get_server_rules(&self, app: &App) -> Result<ServerRules, GDError> {
|
fn get_server_rules(&self, app: &App) -> Result<Option<ServerRules>, GDError> {
|
||||||
|
if *app == App::CSGO { //cause csgo response here is broken after feb 21 2014
|
||||||
|
return Ok(None);
|
||||||
|
}
|
||||||
|
|
||||||
let buf = self.get_request_data(app, Request::RULES)?;
|
let buf = self.get_request_data(app, Request::RULES)?;
|
||||||
let mut pos = 0;
|
let mut pos = 0;
|
||||||
|
|
||||||
|
|
@ -302,10 +306,10 @@ impl ValveProtocol {
|
||||||
buffer::get_string(&buf, &mut pos)?); //value
|
buffer::get_string(&buf, &mut pos)?); //value
|
||||||
}
|
}
|
||||||
|
|
||||||
Ok(ServerRules {
|
Ok(Some(ServerRules {
|
||||||
count,
|
count,
|
||||||
map: rules
|
map: rules
|
||||||
})
|
}))
|
||||||
}
|
}
|
||||||
|
|
||||||
pub(crate) fn query(app: App, address: &str, port: u16, gather: GatheringSettings) -> Result<Response, GDError> {
|
pub(crate) fn query(app: App, address: &str, port: u16, gather: GatheringSettings) -> Result<Response, GDError> {
|
||||||
|
|
@ -323,7 +327,7 @@ impl ValveProtocol {
|
||||||
},
|
},
|
||||||
rules: match gather.rules {
|
rules: match gather.rules {
|
||||||
false => None,
|
false => None,
|
||||||
true => Some(client.get_server_rules(&app)?)
|
true => client.get_server_rules(&app)?
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue