mirror of
https://github.com/tribufu/rust-gamedig
synced 2026-05-06 15:27:28 +00:00
* [Crate] Replace IpAddr with SocketAddr in protocols * [Crate] Remove usage of address.to_string in socket * [Crate] Update CHANGELOG.md
16 lines
430 B
Rust
16 lines
430 B
Rust
use std::net::{IpAddr, SocketAddr};
|
|
use crate::{
|
|
protocols::valve::{self, game, SteamApp},
|
|
GDResult,
|
|
};
|
|
|
|
pub fn query(address: &IpAddr, port: Option<u16>) -> GDResult<game::Response> {
|
|
let valve_response = valve::query(
|
|
&SocketAddr::new(*address, port.unwrap_or(27016)),
|
|
SteamApp::ROR2.as_engine(),
|
|
None,
|
|
None,
|
|
)?;
|
|
|
|
Ok(game::Response::new_from_valve_response(valve_response))
|
|
}
|