gamedig / rust-gamedig

Game Server Query Library.
https://crates.io/crates/gamedig
MIT License
38 stars 11 forks source link

[Generic] Add generic query settings #86

Closed Douile closed 12 months ago

Douile commented 1 year ago

What is this feature about? Currently generic query only supports setting timeout settings while some protocols allow setting additional options e.g. valve: GatherSettings. It would be nice to have a way to set these when doing a generic query.

Additional context/references One way to implement this would be to have a big CommonSettings struct that has an optional field for every field in all individual protocol settings structs, then implement From to convert CommonSettings to each of the individual settings. The query match statement could then just accept common settings and pass it through using .into() on relevant query.

EDIT: I think valve might actually be the only protocol that currently supports additional settings.

CosminPerRam commented 1 year ago

77 brings Minecraft Java to have additional settings too.