mirror of
https://github.com/tribufu/rust-gamedig
synced 2026-06-01 09:42:41 +00:00
The Forest support.
This commit is contained in:
parent
ed2161a6da
commit
21b7d91ee6
6 changed files with 22 additions and 3 deletions
|
|
@ -5,7 +5,8 @@ Who knows what the future holds...
|
||||||
[Minecraft](https://www.minecraft.com) implementation (bedrock not supported yet).
|
[Minecraft](https://www.minecraft.com) implementation (bedrock not supported yet).
|
||||||
[7 Days To Die](https://store.steampowered.com/app/251570/7_Days_to_Die/) support.
|
[7 Days To Die](https://store.steampowered.com/app/251570/7_Days_to_Die/) support.
|
||||||
[ARK: Survival Evolved](https://store.steampowered.com/app/346110/ARK_Survival_Evolved/) support.
|
[ARK: Survival Evolved](https://store.steampowered.com/app/346110/ARK_Survival_Evolved/) support.
|
||||||
[Unturned](https://store.steampowered.com/app/304930/Unturned/) support.
|
[Unturned](https://store.steampowered.com/app/304930/Unturned/) support.
|
||||||
|
[The Forest](https://store.steampowered.com/app/242760/The_Forest/) support.
|
||||||
|
|
||||||
# 0.0.5 - 15/11/2022
|
# 0.0.5 - 15/11/2022
|
||||||
Added `SocketBind` error, regarding failing to bind a socket.
|
Added `SocketBind` error, regarding failing to bind a socket.
|
||||||
|
|
|
||||||
3
GAMES.md
3
GAMES.md
|
|
@ -13,7 +13,7 @@
|
||||||
| ALIENS | Alien Swarm | Valve Protocol | Not tested. |
|
| ALIENS | Alien Swarm | Valve Protocol | Not tested. |
|
||||||
| ASRD | Alien Swarm: Reactive Drop | Valve Protocol | |
|
| ASRD | Alien Swarm: Reactive Drop | Valve Protocol | |
|
||||||
| INS | Insurgency | Valve Protocol | |
|
| INS | Insurgency | Valve Protocol | |
|
||||||
| INSS | Insurgency: Sandstorm | Valve Protocol | Use the query port, not the server port. |
|
| INSS | Insurgency: Sandstorm | Valve Protocol | Use the query port. |
|
||||||
| INSMIC | Insurgency: Modern Infantry Combat | Valve Protocol | Not tested. |
|
| INSMIC | Insurgency: Modern Infantry Combat | Valve Protocol | Not tested. |
|
||||||
| CSCZ | Counter-Strike: Condition Zero | Valve Protocol | |
|
| CSCZ | Counter-Strike: Condition Zero | Valve Protocol | |
|
||||||
| DOD | Day of Defeat | Valve Protocol | |
|
| DOD | Day of Defeat | Valve Protocol | |
|
||||||
|
|
@ -21,6 +21,7 @@
|
||||||
| SDTD | 7 Days To Die | Valve Protocol | |
|
| SDTD | 7 Days To Die | Valve Protocol | |
|
||||||
| ASE | ARK: Survival Evolved | Valve Protocol | |
|
| ASE | ARK: Survival Evolved | Valve Protocol | |
|
||||||
| UNTURNED | Unturned | Valve Protocol | |
|
| UNTURNED | Unturned | Valve Protocol | |
|
||||||
|
| TF | The Forest | Valve Protocol | Use the query port. |
|
||||||
|
|
||||||
## Planned to add support:
|
## Planned to add support:
|
||||||
_
|
_
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
|
|
||||||
use std::env;
|
use std::env;
|
||||||
use gamedig::{aliens, ase, asrd, cscz, csgo, css, dod, dods, GDResult, gm, hl2dm, ins, insmic, inss, l4d, l4d2, mc, sdtd, tf2, ts, unturned};
|
use gamedig::{aliens, ase, asrd, cscz, csgo, css, dod, dods, GDResult, gm, hl2dm, ins, insmic, inss, l4d, l4d2, mc, sdtd, tf, tf2, ts, unturned};
|
||||||
use gamedig::protocols::minecraft::{LegacyGroup, Server};
|
use gamedig::protocols::minecraft::{LegacyGroup, Server};
|
||||||
use gamedig::protocols::valve;
|
use gamedig::protocols::valve;
|
||||||
use gamedig::protocols::valve::App;
|
use gamedig::protocols::valve::App;
|
||||||
|
|
@ -50,6 +50,7 @@ fn main() -> GDResult<()> {
|
||||||
"7dtd" => println!("{:#?}", sdtd::query(ip, port)?),
|
"7dtd" => println!("{:#?}", sdtd::query(ip, port)?),
|
||||||
"ase" => println!("{:#?}", ase::query(ip, port)?),
|
"ase" => println!("{:#?}", ase::query(ip, port)?),
|
||||||
"unturned" => println!("{:#?}", unturned::query(ip, port)?),
|
"unturned" => println!("{:#?}", unturned::query(ip, port)?),
|
||||||
|
"tf" => println!("{:#?}", tf::query(ip, port)?),
|
||||||
"_src" => println!("{:#?}", valve::query(ip, 27015, App::Source(None), None, None)?),
|
"_src" => println!("{:#?}", valve::query(ip, 27015, App::Source(None), None, None)?),
|
||||||
"_gld" => println!("{:#?}", valve::query(ip, 27015, App::GoldSrc(false), 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)?),
|
"_gld_f" => println!("{:#?}", valve::query(ip, 27015, App::GoldSrc(true), None, None)?),
|
||||||
|
|
|
||||||
|
|
@ -41,3 +41,5 @@ pub mod sdtd;
|
||||||
pub mod ase;
|
pub mod ase;
|
||||||
/// Unturned
|
/// Unturned
|
||||||
pub mod unturned;
|
pub mod unturned;
|
||||||
|
/// The Forest
|
||||||
|
pub mod tf;
|
||||||
|
|
|
||||||
12
src/games/tf.rs
Normal file
12
src/games/tf.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::TF.as_app(), None, None)?;
|
||||||
|
|
||||||
|
Ok(game::Response::new_from_valve_response(valve_response))
|
||||||
|
}
|
||||||
|
|
@ -173,6 +173,8 @@ pub enum SteamID {
|
||||||
INSMIC = 17700,
|
INSMIC = 17700,
|
||||||
/// Insurgency
|
/// Insurgency
|
||||||
INS = 222880,
|
INS = 222880,
|
||||||
|
/// The Forrest
|
||||||
|
TF = 556450, //this is the id for the dedicated server, for the game its 242760
|
||||||
/// 7 Days To Die
|
/// 7 Days To Die
|
||||||
SDTD = 251570,
|
SDTD = 251570,
|
||||||
/// Unturned
|
/// Unturned
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue