diff --git a/CHANGELOG.md b/CHANGELOG.md index 910768d..2c48280 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ Games: - [Quake 2](https://store.steampowered.com/app/2320/Quake_II/) support. - [Quake 1](https://store.steampowered.com/app/2310/Quake/) support. - [Quake 3: Arena](https://store.steampowered.com/app/2200/Quake_III_Arena/) support. +- [Hell Let Loose](https://store.steampowered.com/app/686810/Hell_Let_Loose/) support. ### Breaking: - Every function that used `&str` for the address has been changed to `&IpAddr` (thanks [@Douile](https://github.com/Douile) for the re-re-write). diff --git a/GAMES.md b/GAMES.md index df3f171..9278b83 100644 --- a/GAMES.md +++ b/GAMES.md @@ -53,6 +53,7 @@ Beware of the `Notes` column, as it contains information about query port offset | Quake 2 | QUAKE2 | Quake 2 | | | Quake 1 | QUAKE1 | Quake 1 | | | Quake 3: Arena | QUAKE3A | Quake 3 | | +| Hell Let Loose | HLL | Valve Protocol | Query port is 26420. Note that on this port it might not send players data, as there might be another query port that does send players data. | ## Planned to add support: _ diff --git a/examples/master_querant.rs b/examples/master_querant.rs index 8485144..b5a1ae7 100644 --- a/examples/master_querant.rs +++ b/examples/master_querant.rs @@ -2,7 +2,7 @@ use gamedig::protocols::{gamespy, quake}; use gamedig::protocols::minecraft::LegacyGroup; use gamedig::protocols::valve; use gamedig::protocols::valve::Engine; -use gamedig::{aliens, aoc, arma2oa, ase, asrd, avorion, bat1944, bb2, bf1942, bm, bo, ccure, cosu, cs, cscz, csgo, css, dod, dods, doi, dst, ffow, gm, hl2dm, hldms, ins, insmic, inss, l4d, l4d2, mc, ohd, onset, pz, ror2, rust, sc, sdtd, ss, tf, tf2, tfc, ts, unturned, ut, vr, GDResult, cw, quake2, quake1, quake3a}; +use gamedig::{aliens, aoc, arma2oa, ase, asrd, avorion, bat1944, bb2, bf1942, bm, bo, ccure, cosu, cs, cscz, csgo, css, dod, dods, doi, dst, ffow, gm, hl2dm, hldms, ins, insmic, inss, l4d, l4d2, mc, ohd, onset, pz, ror2, rust, sc, sdtd, ss, tf, tf2, tfc, ts, unturned, ut, vr, GDResult, cw, quake2, quake1, quake3a, hll}; use std::env; use std::net::IpAddr; @@ -129,6 +129,7 @@ fn main() -> GDResult<()> { "quake2" => println!("{:#?}", quake2::query(ip, port)?), "quake1" => println!("{:#?}", quake1::query(ip, port)?), "quake3a" => println!("{:#?}", quake3a::query(ip, port)?), + "hll" => println!("{:#?}", hll::query(ip, port)?), _ => panic!("Undefined game: {}", args[1]), }; diff --git a/src/games/hll.rs b/src/games/hll.rs new file mode 100644 index 0000000..152f8cf --- /dev/null +++ b/src/games/hll.rs @@ -0,0 +1,17 @@ +use std::net::IpAddr; +use crate::{ + protocols::valve::{self, game, SteamApp}, + GDResult, +}; + +pub fn query(address: &IpAddr, port: Option) -> GDResult { + let valve_response = valve::query( + address, + port.unwrap_or(26420), + SteamApp::HLL.as_engine(), + None, + None, + )?; + + Ok(game::Response::new_from_valve_response(valve_response)) +} diff --git a/src/games/mod.rs b/src/games/mod.rs index f3ff752..d2d9e1e 100644 --- a/src/games/mod.rs +++ b/src/games/mod.rs @@ -100,3 +100,5 @@ pub mod quake2; pub mod quake1; /// Quake 3: Arena pub mod quake3a; +/// Hell Let Loose +pub mod hll; diff --git a/src/protocols/valve/types.rs b/src/protocols/valve/types.rs index 39d9658..4d18937 100644 --- a/src/protocols/valve/types.rs +++ b/src/protocols/valve/types.rs @@ -308,6 +308,8 @@ pub enum SteamApp { ONSET, /// V Rising VR, + /// Hell Let Loose + HLL, } impl SteamApp { @@ -355,6 +357,7 @@ impl SteamApp { SteamApp::OHD => Engine::new_source_with_dedicated(736590, 950900), SteamApp::ONSET => Engine::new_source(1105810), SteamApp::VR => Engine::new_source(1604030), + SteamApp::HLL => Engine::new_source(686810), } } }