diff --git a/CHANGELOG.md b/CHANGELOG.md index df05d9f..ebbc150 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ Who knows what the future holds... ### Changes: Games: - [Risk of Rain 2](https://store.steampowered.com/app/632360/Risk_of_Rain_2/) support. +- [Battalion 1944](https://store.steampowered.com/app/489940/BATTALION_Legacy/) support. Protocols: - Valve: Players with no name are no more added to the `players_details` field. diff --git a/GAMES.md b/GAMES.md index e018df9..d46ff3d 100644 --- a/GAMES.md +++ b/GAMES.md @@ -14,7 +14,7 @@ A supported game is defined as a game that has been successfully tested, other g | Alien Swarm | ALIENS | Valve Protocol | | | Alien Swarm: Reactive Drop | ASRD | Valve Protocol | | | Insurgency | INS | Valve Protocol | | -| Insurgency: Sandstorm | INSS | Valve Protocol | Use the query port. | +| Insurgency: Sandstorm | INSS | Valve Protocol | Query port offset: 1. | | Insurgency: Modern Infantry Combat | INSMIC | Valve Protocol | | | Counter-Strike: Condition Zero | CSCZ | Valve Protocol (GoldSrc) | | | Day of Defeat | DOD | Valve Protocol (GoldSrc) | | @@ -22,15 +22,16 @@ A supported game is defined as a game that has been successfully tested, other g | 7 Days To Die | SDTD | Valve Protocol | | | ARK: Survival Evolved | ASE | Valve Protocol | | | Unturned | UNTURNED | Valve Protocol | | -| The Forest | TF | Valve Protocol (GoldSrc) | Use the query port. | +| The Forest | TF | Valve Protocol (GoldSrc) | Query port offset: 1. | | Team Fortress Classic | TFC | Valve Protocol | | | Sven Co-op | SC | Valve Protocol (GoldSrc) | | | Rust | RUST | Valve Protocol | | | Counter-Strike | CS | Valve Protocol (GoldSrc) | | -| Arma 2: Operation Arrowhead | ARMA2OA | Valve Protocol | Use the query port. | +| Arma 2: Operation Arrowhead | ARMA2OA | Valve Protocol | Query port offset: 1. | | Day of Infamy | DOI | Valve Protocol | | | Half-Life Deathmatch: Source | HLDMS | Valve Protocol | | -| Risk of Rain 2 | ROR2 | Valve Protocol | Use the query port (by default its 27016 (the game connection port + 1)). | +| Risk of Rain 2 | ROR2 | Valve Protocol | Query port offset: 1. | +| Battalion 1944 | BAT1944 | Valve Protocol | Query port offset: 3. | ## Planned to add support: _ diff --git a/examples/master_querant.rs b/examples/master_querant.rs index 48a7562..3fe98b6 100644 --- a/examples/master_querant.rs +++ b/examples/master_querant.rs @@ -1,6 +1,6 @@ use std::env; -use gamedig::{aliens, arma2oa, ase, asrd, cs, cscz, csgo, css, dod, dods, doi, GDResult, gm, hl2dm, hldms, ins, insmic, inss, l4d, l4d2, mc, ror2, rust, sc, sdtd, tf, tf2, tfc, ts, unturned}; +use gamedig::{aliens, arma2oa, ase, asrd, bat1944, cs, cscz, csgo, css, dod, dods, doi, GDResult, gm, hl2dm, hldms, ins, insmic, inss, l4d, l4d2, mc, ror2, rust, sc, sdtd, tf, tf2, tfc, ts, unturned}; use gamedig::protocols::minecraft::LegacyGroup; use gamedig::protocols::valve; use gamedig::protocols::valve::App; @@ -70,6 +70,7 @@ fn main() -> GDResult<()> { "doi" => println!("{:#?}", doi::query(ip, port)?), "hldms" => println!("{:#?}", hldms::query(ip, port)?), "ror2" => println!("{:#?}", ror2::query(ip, port)?), + "bat1944" => println!("{:?}", bat1944::query(ip, port)?), _ => panic!("Undefined game: {}", args[1]) }; diff --git a/src/games/bat1944.rs b/src/games/bat1944.rs new file mode 100644 index 0000000..9bfbcdc --- /dev/null +++ b/src/games/bat1944.rs @@ -0,0 +1,12 @@ +use crate::GDResult; +use crate::protocols::valve; +use crate::protocols::valve::{game, SteamID}; + +pub fn query(address: &str, port: Option) -> GDResult { + let valve_response = valve::query(address, match port { + None => 7780, + Some(port) => port + }, SteamID::BAT1944.as_app(), None, None)?; + + Ok(game::Response::new_from_valve_response(valve_response)) +} diff --git a/src/games/mod.rs b/src/games/mod.rs index 6511bbc..2b2a688 100644 --- a/src/games/mod.rs +++ b/src/games/mod.rs @@ -59,3 +59,5 @@ pub mod doi; pub mod hldms; /// Risk of Rain 2 pub mod ror2; +/// Battalion 1944 +pub mod bat1944; diff --git a/src/protocols/valve/types.rs b/src/protocols/valve/types.rs index 668c6fa..7e756f8 100644 --- a/src/protocols/valve/types.rs +++ b/src/protocols/valve/types.rs @@ -189,6 +189,8 @@ pub enum SteamID { UNTURNED = 304930, /// ARK: Survival Evolved ASE = 346110, + /// Battalion 1944 + BAT1944 = 489940, /// Insurgency: Sandstorm INSS = 581320, /// Alien Swarm: Reactive Drop