feat: Add GatheringSettings on Valve macros (#128)

* Initial macro modification for gathering settings

* Initial Valheim support

* Remove unused use

* Fix macro

Thanks bunch @Douile

* docs: Add Valheim to CHANGELOG and GAMES

* Add commentary regarding gathering settings comment generation

* Add GatheringSettings to game!

* Remove unused stuff

* Fix tests and add comment regarding the game argument
This commit is contained in:
CosminPerRam 2023-10-19 23:15:10 +03:00 committed by GitHub
parent 1ca6e6e85c
commit 501524b0da
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 89 additions and 21 deletions

View file

@ -39,6 +39,8 @@ pub struct Game {
pub default_port: u16,
/// The protocol the game's query uses
pub protocol: Protocol,
/// Request settings.
pub request_settings: ExtraRequestSettings,
}
#[cfg(feature = "game_defs")]
@ -78,7 +80,9 @@ pub fn query_with_timeout_and_extra_settings(
protocols::valve::query(
&socket_addr,
steam_app.as_engine(),
extra_settings.map(ExtraRequestSettings::into),
extra_settings
.or(Option::from(game.request_settings.clone()))
.map(ExtraRequestSettings::into),
timeout_settings,
)
.map(Box::new)?