From 56a90eabcebc4adf83a6a3d2f5801e526bd2e454 Mon Sep 17 00:00:00 2001 From: CosminPerRam Date: Tue, 21 Jan 2025 19:40:49 +0200 Subject: [PATCH] fix: Nadeo failing queries on map info (#667) * fix: nadeo failing queries * docs: update changelog, fix games list issue not being hyperlinked * feat: Adding CurrentChallengeInfo to get Map Informations (#669) Co-authored-by: Stephan Schaffner * docs: remove note removal notice from games_list * docs: update changelog to note for version * docs: mention @Hornochs in the changelog line * chore: swap some lines around --------- Co-authored-by: Stephan Schaffner Co-authored-by: Stephan Schaffner --- CHANGELOG.md | 1 + GAMES_LIST.md | 6 +++--- protocols/nadeo.js | 21 ++++++++++----------- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 84aed2e..77c1e32 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ * Feat: Exfil (2024) - Added support (#661) * Docs: Valheim numplayers being always 0 on crossplay servers (#668) * Fix: Palworld not respecting query output schema (#666) +* Fix: Nadeo failing queries on map info (also added version field) (#667 with @Hornochs) ## 5.1.4 * Feat: Replaced `punycode` package usage with `url.domainToASCII` (#630). diff --git a/GAMES_LIST.md b/GAMES_LIST.md index 37aa8da..691ac52 100644 --- a/GAMES_LIST.md +++ b/GAMES_LIST.md @@ -430,9 +430,9 @@ If you do not wish to run the plugin, or do not require details such as channel you can use the 'mumbleping' server type instead, which uses a less accurate but more reliable solution ### Nadeo (ShootMania / TrackMania / etc) -The server must have xmlrpc enabled, and you must pass the xmlrpc port to GameDig, not the connection port. -You must have a user account on the server with access level User or higher. -Pass the login into to GameDig with the additional options: login, password +The server must have `xmlrpc` enabled, the port needs to be the `xmlrpc` one, not the connection port. +You must also pass the info of a user account on the server with the access level of **User** or higher +in the options parameters as `login` and `password`. ### Grand Theft Auto V - RAGE MP If you are using a FQDN for your server, you will need to set the host parameter to be this domain e.g. rage2.mydomain.com diff --git a/protocols/nadeo.js b/protocols/nadeo.js index 6177b2e..49e29ad 100644 --- a/protocols/nadeo.js +++ b/protocols/nadeo.js @@ -9,20 +9,19 @@ export default class nadeo extends Core { await this.query(client, 'Authenticate', this.options.login, this.options.password) this.registerRtt(Date.now() - start) - // const data = this.methodCall(client, 'GetStatus'); - { const results = await this.query(client, 'GetServerOptions') state.name = this.stripColors(results.Name) state.password = (results.Password !== 'No password') state.maxplayers = results.CurrentMaxPlayers state.raw.maxspectators = results.CurrentMaxSpectators + state.raw.GetServerOptions = results } { - const results = await this.query(client, 'GetCurrentMapInfo') + const results = await this.query(client, 'GetCurrentChallengeInfo') state.map = this.stripColors(results.Name) - state.raw.mapUid = results.UId + state.raw.GetCurrentChallengeInfo = results } { @@ -37,12 +36,13 @@ export default class nadeo extends Core { if (igm === 5) gamemode = 'Cup' state.raw.gametype = gamemode state.raw.mapcount = results.NbChallenge + state.raw.GetCurrentGameInfo = results } { - const results = await this.query(client, 'GetNextMapInfo') - state.raw.nextmapName = this.stripColors(results.Name) - state.raw.nextmapUid = results.UId + const results = await this.query(client, 'GetVersion') + state.version = results.Version + state.raw.GetVersion = results } if (this.options.port === 5000) { @@ -71,11 +71,10 @@ export default class nadeo extends Core { } } - async query (client, ...cmdset) { - const cmd = cmdset[0] - const params = cmdset.slice(1) + async query (client, command, ...args) { + const params = args.slice() - const sentPromise = client.query(cmd, params) + const sentPromise = client.query(command, params) const timeoutPromise = Promises.createTimeout(this.options.socketTimeout, 'GBX Method Call') return await Promise.race([sentPromise, timeoutPromise, this.abortedPromise]) }