mirror of
https://github.com/tribufu/rust-gamedig
synced 2026-05-18 09:35:50 +00:00
Restored full CSGO query capabilities
This commit is contained in:
parent
e709cb3ce5
commit
259e21a4ab
5 changed files with 35 additions and 90 deletions
|
|
@ -143,7 +143,7 @@ struct ValveProtocol {
|
|||
socket: UdpSocket
|
||||
}
|
||||
|
||||
static PACKET_SIZE: usize = 4096;
|
||||
static PACKET_SIZE: usize = 6144;
|
||||
|
||||
impl ValveProtocol {
|
||||
fn new(address: &str, port: u16, timeout_settings: Option<TimeoutSettings>) -> GDResult<Self> {
|
||||
|
|
@ -383,10 +383,6 @@ impl ValveProtocol {
|
|||
|
||||
/// Get the server rules's.
|
||||
fn get_server_rules(&mut self, app: &App, protocol: u8) -> GDResult<Option<Vec<ServerRule>>> {
|
||||
if *app == SteamID::CSGO.as_app() { //cause csgo wont respond to this since feb 21 2014 update
|
||||
return Ok(None);
|
||||
}
|
||||
|
||||
let buf = self.get_request_data(&app, protocol, Request::RULES)?;
|
||||
let mut pos = 0;
|
||||
|
||||
|
|
|
|||
|
|
@ -290,7 +290,7 @@ pub mod game {
|
|||
map: response.info.map,
|
||||
game: response.info.game,
|
||||
players: response.info.players,
|
||||
players_details: response.players.unwrap().iter().map(|p| Player::from_valve_response(p)).collect(),
|
||||
players_details: response.players.unwrap_or(vec![]).iter().map(|p| Player::from_valve_response(p)).collect(),
|
||||
max_players: response.info.max_players,
|
||||
bots: response.info.bots,
|
||||
server_type: response.info.server_type,
|
||||
|
|
@ -302,7 +302,7 @@ pub mod game {
|
|||
tv_port,
|
||||
tv_name,
|
||||
keywords,
|
||||
rules: response.rules.unwrap()
|
||||
rules: response.rules.unwrap_or(vec![])
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue