Restored full CSGO query capabilities

This commit is contained in:
CosminPerRam 2022-11-28 00:51:09 +02:00
parent e709cb3ce5
commit 259e21a4ab
5 changed files with 35 additions and 90 deletions

View file

@ -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;

View file

@ -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![])
}
}
}