diff --git a/CHANGELOG.md b/CHANGELOG.md index 1b64c06..787bdf2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ Games: - [Codename CURE](https://store.steampowered.com/app/355180/Codename_CURE/) support. - [Ballistic Overkill](https://store.steampowered.com/app/296300/Ballistic_Overkill/) support. - [BrainBread 2](https://store.steampowered.com/app/346330/BrainBread_2/) support. +- [Avorion](https://store.steampowered.com/app/445220/Avorion/) support. ### Breaking: Nothing. diff --git a/GAMES.md b/GAMES.md index f20fea8..2a01210 100644 --- a/GAMES.md +++ b/GAMES.md @@ -42,6 +42,7 @@ Beware of the `Notes` column, as it contains information about query port offset | Codename CURE | CCURE | Valve Protocol | | | Ballistic Overkill | BO | Valve Protocol | Query port is 27016. | | BrainBread 2 | BB2 | Valve Protocol | | +| Avorion | AVORION | Valve Protocol | Query port is 27020. | ## Planned to add support: _ diff --git a/examples/master_querant.rs b/examples/master_querant.rs index 0878adb..fa2020b 100644 --- a/examples/master_querant.rs +++ b/examples/master_querant.rs @@ -1,6 +1,6 @@ use std::env; -use gamedig::{aliens, aoc, arma2oa, ase, asrd, bat1944, bb2, bm, bo, ccure, cosu, cs, cscz, csgo, css, dod, dods, doi, dst, GDResult, gm, hl2dm, hldms, ins, insmic, inss, l4d, l4d2, mc, onset, pz, ror2, rust, sc, sdtd, tf, tf2, tfc, ts, unturned}; +use gamedig::{aliens, aoc, arma2oa, ase, asrd, avorion, bat1944, bb2, bm, bo, ccure, cosu, cs, cscz, csgo, css, dod, dods, doi, dst, GDResult, gm, hl2dm, hldms, ins, insmic, inss, l4d, l4d2, mc, onset, pz, ror2, rust, sc, sdtd, tf, tf2, tfc, ts, unturned}; use gamedig::protocols::minecraft::LegacyGroup; use gamedig::protocols::valve; use gamedig::protocols::valve::App; @@ -80,6 +80,7 @@ fn main() -> GDResult<()> { "ccure" => println!("{:#?}", ccure::query(ip, port)?), "bo" => println!("{:#?}", bo::query(ip, port)?), "bb2" => println!("{:#?}", bb2::query(ip, port)?), + "avorion" => println!("{:#?}", avorion::query(ip, port)?), _ => panic!("Undefined game: {}", args[1]) }; diff --git a/src/games/avorion.rs b/src/games/avorion.rs new file mode 100644 index 0000000..a0b5a20 --- /dev/null +++ b/src/games/avorion.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 => 27020, + Some(port) => port + }, SteamID::AVORION.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 8dea30d..056cd42 100644 --- a/src/games/mod.rs +++ b/src/games/mod.rs @@ -79,3 +79,5 @@ pub mod ccure; pub mod bo; /// BrainBread 2 pub mod bb2; +/// Avorion +pub mod avorion; diff --git a/src/protocols/valve/types.rs b/src/protocols/valve/types.rs index 704c57e..42d50d6 100644 --- a/src/protocols/valve/types.rs +++ b/src/protocols/valve/types.rs @@ -197,6 +197,8 @@ pub enum SteamID { BM = 362890, /// Colony Survival COSU = 366090, + /// Avorion + AVORION = 445220, /// Day of Infamy DOI = 447820, /// The Forrest