mirror of
https://github.com/tribufu/rust-gamedig
synced 2026-06-01 09:42:41 +00:00
Games: Don't Starve Together support.
This commit is contained in:
parent
dfe544c6aa
commit
bbd2dd7d97
6 changed files with 27 additions and 1 deletions
|
|
@ -1,6 +1,14 @@
|
||||||
|
|
||||||
Who knows what the future holds...
|
Who knows what the future holds...
|
||||||
|
|
||||||
|
# 0.X.Y - DD/MM/2023
|
||||||
|
### Changes:
|
||||||
|
Games:
|
||||||
|
- [Don't Starve Together](https://store.steampowered.com/app/322330/Dont_Starve_Together/) support.
|
||||||
|
|
||||||
|
### Breaking:
|
||||||
|
Nothing.
|
||||||
|
|
||||||
# 0.1.0 - 17/01/2023
|
# 0.1.0 - 17/01/2023
|
||||||
### Changes:
|
### Changes:
|
||||||
Games:
|
Games:
|
||||||
|
|
|
||||||
1
GAMES.md
1
GAMES.md
|
|
@ -36,6 +36,7 @@ Beware of the `Notes` column, as it contains information about query port offset
|
||||||
| Black Mesa | BM | Valve Protocol | |
|
| Black Mesa | BM | Valve Protocol | |
|
||||||
| Project Zomboid | PZ | Valve Protocol | |
|
| Project Zomboid | PZ | Valve Protocol | |
|
||||||
| Age of Chivalry | AOC | Valve Protocol | |
|
| Age of Chivalry | AOC | Valve Protocol | |
|
||||||
|
| Don't Starve Together | DST | Valve Protocol | Query port is 27016. |
|
||||||
|
|
||||||
## 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, bat1944, bm, cs, cscz, csgo, css, dod, dods, doi, GDResult, gm, hl2dm, hldms, ins, insmic, inss, l4d, l4d2, mc, pz, ror2, rust, sc, sdtd, tf, tf2, tfc, ts, unturned};
|
use gamedig::{aliens, aoc, arma2oa, ase, asrd, bat1944, bm, cs, cscz, csgo, css, dod, dods, doi, dst, GDResult, gm, hl2dm, hldms, ins, insmic, inss, l4d, l4d2, mc, 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;
|
||||||
|
|
@ -74,6 +74,7 @@ fn main() -> GDResult<()> {
|
||||||
"bm" => println!("{:#?}", bm::query(ip, port)?),
|
"bm" => println!("{:#?}", bm::query(ip, port)?),
|
||||||
"pz" => println!("{:#?}", pz::query(ip, port)?),
|
"pz" => println!("{:#?}", pz::query(ip, port)?),
|
||||||
"aoc" => println!("{:#?}", aoc::query(ip, port)?),
|
"aoc" => println!("{:#?}", aoc::query(ip, port)?),
|
||||||
|
"dst" => println!("{:#?}", dst::query(ip, port)?),
|
||||||
_ => panic!("Undefined game: {}", args[1])
|
_ => panic!("Undefined game: {}", args[1])
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
12
src/games/dst.rs
Normal file
12
src/games/dst.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 => 27016,
|
||||||
|
Some(port) => port
|
||||||
|
}, SteamID::DST.as_app(), None, None)?;
|
||||||
|
|
||||||
|
Ok(game::Response::new_from_valve_response(valve_response))
|
||||||
|
}
|
||||||
|
|
@ -67,3 +67,5 @@ pub mod bm;
|
||||||
pub mod pz;
|
pub mod pz;
|
||||||
/// Age of Chivalry
|
/// Age of Chivalry
|
||||||
pub mod aoc;
|
pub mod aoc;
|
||||||
|
/// Don't Starve Together
|
||||||
|
pub mod dst;
|
||||||
|
|
|
||||||
|
|
@ -183,6 +183,8 @@ pub enum SteamID {
|
||||||
SC = 225840,
|
SC = 225840,
|
||||||
/// Rust
|
/// Rust
|
||||||
RUST = 252490,
|
RUST = 252490,
|
||||||
|
/// Don't Starve Together
|
||||||
|
DST = 322320,
|
||||||
/// Black Mesa
|
/// Black Mesa
|
||||||
BM = 362890,
|
BM = 362890,
|
||||||
/// Day of Infamy
|
/// Day of Infamy
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue