mirror of
https://github.com/tribufu/rust-gamedig
synced 2026-06-01 09:42:41 +00:00
Games: Operation Harsh Doorstop support.
This commit is contained in:
parent
719ae9d591
commit
fe46359e47
6 changed files with 20 additions and 1 deletions
|
|
@ -11,6 +11,7 @@ Games:
|
||||||
- [Ballistic Overkill](https://store.steampowered.com/app/296300/Ballistic_Overkill/) support.
|
- [Ballistic Overkill](https://store.steampowered.com/app/296300/Ballistic_Overkill/) support.
|
||||||
- [BrainBread 2](https://store.steampowered.com/app/346330/BrainBread_2/) support.
|
- [BrainBread 2](https://store.steampowered.com/app/346330/BrainBread_2/) support.
|
||||||
- [Avorion](https://store.steampowered.com/app/445220/Avorion/) support.
|
- [Avorion](https://store.steampowered.com/app/445220/Avorion/) support.
|
||||||
|
- [Operation: Harsh Doorstop](https://store.steampowered.com/app/736590/Operation_Harsh_Doorstop/) support.
|
||||||
|
|
||||||
### Breaking:
|
### Breaking:
|
||||||
Nothing.
|
Nothing.
|
||||||
|
|
|
||||||
1
GAMES.md
1
GAMES.md
|
|
@ -43,6 +43,7 @@ Beware of the `Notes` column, as it contains information about query port offset
|
||||||
| Ballistic Overkill | BO | Valve Protocol | Query port is 27016. |
|
| Ballistic Overkill | BO | Valve Protocol | Query port is 27016. |
|
||||||
| BrainBread 2 | BB2 | Valve Protocol | |
|
| BrainBread 2 | BB2 | Valve Protocol | |
|
||||||
| Avorion | AVORION | Valve Protocol | Query port is 27020. |
|
| Avorion | AVORION | Valve Protocol | Query port is 27020. |
|
||||||
|
| Operation: Harsh Doorstop | OHD | Valve Protocol | Query port is 27005. |
|
||||||
|
|
||||||
## Planned to add support:
|
## Planned to add support:
|
||||||
_
|
_
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
|
|
||||||
use std::env;
|
use std::env;
|
||||||
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::{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, ohd, onset, pz, ror2, rust, sc, sdtd, tf, tf2, tfc, ts, unturned};
|
||||||
use gamedig::protocols::minecraft::LegacyGroup;
|
use gamedig::protocols::minecraft::LegacyGroup;
|
||||||
use gamedig::protocols::valve;
|
use gamedig::protocols::valve;
|
||||||
use gamedig::protocols::valve::App;
|
use gamedig::protocols::valve::App;
|
||||||
|
|
@ -81,6 +81,7 @@ fn main() -> GDResult<()> {
|
||||||
"bo" => println!("{:#?}", bo::query(ip, port)?),
|
"bo" => println!("{:#?}", bo::query(ip, port)?),
|
||||||
"bb2" => println!("{:#?}", bb2::query(ip, port)?),
|
"bb2" => println!("{:#?}", bb2::query(ip, port)?),
|
||||||
"avorion" => println!("{:#?}", avorion::query(ip, port)?),
|
"avorion" => println!("{:#?}", avorion::query(ip, port)?),
|
||||||
|
"ohd" => println!("{:#?}", ohd::query(ip, port)?),
|
||||||
_ => panic!("Undefined game: {}", args[1])
|
_ => panic!("Undefined game: {}", args[1])
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -81,3 +81,5 @@ pub mod bo;
|
||||||
pub mod bb2;
|
pub mod bb2;
|
||||||
/// Avorion
|
/// Avorion
|
||||||
pub mod avorion;
|
pub mod avorion;
|
||||||
|
/// Operation: Harsh Doorstop
|
||||||
|
pub mod ohd;
|
||||||
|
|
|
||||||
12
src/games/ohd.rs
Normal file
12
src/games/ohd.rs
Normal 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 => 27005,
|
||||||
|
Some(port) => port
|
||||||
|
}, SteamID::OHD.as_app(), None, None)?;
|
||||||
|
|
||||||
|
Ok(game::Response::new_from_valve_response(valve_response))
|
||||||
|
}
|
||||||
|
|
@ -215,6 +215,8 @@ pub enum SteamID {
|
||||||
ASRD = 563560,
|
ASRD = 563560,
|
||||||
/// Risk of Rain 2
|
/// Risk of Rain 2
|
||||||
ROR2 = 632360,
|
ROR2 = 632360,
|
||||||
|
/// Operation: Harsh Doorstop
|
||||||
|
OHD = 950900, // this is the id for the dedicated server, for the game its 736590
|
||||||
/// Onset
|
/// Onset
|
||||||
ONSET = 1105810,
|
ONSET = 1105810,
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue