* 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
* Add rich error type with source and backtrace
Adds a rich error type that will take a backtrace and allow capturing
the source of the error. The best way to use this is with the included
helpers that will automatically capture the backtrace and convert the
source error:
```
GDRichError::packet_bad_from_into("Reason packet was bad")
```
* [Crate] Bump MSRV to 1.65.0
This is required for backtraces in rich errors.
* Remove leftover debug logging
* [Errors] Replace variant overloads with single .rich method on kind enum
This overhaul replaces the exhaustive impls of each variant as multiple
methods on the rich error type with a singular .rich() method on the
kind enum. This consumes the variant and converts it to a rich error
with a source (.into() can be used if a source is not needed).
I also took the liberty of replacing all usages with the this new method
as I saw fit (adding various error messages) and converting a few
PacketBad errors to TypeParse errors when they are the result of parse
failing.
* Fix problem with rustdoc
* Remove BadGame's owned string
* Rename GDError to GDErrorKind
* Rename GDRichError to GDError
* Remove error impl from GDErrorKind
* Fix tests not passing
* Use error context everywhere map_err is used
* Improve GDError display formatter
* Add tests for new error type
Replace usages of Ipv4Addr with IpAddr which allows the use of either Ipv4 or Ipv6.
This patch essentially consists of running:
"sed -i 's/Ipv4Addr/IpAddr/g' src/**/*.rs examples/*"
and fixing the errors.
* chore: add standard for formatting
* chore: manually tidy up imports and format
* chore: remove vscode and add to gitignore
* chore: alphabetically order and fix
* chore: format
* chore: fix format issue with payload
* chore: format as merge had unformatted code
* [format] Fix comments, change max width and binop operator
---------
Co-authored-by: CosminPerRam <cosmin.p@live.com>
* Added needed ground stuff
* Minecraft bedrock support!
* Documentation acknowledgements!
* Added utf8_le_undended test, some docs and modified master_querant
* Modified query function to comply with the others
Before: game query -> protocol query (get port or default port)
After: game query (get port or default port) -> protocol query
* Modified md files
* Initial minecraft support
* Made previews_chat an option
* Better error handling and removed version structure
* Minecraft Server types
* Fixed compilation and renamed stuff
* 'extract till you drop!' extracted sockets
* extracted java version and fixed socket udp receive
* Legacy 1.4 and 1.6 implementation (incomplete)
* Furter implementation
* Implementations work
* Protocol beta v1.8+ implemented
* Removed bedrock support
* Added auto query
* Renamed minecraft to mc and added to md's
* Docs, renames and small optimization changes
* Changed java version to be able to return None on players sample