feat(protocol/hytale): add more data to raw, remove https, docs (#752)

* feat: refactor to use http only

* feat: place entire player data in raw field

* feat: add basic data to raw

* feat: remove rejectUnauthorized usage

* docs: add GAMES_LIST.md entry

* docs: add note about mods usage
This commit is contained in:
CosminPerRam 2026-02-03 01:18:30 +02:00 committed by GitHub
parent 1b2345fa02
commit c4adb68040
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 12 additions and 27 deletions

View file

@ -166,6 +166,7 @@
| homefront | Homefront | [Valve Protocol](#valve) |
| homeworld2 | Homeworld 2 | |
| hurtworld | Hurtworld | [Valve Protocol](#valve) |
| hytale | Hytale | [Notes](#hytale) |
| i2cs | IGI 2: Covert Strike | |
| i2s | IL-2 Sturmovik | |
| icarus | Icarus | [Valve Protocol](#valve) |
@ -561,3 +562,6 @@ To fetch more info via telnet (game and mods versions, date and time), at the co
Unfortunately, only verified servers can be queried, for this you'd need a `accountId`, an `apiKey` and `serverId`
(this optional, not providing this just returns the server list associated with the account in the raw object).
### <a name="Hytale"></a>Hytale
The query is done via the [hytale-plugin-query](https://github.com/nitrado/hytale-plugin-query) mod, make sure to configure permissions.
One can also query a server which has the [hytale-sourcequery](https://github.com/physgun-com/hytale-sourcequery) mod via `protocol-valve` but this does not have official support.

View file

@ -1592,6 +1592,9 @@ export const games = {
options: {
port: 5523,
protocol: 'hytale'
},
extra: {
doc_notes: 'hytale'
}
},
i2cs: {

View file

@ -4,21 +4,9 @@ export default class hytale extends Core {
async run (state) {
this.usedTcp = true
// Hytale servers commonly use self-signed certificates for HTTPS.
// We default rejectUnauthorized to false unless explicitly set.
if (this.options.rejectUnauthorized === undefined) {
this.options.rejectUnauthorized = false
}
const response = await this.queryEndpoint()
let response
// Try HTTPS first (most common), fall back to HTTP
try {
response = await this.queryEndpoint('https')
} catch (e) {
this.logger.debug('HTTPS query failed, trying HTTP')
this.logger.debug(e)
response = await this.queryEndpoint('http')
}
state.raw.basic = response.Basic
if (response.Server) {
state.name = response.Server.Name
@ -36,10 +24,7 @@ export default class hytale extends Core {
if (response.Players) {
state.players = response.Players.map(player => ({
name: player.Name,
raw: {
uuid: player.UUID,
world: player.World
}
raw: player
}))
}
@ -48,8 +33,8 @@ export default class hytale extends Core {
}
}
async queryEndpoint (protocol) {
const url = `${protocol}://${this.options.host}:${this.options.port}/Nitrado/Query`
async queryEndpoint () {
const url = `http://${this.options.host}:${this.options.port}/Nitrado/Query`
const requestOptions = {
url,
@ -59,13 +44,6 @@ export default class hytale extends Core {
responseType: 'json'
}
if (protocol === 'https') {
requestOptions.https = {
minVersion: 'TLSv1.2',
rejectUnauthorized: this.options.rejectUnauthorized
}
}
return await this.request(requestOptions)
}
}