mirror of
https://github.com/tribufu/rust-gamedig
synced 2026-06-01 09:42:41 +00:00
Arma 2: Operation Arrowhead support.
This commit is contained in:
parent
aec145a847
commit
9f861df96b
6 changed files with 22 additions and 3 deletions
|
|
@ -9,8 +9,9 @@ Who knows what the future holds...
|
|||
[The Forest](https://store.steampowered.com/app/242760/The_Forest/) support.
|
||||
[Team Fortress Classic](https://store.steampowered.com/app/20/Team_Fortress_Classic/) support.
|
||||
[Sven Co-op](https://store.steampowered.com/app/225840/Sven_Coop/) support.
|
||||
[Rust](https://store.steampowered.com/app/252490/Rust/) support.
|
||||
[Counter-Strike](https://store.steampowered.com/app/10/CounterStrike/) support.
|
||||
[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.
|
||||
|
||||
# 0.0.5 - 15/11/2022
|
||||
Added `SocketBind` error, regarding failing to bind a socket.
|
||||
|
|
|
|||
1
GAMES.md
1
GAMES.md
|
|
@ -26,6 +26,7 @@
|
|||
| SC | Sven Co-op | Valve Protocol | |
|
||||
| RUST | Rust | Valve Protocol | |
|
||||
| CS | Counter-Strike | Valve Protocol | |
|
||||
| ARMA2OA | Arma 2: Operation Arrowhead | Valve Protocol | Use the query port. |
|
||||
|
||||
## Planned to add support:
|
||||
_
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
|
||||
use std::env;
|
||||
use gamedig::{aliens, 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, 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;
|
||||
|
|
@ -55,6 +55,7 @@ fn main() -> GDResult<()> {
|
|||
"sc" => println!("{:#?}", sc::query(ip, port)?),
|
||||
"rust" => println!("{:#?}", rust::query(ip, port)?),
|
||||
"cs" => println!("{:#?}", cs::query(ip, port)?),
|
||||
"arma2oa" => println!("{:#?}", arma2oa::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/arma2oa.rs
Normal file
12
src/games/arma2oa.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 => 2304,
|
||||
Some(port) => port
|
||||
}, SteamID::ARMA2OA.as_app(), None, None)?;
|
||||
|
||||
Ok(game::Response::new_from_valve_response(valve_response))
|
||||
}
|
||||
|
|
@ -51,3 +51,5 @@ pub mod sc;
|
|||
pub mod rust;
|
||||
/// Counter-Strike
|
||||
pub mod cs;
|
||||
/// ARMA 2: Operation Arrowhead
|
||||
pub mod arma2oa;
|
||||
|
|
|
|||
|
|
@ -175,6 +175,8 @@ pub enum SteamID {
|
|||
GM = 4000,
|
||||
/// Insurgency: Modern Infantry Combat
|
||||
INSMIC = 17700,
|
||||
/// ARMA 2: Operation Arrowhead
|
||||
ARMA2OA = 33930,
|
||||
/// Insurgency
|
||||
INS = 222880,
|
||||
/// Sven Co-op
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue