mirror of
https://github.com/tribufu/rust-gamedig
synced 2026-06-01 09:42:41 +00:00
Unturned support.
This commit is contained in:
parent
999998f309
commit
7b2cad22ec
6 changed files with 21 additions and 4 deletions
|
|
@ -39,3 +39,5 @@ pub mod mc;
|
|||
pub mod sdtd;
|
||||
/// ARK: Survival Evolved
|
||||
pub mod ase;
|
||||
/// Unturned
|
||||
pub mod unturned;
|
||||
|
|
|
|||
12
src/games/unturned.rs
Normal file
12
src/games/unturned.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::UNTURNED.as_app(), None, None)?;
|
||||
|
||||
Ok(game::Response::new_from_valve_response(valve_response))
|
||||
}
|
||||
|
|
@ -143,7 +143,7 @@ struct ValveProtocol {
|
|||
socket: UdpSocket
|
||||
}
|
||||
|
||||
static PACKET_SIZE: usize = 1600;
|
||||
static PACKET_SIZE: usize = 4096;
|
||||
|
||||
impl ValveProtocol {
|
||||
fn new(address: &str, port: u16, timeout_settings: Option<TimeoutSettings>) -> GDResult<Self> {
|
||||
|
|
|
|||
|
|
@ -175,6 +175,8 @@ pub enum SteamID {
|
|||
INS = 222880,
|
||||
/// 7 Days To Die
|
||||
SDTD = 251570,
|
||||
/// Unturned
|
||||
UNTURNED = 304930,
|
||||
/// ARK: Survival Evolved
|
||||
ASE = 346110,
|
||||
/// Insurgency: Sandstorm
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue