feat: add Hawakening support (#648)

* Add support for Hawakening, querying master server

* Outsource backend calls into Api class

* Define json response via schema, optional data validation with Ajv (commented out)

* Add support for Hawakening master query through separate protocol

Protocol 'hawakeningmaster' provides full list of processed server info

* docs: update CHANGELOG and GAMES_LIST for Hawakening

* Additional API check + cleanup

* Allowing public/non-authorized master server query for Hawkening severs

* Fix: Reference the master protocol correctly in docs/games_list

* Reorganized code file, moved schema and API-class to the end
This commit is contained in:
RattleSN4K3 2024-10-12 16:51:56 +02:00 committed by GitHub
parent fe9d4f2cfc
commit d2397b67e7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 765 additions and 2 deletions

View file

@ -150,6 +150,7 @@
| gus | Gore: Ultimate Soldier | |
| halo | Halo | |
| halo2 | Halo 2 | |
| hawakening | Hawakening | [Notes](#hawakening) |
| heretic2 | Heretic II | |
| hexen2 | Hexen II | |
| hiddendangerous2 | Hidden & Dangerous 2 | |
@ -480,6 +481,22 @@ If you know your use case, it's better to use a single protocol or make your own
Farming Simulator servers need a token (reffered as code in the game). It can be obtained at your server's web interface (http://ip:port/settings.html). It can be passed to GameDig with the additional option: `token`. It does only work for your own server.
The response includes much information about the server. Currently, only the fields about server information (name, map, version, etc.), players and mods are parsed.
### <a name='hawakening'></a>Hawakening
Querying server info for Hawakening requires a _ServerId_ to be passed to GameDig instead of an IP address. You can acquire such a _ServerId_ from the master query protocol _hawakeningmaster_ [type: `protocol-hawakeningmaster`] (see `raw.servers[]raw.listing.Guid`).
Additionally, the master server requires authorization. A **user profile is required** for querying the API. Such a profile can be created on the [_official page_](https://hawakening.com/enlist).
- Provide a Server Id via `serverId`
- Provide a client profile with `username` (email address, not callsign)
And one of the following options for gaining access:
- Provide a client access token via the option `token`
- Provide the user profile password via the option `password`
> **_NOTE:_** The protocol `hawakening` will query additional server info by requesting a matchmaking _token_, which will fail for full servers. Due to this, the IP address and port cannot be queried for such servers.
Protocols with Additional Notes
---