mirror of
https://github.com/tribufu/rust-gamedig
synced 2026-05-18 09:35:50 +00:00
Rust support.
This commit is contained in:
parent
de3ac9aad5
commit
3f58e99c28
6 changed files with 20 additions and 1 deletions
|
|
@ -47,3 +47,5 @@ pub mod tf;
|
|||
pub mod tfc;
|
||||
/// Sven Co-op
|
||||
pub mod sc;
|
||||
/// Rust
|
||||
pub mod rust;
|
||||
|
|
|
|||
12
src/games/rust.rs
Normal file
12
src/games/rust.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 => 27015,
|
||||
Some(port) => port
|
||||
}, SteamID::RUST.as_app(), None, None)?;
|
||||
|
||||
Ok(game::Response::new_from_valve_response(valve_response))
|
||||
}
|
||||
|
|
@ -177,6 +177,8 @@ pub enum SteamID {
|
|||
INS = 222880,
|
||||
/// Sven Co-op
|
||||
SC = 225840,
|
||||
/// Rust
|
||||
RUST = 252490,
|
||||
/// The Forrest
|
||||
TF = 556450, //this is the id for the dedicated server, for the game its 242760
|
||||
/// 7 Days To Die
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue