Commit graph

391 commits

Author SHA1 Message Date
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
e0cc2a2420 fix: readme examples folder returning not found since monorepo merge 2023-12-10 23:32:12 +02:00
CosminPerRam
35c2aec19b Merge branch 'main' of github.com:gamedig/rust-gamedig 2023-12-10 19:46:21 +02:00
CosminPerRam
bc2b69d183 fix: remove unwrapping in an assert 2023-12-10 19:46:12 +02:00
CosminPerRam
55f498d45a fix: add jc2m in protocols.md 2023-12-10 19:43:32 +02:00
CosminPerRam
dd204936f0 chore: fix unreal 2 entry in protocols.md 2023-12-10 19:41:28 +02:00
GitHub Action
fb6f22b801 Add/Update badge 2023-12-10 17:39:46 +00: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
Tom
dd037daa04
Revert "Bump actions/labeler from 4 to 5 in /.github/workflows (#165)" (#167)
This reverts commit 04da29f2a6.
2023-12-07 22:51:45 +02:00
dependabot[bot]
04da29f2a6
Bump actions/labeler from 4 to 5 in /.github/workflows (#165)
Bumps [actions/labeler](https://github.com/actions/labeler) from 4 to 5.
- [Release notes](https://github.com/actions/labeler/releases)
- [Commits](https://github.com/actions/labeler/compare/v4...v5)

---
updated-dependencies:
- dependency-name: actions/labeler
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-12-05 18:03:27 +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
0c7dbe76d7
ci: Update node coverage badge to work without games.txt (#156)
* ci: Update node coverage badge to work without games.txt

Fixes #155 using a new node script that should be more robust than the
old shell script.

* ci: Change badge cron time to less common time

By doing at a less common time we should reduce action time usage as
the runners will be under less load.

* Add/Update badge

* ci: Improve node-badge script

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

* ci: Run node badge action if script changes

* ci: Update node badge path for workspaces

* ci: Revert loading games from index in node badge script

---------

Co-authored-by: GitHub Action <action@github.com>
Co-authored-by: CosminPerRam <cosmin.p@live.com>
2023-11-23 11:48:24 +02:00
Tom
3f1164ef5d
docs: Add info about commits to CONTRIBUTING (#157)
* docs: Add info about commits to CONTRIBUTING

* docs: Improve commits wording
2023-11-22 13:48:01 +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
13f1c2bf35 docs: Add the initial addition of the CLI notice to CHANGELOG. 2023-11-09 01:21:29 +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
dependabot[bot]
f01cac8fed
Bump actions/checkout from 3 to 4 in /.github/workflows (#151)
Bumps [actions/checkout](https://github.com/actions/checkout) from 3 to 4.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v3...v4)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-11-09 01:15:38 +02:00
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