Commit graph

56 commits

Author SHA1 Message Date
Cain
de876227cc fix: bson output 2024-01-16 18:41:10 +00:00
Cain
371e49c969 impl: tcp fin 2024-01-15 16:28:56 +00:00
Cain
7ae162bef4 refactor: clean up and add more features 2024-01-15 15:51:21 +00:00
Cain
69c2cd8cc9 chore: add source link 2024-01-13 11:21:41 +00:00
Cain
79a7141175 chore: format 2024-01-13 10:10:31 +00:00
Cain
3e6dee20a3 refactor: clean up 2024-01-13 09:18:56 +00:00
Cain
e3d791fa5f refactor: backport pcap impl 2024-01-13 03:22:50 +00:00
Cain
f71796f569 merge: Douile fork + local (broken af) 2024-01-12 07:57:16 +00:00
CosminPerRam
a3bc8b79e5 feat(games): add zombie panic: source support 2024-01-11 01:48:05 +02:00
Tom
b248a7661e
feat: Move ID tests into their own crate with a CLI (#177)
* fix: ID tests not in correct directory

* refactor: Move game-id test logic into its own crate

* id-tests: Add CLI that reads JSON input

* id-tests: Update crate docs

* Remove node ID test

* id-tests: Don't try to parse unneeded info

* id-tests: Enable cli feature by default
2024-01-11 01:31:02 +02:00
CosminPerRam
94102d0d7b feat(games): add base defense support 2024-01-07 23:44:35 +02:00
CosminPerRam
c71e783e1e fix(crate): formatting 2024-01-07 23:34:46 +02:00
CosminPerRam
109a3db13e feat(games): add americas army proving grounds support 2024-01-07 23:34:26 +02:00
CosminPerRam
1333655d53 fix(games): atlas definitions steam app id 2024-01-07 23:22:17 +02:00
CosminPerRam
ae9a38907f feat(games): add atlas support 2024-01-07 23:15:35 +02:00
Tom
bd3727d7fe
chore: Tidy up some out of place types (#160)
* tidy: Move TimeoutSettings out of protocol types

* tidy: Move game type to a types file

* tidy: Move generic query functions to own file

* tidy: Move ExtraRequestSettings to game types

* tidy: Move generic query functions into games module

* Revert "tidy: Move ExtraRequestSettings to game types"

This reverts commit aa0d23fc2acc12d68f03265a9caff6f98bf25054.

* Revert "tidy: Move TimeoutSettings out of protocol types"

This reverts commit 7ee10711ed11f17cc06565d4cc9102040d53a319.

* tidy: Re-export types needed for query at the root

* Add/Update badge

---------

Co-authored-by: GitHub Action <action@github.com>
2024-01-02 00:17:43 +02:00
CosminPerRam
a7ee331dc3 feat: add Rising World support 2023-12-30 17:31:22 +02:00
Tom
87ed02420e
feat: Add best effort test to validate game ID rules (#111)
* [Test] Add best effort test to validate game ID rules

An attempt to implement the rules specified in #108 as a programmatic
test.

* [Test] Refactor ID rules to check if a mod exists after - in game name

This allows fivem to pass the check following rule 8, but could also
cause a false pass in some cases.

* [Test] Add unit tests for ID rule checker

Adds unit tests based on the examples in CONTRIBUTING.md to confirm in
those cases we would allow ID to pass. However these tests don't check
any error cases.

* test/id: Correctly extract protocol names

* games/defs: Fix unreal tournament IDs

* tests: Require game definitions to run ID tests

* tests: Improve comments on ID tests

* tests/id: Combine - seperated numbers

* games/defs: Fix darkest hour ID

* Add/Update badge

---------

Co-authored-by: GitHub Action <action@github.com>
2023-12-19 22:20:19 +01:00
CosminPerRam
10169c9107
chore: extract ffow into multiple files (#173)
* chore: extract ffow into multiple files

* fix: serde uses not being conditional
2023-12-19 22:04:45 +01:00
CosminPerRam
bdcf64facf
chore: extract the ship into multiple files (#172)
* chore: extract the ship into multiple files

* fix: actual the ship reference link

* fix: revert last commit and replace in ts
2023-12-19 20:58:15 +01:00
CosminPerRam
99b0269ec2
chore: extract jc2m into multiple files (#171)
* chore: extract jc2m into multiple files

* docs: add jc2m fields public
2023-12-15 20:19:15 +01:00
CosminPerRam
8c52ca6ad3 chore: remove redundant closure 2023-12-11 04:01:41 +02:00
CosminPerRam
44abf6ec71 chore: use Option::map_or_else instead of an if let/else 2023-12-11 04:00:31 +02:00
CosminPerRam
a4bc430868 perf: use of or followed by a function call 2023-12-11 03:58:40 +02:00
CosminPerRam
0aa498b30b chore: simplify condition to use equals operator 2023-12-11 03:56:14 +02:00
CosminPerRam
f746fad157 perf: use of ok_or followed by a function call 2023-12-11 03:54:04 +02:00
CosminPerRam
9c3e6cb51f perf: use of ok_or followed by a function call 2023-12-11 03:53:18 +02:00
CosminPerRam
e1bffd2045 pref: apply const to applicable functions 2023-12-11 03:49:18 +02:00
CosminPerRam
21205fc3cb fix: also add Eq to savage2::Response 2023-12-11 03:47:31 +02:00
CosminPerRam
486abbd9f7 chore: use Self where possible 2023-12-11 03:45:54 +02:00
CosminPerRam
f431508418 chore: use map_or_else instead of if let Some() ... else 2023-12-11 03:41:41 +02:00
CosminPerRam
5d0834ac78 chore: run rustfmt 2023-12-11 03:34:38 +02:00
CosminPerRam
731818ffb1 chore: fixed some long literal lacking separators 2023-12-11 03:34:05 +02:00
CosminPerRam
f1094e0e68 chore: replace the closure with the method itself 2023-12-11 03:31:57 +02:00
CosminPerRam
2836536842 perf: dereference &&str to use specialized ToString implementation 2023-12-11 03:31:18 +02:00
CosminPerRam
81e028e1a0 perf: dereference &&str to use specialized ToString implementation 2023-12-11 03:29:07 +02:00
CosminPerRam
177d22e4b2 chore: instead of .map().unwrap_or_else() use .map_or_else() 2023-12-11 03:26:55 +02:00
CosminPerRam
febba25a91 chore: instead of .map().unwrap_or_else() use .map_or_else() 2023-12-11 03:25:29 +02:00
CosminPerRam
8b4f6083f1 chore: replace ''.to_string with String::new 2023-12-11 03:21:54 +02:00
CosminPerRam
1dc3c6dade chore: replace the closure with the method itself 2023-12-11 03:19:51 +02:00
CosminPerRam
bc2b69d183 fix: remove unwrapping in an assert 2023-12-10 19:46:12 +02:00
CosminPerRam
af8e1e9b1a
feat: add savage 2 support (#169)
* feat: savage 2 support

* fix: add savage 2 to definitions

* chore: run rustfmt

* fix: config serde use

* fix: remove needless borrow

* docs: add savage 2 to protocols.md
2023-12-10 19:39:26 +02:00
CosminPerRam
45f05aec13
feat: add Squad support (#164)
* feat: add Squad support

* Add/Update badge

---------

Co-authored-by: GitHub Action <action@github.com>
2023-12-03 20:59:46 +02:00
CosminPerRam
decff82318
feat: add Post Scriptum support (#163)
* feat: add post scriptum support

* Add/Update badge

---------

Co-authored-by: GitHub Action <action@github.com>
2023-12-03 20:51:43 +02:00
Tom
7510fe3de0
Various improvements for the CLI (#159)
* cli: Do DNS lookup if host is not an IP address

* cli: Add option to output as JSON

* cli: Pass hostname to ExtraRequestSettings if it isn't an IP

* cli: Add help docs to all arguments

* cli: Add options for all extra request settings

* cli: Use a CLI only error for DNS

* cli: Add option to set timeout settings

* docs: Update CHANGELOG

* cli: Add default values to TimeoutSettings

* cli: Refactor finding game definition into its own function

Co-Authored-By: Cain <75994858+cainthebest@users.noreply.github.com>

* cli: Refactor IP resolution into its own set of functions

Co-Authored-By: Cain <75994858+cainthebest@users.noreply.github.com>

* cli: Refactor output formatting into its own functions

Co-Authored-By: Cain <75994858+cainthebest@users.noreply.github.com>

* cli: Improve doc comments for CLI args and derive Debug

Co-Authored-By: Cain <75994858+cainthebest@users.noreply.github.com>

* protocols: Derive Serialize for versioned generic responses

This allows for serializing the output of as_original(). We cannot also
derive Deserialize here because the enums use references to the inner
types, which is unavoidable in the current implementation because
as_original() takes a reference to self.

* cli: Add the output mode options

This allows selected whether to use CommonResponse or the original
response struct when outputting.

* cli: Fix ExtraRequestSettings docs showing up in help output

* cli: Add help headings for timeouts and extra request settings

---------

Co-authored-by: Cain <75994858+cainthebest@users.noreply.github.com>
2023-11-26 22:59:59 +00:00
Tom
b3a29b15b1
[CI] Improvement and fixes (#161)
* protocols: Fix building without the "games" feature

* crate/lib: Add required features for examples

This prevents cargo from running the examples if the required features
aren't enabled.

* ci: Run if ANY Cargo.toml files are changed

* ci: Make sure to run unit tests

* ci: Separate checks for library and CLI

* ci: Add slightly better comments

* ci: Only run deeper tests for CLI or LIB when their files were changed

* ci: Improve act arguments for testing actions locally

* ci: Fix pre-commit not running tests

* ci: Only update shared cache after the initial build

* ci: Make sure that rustup downloads get cached

* tidy: Clean up file formatting

* ci: Fix issue with audit
2023-11-25 00:34:26 +02:00
Tom
e3bdbc2a41
feat: Add connect timeout to TimeoutSettings (#158)
Because TcpSocket connects in Socket::new TimeoutSettings are now
required for Socket::new. Since we already have TimeoutSettings there
Sockets are now expected to apply timeout settings in Socket::new.
2023-11-22 12:40:22 +02:00
CosminPerRam
7416d54b14
chore: Move minecraft protocol to games. (#153)
* chore: initial move and refactor of minecraft

* fix: glob re-exports

* fix: failing example sample

* docs: update changelog to note the mc protocol implementation to games

* docs: add back the reference query standard reference
2023-11-18 19:44:09 +02:00
CosminPerRam
bd73b657c7
fix: minecraft id naming inconsistencies (#152)
* fix: minecraft id naming inconsistencies

* fix: minecraft legacy beta 1.8 being wrongly id named in definitions

* docs: Update CHANGELOG to document minecraft legacy renames

* docs: Update CHANGELOG to note removal of legacy versions game names being prefixed with 'v'
2023-11-16 15:18:15 +02:00
CosminPerRam
0d27882150
feat(unreal2): Add password rule check (#149)
* feat: add initial password checking

* feat: add password string check and made the field a bool

* chore: fix formatting

* feat: add password to has_password common response
2023-11-09 01:18:52 +02:00