Day of Infamy support.

This commit is contained in:
CosminPerRam 2022-11-28 20:53:12 +02:00
parent 1ad5031c6f
commit 1c173b76ca
6 changed files with 20 additions and 1 deletions

View file

@ -12,6 +12,7 @@ Who knows what the future holds...
[Rust](https://store.steampowered.com/app/252490/Rust/) support.
[Counter-Strike](https://store.steampowered.com/app/10/CounterStrike/) support.
[Arma 2: Operation Arrowhead](https://store.steampowered.com/app/33930/Arma_2_Operation_Arrowhead/) support.
[Day of Infamy](https://store.steampowered.com/app/447820/Day_of_Infamy/) support.
Successfully tested `Alien Swarm` and `Insurgency: Modern Infantry Combat`.
Restored rules response for `Counter-Strike: Global Offensive` (note: for a full player list response, the cvar `host_players_show` must be set to `2`).
Increased Valve Protocol `PACKET_SIZE` from 1400 to 6144 (because some games send larger packets than the specified protocol size).

View file

@ -28,6 +28,7 @@ A supported game is defined as a game that has been successfully tested, other g
| Rust | RUST | Valve Protocol | |
| Counter-Strike | CS | Valve Protocol (GoldSrc) | |
| Arma 2: Operation Arrowhead | ARMA2OA | Valve Protocol | Use the query port. |
| Day of Infamy | DOI | Valve Protocol | |
## Planned to add support:
_

View file

@ -1,6 +1,6 @@
use std::env;
use gamedig::{aliens, arma2oa, ase, asrd, cs, cscz, csgo, css, dod, dods, GDResult, gm, hl2dm, ins, insmic, inss, l4d, l4d2, mc, rust, sc, sdtd, tf, tf2, tfc, ts, unturned};
use gamedig::{aliens, arma2oa, ase, asrd, cs, cscz, csgo, css, dod, dods, doi, GDResult, gm, hl2dm, ins, insmic, inss, l4d, l4d2, mc, rust, sc, sdtd, tf, tf2, tfc, ts, unturned};
use gamedig::protocols::minecraft::{LegacyGroup, Server};
use gamedig::protocols::valve;
use gamedig::protocols::valve::App;
@ -56,6 +56,7 @@ fn main() -> GDResult<()> {
"rust" => println!("{:#?}", rust::query(ip, port)?),
"cs" => println!("{:#?}", cs::query(ip, port)?),
"arma2oa" => println!("{:#?}", arma2oa::query(ip, port)?),
"doi" => println!("{:#?}", doi::query(ip, port)?),
"_src" => println!("{:#?}", valve::query(ip, 27015, App::Source(None), None, None)?),
"_gld" => println!("{:#?}", valve::query(ip, 27015, App::GoldSrc(false), None, None)?),
"_gld_f" => println!("{:#?}", valve::query(ip, 27015, App::GoldSrc(true), None, None)?),

12
src/games/doi.rs Normal file
View file

@ -0,0 +1,12 @@
use crate::GDResult;
use crate::protocols::valve;
use crate::protocols::valve::{game, SteamID};
pub fn query(address: &str, port: Option<u16>) -> GDResult<game::Response> {
let valve_response = valve::query(address, match port {
None => 27015,
Some(port) => port
}, SteamID::DOI.as_app(), None, None)?;
Ok(game::Response::new_from_valve_response(valve_response))
}

View file

@ -53,3 +53,5 @@ pub mod rust;
pub mod cs;
/// ARMA 2: Operation Arrowhead
pub mod arma2oa;
/// Day of Infamy
pub mod doi;

View file

@ -183,6 +183,8 @@ pub enum SteamID {
SC = 225840,
/// Rust
RUST = 252490,
/// Day of Infamy
DOI = 447820,
/// The Forrest
TF = 556450, //this is the id for the dedicated server, for the game its 242760
/// 7 Days To Die