feat: add Ark: Survival Ascended support (#197)

* feat: add initial epic client auth call

* fix: working client auth

* feat: unfinished initial EOS query

* first successful query

* first successful server query

* run fmt

* be a bit more detailed about servers

* properly run fmt for sure this time fr fr

* port of what node gamedig has done

* feat: remove query_raw_values to query_raw

* feat: add raw field to epic response

* feat: pass SocketAddr to epic

* feat: remove unused pub access to internal only struct

* feat: add initial generic impl

* fix: possibly conditional comp

* feat: add epic to the protocol list

* feat: add version and add epic to RESPONSES.md

* feat: add asa to definitions

* feat: add initial protocol macros

* feat: conditional serde ser and des

* fix: cfg serde stuff

* fix: epic macro warn dead code

* partial feature gate epic to tls

* fix: remove asa from game definitions
This commit is contained in:
CosminPerRam 2024-04-21 18:53:33 +03:00 committed by GitHub
parent 1620ba36b8
commit 45ffa53de3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
15 changed files with 434 additions and 81 deletions

View file

@ -8,6 +8,9 @@ use crate::protocols::types::{GatherToggle, ProprietaryProtocol};
use crate::protocols::valve::GatheringSettings;
use phf::{phf_map, Map};
#[cfg(feature = "tls")]
use crate::protocols::epic::Credentials;
macro_rules! game {
($name: literal, $default_port: expr, $protocol: expr) => {
game!(

View file

@ -0,0 +1,15 @@
//! Unreal2 game query modules
use crate::protocols::epic::game_query_mod;
game_query_mod!(
asa,
"Ark: Survival Ascended",
7777,
Credentials {
deployment: "ad9a8feffb3b4b2ca315546f038c3ae2",
id: "xyza7891muomRmynIIHaJB9COBKkwj6n",
secret: "PP5UGxysEieNfSrEicaD1N2Bb3TdXuD7xHYcsdUHZ7s",
auth_by_external: false,
}
);

View file

@ -1,10 +1,14 @@
//! Currently supported games.
#[cfg(feature = "tls")]
pub mod epic;
pub mod gamespy;
pub mod quake;
pub mod unreal2;
pub mod valve;
#[cfg(feature = "tls")]
pub use epic::*;
pub use gamespy::*;
pub use quake::*;
pub use unreal2::*;

View file

@ -48,6 +48,10 @@ pub fn query_with_timeout_and_extra_settings(
)
.map(Box::new)?
}
#[cfg(feature = "tls")]
Protocol::Epic(credentials) => {
protocols::epic::query_with_timeout(credentials.clone(), &socket_addr, timeout_settings).map(Box::new)?
}
Protocol::Gamespy(version) => {
match version {
GameSpyVersion::One => protocols::gamespy::one::query(&socket_addr, timeout_settings).map(Box::new)?,