Commit graph

349 commits

Author SHA1 Message Date
Cain
c9c8e700cb
chore: add dependabot config (#150) 2023-11-08 23:56:58 +02:00
Cain
89222b1f44
Feat: merge gamedig-cli partially & monorepo conversion
Related issue: #125
2023-11-08 21:31:02 +00:00
Cain
a11ca7f9aa chore: add release opts 2023-11-08 21:11:25 +00:00
Cain
338df9144c chore: update cargo.toml 2023-11-08 20:44:31 +00:00
Cain
963040fb84 Merge branch 'main' into feat/cli 2023-11-08 20:42:07 +00:00
Cain
92ad618723 chore: remove un-needed fmt skip 2023-11-08 20:22:04 +00:00
Douile
1d7cb31bc4
protocols/unreal2: Only compile game impl macros when needed
Unreal2 hadn't been added when #144 was merged so this got missed out.
2023-10-30 13:50:17 +00:00
Tom
529abe9d76
feat: Add the unreal2 protocol (#124)
* WIP: Add unreal2 protocol

* Add/Update badge

* protocols/unreal2: Update doc comments and TODOs

* protocols/unreal2: Don't pre-allocate as many bot players

* protocols/unreal2: Use "encoding-rs" for decoding unreal2 strings

* Add/Update badge

* protocols/unreal2: Add constants for player pre-allocation.

Also improve some doc comments and update PACKET_SIZE.

* protocols/unreal2: Early break when enough players have been parsed

Add a fast-path to avoid waiting for packet timeout when we have parsed
as many players as specified in the server info packet.

* protocols/unreal2: Use HashSet to store mutators

* protocols/unreal2: Handle server sending multiple values for a rule

* protocols/unreal2: Add GatheringSettings to control what to query

GatheringSettings allows skipping querying rules and/or players which
can make the query return much faster. This also required moving each
individual query into its own helper.

* protocols/unreal2: Add more derives to types

* protocols/unreal2: Simplify ServerInfo::parse()

Co-Authored-By: CosminPerRam <cosmin.p@live.com>

* Docs: Add unreal2 protocol documentation

I used a website to generate the markdown RESPONSES table, the save file
from this website is included to make updating the table easier in the
future.

https://www.tablesgenerator.com/markdown_tables

* Add/Update badge

* protocols/unreal2: Use the correct encoding for UCS2 strings

* Docs: Remove unnecessary TGN file

---------

Co-authored-by: GitHub Action <action@github.com>
Co-authored-by: CosminPerRam <cosmin.p@live.com>
2023-10-30 13:37:15 +02:00
Tom
5c1568251a
feat: Only compile game impl macros when they are needed (#144)
These macros are only required when compiling the code gated behind the
games feature, they are unused if that feature is not and are also crate
only.
2023-10-30 11:30:16 +02:00
CosminPerRam
4bbe7e1780 fix: run proper formatting on valve_protocol_query example 2023-10-29 14:49:49 +02:00
CosminPerRam
a3740c5424 fix: remove double similar use on minecraft mod 2023-10-29 14:44:21 +02:00
CosminPerRam
adb2109aea feat: add valve protocol query example 2023-10-29 14:43:35 +02:00
CosminPerRam
f11a50a415 feat: Add Conan Exiles support. 2023-10-29 00:10:47 +03:00
CosminPerRam
1145a064a9 feat: Add The Front support. 2023-10-29 00:00:48 +03:00
CosminPerRam
e3dd7cd1c7
Fix some game ids and clarify rules 6 and 7. (#143)
* Fix wrongly named game ids of l4d, l4d2 and q3a

* Specify how edition/protocol names are appended to games, rule 7

* Clarify rule 6 regarding numbers

* Add/Update badge

* Fix rule 7 misswording

* Fix 7 Days to Die

* List id changes in the changelog

* Forgot to fix test

* Apply Douile suggestion regarding rule 6

Co-authored-by: Tom <25043847+Douile@users.noreply.github.com>

* Fix typo on rule 6 and wrap text

* Clarify further rule 7

---------

Co-authored-by: GitHub Action <action@github.com>
Co-authored-by: Tom <25043847+Douile@users.noreply.github.com>
2023-10-24 22:39:36 +03:00
CosminPerRam
2cc9e56168
feat: Remove SteamApp (#142)
* Remove the SteamApp enum.

* Further removal

* Replace SteamApp with Engine on game! usage

* Add removal of SteamApp in changelog

* docs: Update reference of SteamApp to Engine

* Update the docs of the Engine type to be more descriptive.
2023-10-21 23:13:14 +03:00
CosminPerRam
501524b0da
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
2023-10-19 23:15:10 +03:00
GitHub Action
6b92e883ef Add/Update badge 2023-10-17 23:31:19 +00:00
Douile
9644163c8c
[fmt] Run rustfmt on crates/cli/src/error.rs 2023-10-18 00:29:21 +01:00
Douile
d34d615784
[CI] Update CI to work with workspaces 2023-10-18 00:29:21 +01:00
Tom
1ca6e6e85c
[Clippy] Remove .clone() from timeout_settings as it is now Copy (#127)
These clones are unnecessary when the type implements Copy and this was
generating clippy warnings.
2023-10-17 19:26:03 +03:00
Douile
8a88e826fa
[Repo] Link to CONTRIBUTING.md in README 2023-10-17 13:37:48 +01:00
Cain
7d4649b6f5 refactor: cli to work next to lib 2023-10-17 00:05:32 +01:00
GitHub Action
6084c56d4f Add/Update badge 2023-10-16 22:21:11 +00:00
Cain
80f6b87991 refator: copy cli into mono 2023-10-16 23:20:47 +01:00
CosminPerRam
66ae3c296e [Crate] Bump version to 0.4.1 2023-10-13 00:43:22 +03:00
GitHub Action
ef29ba8eb4 Add/Update badge 2023-10-12 21:40:31 +00:00
CosminPerRam
5b5c41b468 Add Barotrauma support. 2023-10-13 00:40:08 +03:00
Tom
3b9c784e70
Reduce game implementation repetition (#122)
* [Games] Add macro to replace valve game query implementations

This somewhat reduces repeated code (#120), and also adds auto-generated
doc comments to all valve game query functions.

* [Games] Add macro to replace gamespy game query implementations

This somewhat reduces repeated code (#120), and also adds auto-generated
doc comments to all gamespy game query functions.

* [Games] Add macro to replace quake game query implementations

This somewhat reduces repeated code (#120), and also adds auto-generated
doc comments to all quake game query functions.

* [Games] Move all valve game modules into a single file using macros

Vastly reduces the number of files. However does break the game
definition-per-file test, so that was removed.

* [Games] Move all quake game modules into a single file using macros

* [Games] Move all gamespy game modules into a single file using macros

* [Docs] Update CHANGELOG

* [Docs] Improve game query function generation macro documentation

* [Games] Add missed Halo: Combat Evolved to gamespy
2023-10-10 09:26:35 +03:00
CosminPerRam
c8a93357cf
Add Send and Sync on Error Source (#118)
* Add Send and Sync on Error Source and remove 'static

* Add back 'static

* Update the changelog
2023-10-09 19:11:34 +03:00
GitHub Action
b7e1eff9b7 Add/Update badge 2023-10-09 01:12:54 +00:00
CosminPerRam
b584e11336 Remove serde derives Generic Player and Response 2023-10-08 22:26:25 +03:00
CosminPerRam
1e083c2df7 [Generic] Add missing derives to types 2023-10-08 19:45:24 +03:00
CosminPerRam
7164ab5f64 [Protocol] Add derives to RequestSettings and new_just_hostname function 2023-10-08 00:37:11 +03:00
CosminPerRam
2106e965e4 [Crate] Bump version to 0.4.0 2023-10-07 19:27:43 +03:00
CosminPerRam
53fe402f05 [Repo] Fix typo in README. 2023-10-07 19:26:31 +03:00
CosminPerRam
a3800f3ba4 [Crate] Update byteorder from 1.4 to 1.5 2023-10-07 18:58:21 +03:00
CosminPerRam
40d4be2ceb Remove CosminPerRam from authors as he is not the sole maintainer anymore 2023-10-07 18:36:32 +03:00
CosminPerRam
311a5425a8
Remove minecraftping from game definitions as its useless (#117)
* Remove minecraftping from game definitions as its useless

* Update minecraftpocket name
2023-10-07 18:06:18 +03:00
CosminPerRam
5280ecb3c6
[Game] Apply new id naming (#114)
* Apply new id naming

* Fix failing CI on all features

* Update changelog

* Rename tf2 example to teamfortress2

* Fix typo in steamapp game names

* Rename minecraft legacy versions

* Apply CI node badge fix by Douile

* Add/Update badge

---------

Co-authored-by: GitHub Action <action@github.com>
2023-10-06 17:20:30 +03:00
Tom
b4c61781fb
Specify the branch name when pushing node badge commits (#116)
* [CI] Specify the branch name when pushing node badge commits

Fixes #115

* testing: remove games to update badge

* Add/Update badge

* Revert "testing: remove games to update badge"

This reverts commit 8256176839e996810568f5104a7c6a19ab482ab0.

* Add/Update badge

---------

Co-authored-by: GitHub Action <action@github.com>
2023-10-05 11:46:35 +03:00
CosminPerRam
9db873e774
Fix rule 3 example not following rule 2 (#113) 2023-10-04 11:20:03 +03:00
CosminPerRam
e7567c631e
[Repo] Add CONTRIBUTING.md. (#108)
* Add initial CONTRIBUTING.md file

* Update CONTRIBUTING.md

Co-authored-by: Tom <25043847+Douile@users.noreply.github.com>

* Specify to look whether there is an existing relevant issue first

* Specify that ids are lowercased only

* Fix tyope.

* Specify special case with multiple editions/versions

* Clarify an id already existing and fix typo

* Add new rule to specify what to do about names that being with numbers

* Simplify numbering rules

* Simplify numbering rules

* Specify on #1 unless #4 applies

* Specify naming for game names

* Add rule regarding mods that add ability for queries

* Remake rule 7 to include protocol naming

* Specify lowercase aplhanumeric

---------

Co-authored-by: Tom <25043847+Douile@users.noreply.github.com>
2023-10-02 23:38:31 +03:00
CosminPerRam
05eb902891
[Examples] Remove master_querant example due to being obsolete (#109) 2023-10-02 20:10:55 +03:00
CosminPerRam
9107bf5ef2 Update CHANGELOG.md to mention contributors 2023-10-01 12:34:10 +03:00
Tom
efc1828b29
[Protocol] Make gamespy1 parsing less likely to fail (#107)
* [Protocol] Gamespy1 don't skip "playername" field (#88)

* [Protocol] Gamespy1 make more player fields optional (#88)

These fields seem to be missing from bf1942 queries so make them
optional.
2023-09-27 17:07:42 +03:00
CosminPerRam
5bd609af72 [Crate] Update README to have a more title-like project name 2023-09-27 13:59:44 +03:00
Tom
c3281be419
[Protocol] Retry failed requests (#95)
* Add retry count to TimeoutSettings

This can be used to specify how many times to re-send requests that
fail. The default value is "1" so the if the first request fails, 1 more
attempt will be made.

* Add retries to valve queries

* [Protocol] &Optional<TimeoutSettings> add get_retries_or_default

Allow fetching the number of retries or the default retries value from a
borrowed optional TimeoutSettings.

* [Protocol] Add retries to minecraft protocol

* [Protocol] Add retries to quake

* [Protocol] Add retries to gamespy

* [Protocol] Update TimeoutSettings docs, and change default retries to 0

* Remove logging from retry_on_timeout

* [Protocol] TimeoutSettings make retries non-optional

* [Protocol] Move retry logic into lower level query functions

Retries are now implemented as wrappers on the single function that
would need to be retried on timeout.

In order to avoid cloning of TimeoutSettings, Socket::apply_timeouts()
was changed to accept a borrowed TimeoutSettings. And extra helpers were
added to the TimeoutSettings impl to reduce repetition.

* [Examples] Add retries to the generic example

* Also retry on PacketSend error

Sending packets could also timeout and until error_generic_member_access
is stable we have no way of determining the type of the underlying
`std::error::Error`.

* Add retry unit tests

* [Docs] Update changelog
2023-09-25 22:12:54 +03:00
GitHub Action
3784d25774 Add/Update badge 2023-09-22 21:20:17 +00:00
Tom
52750fba76
[Games] Update game definitions to match node-gamedig names (#100)
* [Games] Update game definitions to match node-gamedig names

* Update game file names to match definitions

* [Games] rename minecraft definitions to better match node

* [Games] Add test that all game files match definition name

* Update SteamApp to match node names

* [Games] Update the forest to match node-GameDig#367

* Clippy fix in games test

* [Docs] Update GAMES.md with new names

* [DOCS] Update changelog
2023-09-23 00:20:01 +03:00