From 1ef09d470b723574fdb37a802d13777eb48f70a9 Mon Sep 17 00:00:00 2001 From: CosminPerRam Date: Thu, 18 Jan 2024 23:11:03 +0200 Subject: [PATCH 01/43] feat: breadth attempt order (#486) * feat: breadth attempt order * fix: remove stray console log from debugging --- CHANGELOG.md | 1 + README.md | 1 + bin/gamedig.js | 2 +- lib/QueryRunner.js | 32 ++++++++++++++++++++------------ 4 files changed, 23 insertions(+), 13 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ea0118c..701a101 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -36,6 +36,7 @@ * `stripColors` (defaults to `true`) for protocols that strips colors: unreal2, savage2, quake3, nadeo, gamespy2, doom3, armagetron. * `requestRulesRequired` (defaults to `false`) Valve games only. `requestRules` is always required to have a response or the query will timeout. * `requestPlayersRequired` (defaults to `false`) Valve games only. Querying players is always required to have a response or the query will timeout. Some [games](GAMES_LIST.md) may not provide a players response. + * `noBreadthOrder` (defaults to `false`). If multiple attempts are to be made, disable doing one of each type until reaching the retry count. * Now documented: `address` (defaults to `undefined`) Override the IP address of the server skipping DNS resolution. When set, host will not be resolved, instead address will be connected to. However, some protocols still use host for other reasons e.g. as part of the query. * `maxAttempts` has been renamed to `maxRetries`. diff --git a/README.md b/README.md index 29442b1..309defb 100644 --- a/README.md +++ b/README.md @@ -52,6 +52,7 @@ Confused on how this works, or you want to see more? Checkout the [examples](/ex | **requestPlayersRequired** | boolean | false | Valve games only. Querying players is always required to have a response or the query will timeout. Some [games](GAMES_LIST.md) may not provide a players response. | | **stripColors** | boolean | true | Enables stripping colors for protocols: unreal2, savage2, quake3, nadeo, gamespy2, doom3, armagetron. | | **portCache** | boolean | true | After you queried a server, the second time you query that exact server (identified by specified ip and port), first add an attempt to query with the last successful port. | +| **noBreadthOrder** | boolean | false | Enable the behaviour of retrying an attempt X times followed by the next attempt X times, otherwise try attempt A, then B, then A, then B until reaching the X retry count of each. | ## Query Response diff --git a/bin/gamedig.js b/bin/gamedig.js index c9420d3..e4d294a 100644 --- a/bin/gamedig.js +++ b/bin/gamedig.js @@ -6,7 +6,7 @@ import Minimist from 'minimist' import { GameDig } from './../lib/index.js' const argv = Minimist(process.argv.slice(2), { - boolean: ['pretty', 'debug', 'givenPortOnly', 'requestRules', 'requestRulesRequired', 'requestPlayersRequired', 'stripColors', 'portCache'], + boolean: ['pretty', 'debug', 'givenPortOnly', 'requestRules', 'requestRulesRequired', 'requestPlayersRequired', 'stripColors', 'portCache', 'noBreadthOrder'], string: ['guildId', 'listenUdpPort', 'ipFamily'], default: { stripColors: true, diff --git a/lib/QueryRunner.js b/lib/QueryRunner.js index 6c12f31..11288b6 100644 --- a/lib/QueryRunner.js +++ b/lib/QueryRunner.js @@ -8,6 +8,7 @@ const defaultOptions = { maxRetries: 1, stripColors: true, portCache: true, + noBreadthOrder: false, ipFamily: 0 } @@ -76,22 +77,29 @@ export default class QueryRunner { const numRetries = userOptions.maxRetries || gameOptions.maxRetries || defaultOptions.maxRetries + const retries = Array.from({ length: numRetries }, (x, i) => i) + + const attemptOrder = [] + if (optionsCollection.noBreadthOrder) { + attempts.forEach(attempt => retries.forEach(retry => attemptOrder.push({ attempt, retry }))) + } else { + retries.forEach(retry => attempts.forEach(attempt => attemptOrder.push({ attempt, retry }))) + } + let attemptNum = 0 const errors = [] - for (const attempt of attempts) { - for (let retry = 0; retry < numRetries; retry++) { - attemptNum++ + for (const { attempt, retry } of attemptOrder) { + attemptNum++ - try { - const response = await this._attempt(attempt) - if (attempt.portCache) { - this.portCache[`${userOptions.address}:${userOptions.port}`] = attempt.port - } - return response - } catch (e) { - e.stack = 'Attempt #' + attemptNum + ' - Port=' + attempt.port + ' Retry=' + (retry) + ':\n' + e.stack - errors.push(e) + try { + const response = await this._attempt(attempt) + if (attempt.portCache) { + this.portCache[`${userOptions.address}:${userOptions.port}`] = attempt.port } + return response + } catch (e) { + e.stack = 'Attempt #' + attemptNum + ' - Port=' + attempt.port + ' Retry=' + (retry) + ':\n' + e.stack + errors.push(e) } } From d4babb078b484d15a7a7301413c32cf72bacf211 Mon Sep 17 00:00:00 2001 From: Pedro Ivo Hudson Date: Thu, 18 Jan 2024 18:24:08 -0300 Subject: [PATCH 02/43] feat: add new port to V Rising (#483) * chore: add new port to V Rising * update CHANGELOG * update changelog --- CHANGELOG.md | 1 + lib/games.js | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 701a101..afb50b8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -45,6 +45,7 @@ placeholders in the `players` fields. * Valve: dont skip players with no name and keep state.raw.players. * Stabilized field `numplayers`. +* V Rising (2022) - Updated `options.port_query_offset` to `[1, 15]` (#438). * BeamMP (2021) - Added support. * Call of Duty: Black Ops 3 (2015) - Added support. diff --git a/lib/games.js b/lib/games.js index 0adc043..2f3f2f0 100644 --- a/lib/games.js +++ b/lib/games.js @@ -2670,7 +2670,7 @@ export const games = { name: 'V Rising', options: { port: 27015, - port_query_offset: 1, + port_query_offset: [1, 15], protocol: 'valve' }, release_year: 2022 From 587d67ede0951cee873ec0365bf82fbb036b8034 Mon Sep 17 00:00:00 2001 From: CosminPerRam Date: Fri, 19 Jan 2024 00:20:45 +0200 Subject: [PATCH 03/43] chore: regenerate GAMES_LIST.md --- GAMES_LIST.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/GAMES_LIST.md b/GAMES_LIST.md index 8becdb1..ab45f1d 100644 --- a/GAMES_LIST.md +++ b/GAMES_LIST.md @@ -59,9 +59,9 @@ | cod2 | Call of Duty 2 | | | cod3 | Call of Duty 3 | | | cod4mw | Call of Duty 4: Modern Warfare | | +| codbo3 | Call of Duty: Black Ops 3 | [Valve Protocol](#valve) | | codenamecure | Codename CURE | [Valve Protocol](#valve) | | codenameeagle | Codename Eagle | | -| codbo3 | Call of Duty: Black Ops 3 | | | codmw2 | Call of Duty: Modern Warfare 2 | | | codmw3 | Call of Duty: Modern Warfare 3 | [Valve Protocol](#valve) | | coduo | Call of Duty: United Offensive | | @@ -164,8 +164,8 @@ | kpctnc | Kiss: Psycho Circus: The Nightmare Child | | | kreedzclimbing | Kreedz Climbing | [Valve Protocol](#valve) | | kspd | Kerbal Space Program - DMP | | -| left4dead | Left 4 Dead | [Valve Protocol](#valve) | -| left4dead2 | Left 4 Dead 2 | [Valve Protocol](#valve) | +| l4d | Left 4 Dead | [Valve Protocol](#valve) | +| l4d2 | Left 4 Dead 2 | [Valve Protocol](#valve) | | m2m | Mafia II - Multiplayer | | | m2o | Mafia II - Online | | | mbe | Minecraft: Bedrock Edition | | @@ -270,6 +270,7 @@ | swjkja | Star Wars Jedi Knight: Jedi Academy | | | swrc | Star Wars: Republic Commando | | | synergy | Synergy | [Valve Protocol](#valve) | +| t1s | Tribes 1: Starsiege | | | tacticalops | Tactical Ops | | | tcgraw | Tom Clancy's Ghost Recon Advanced Warfighter | | | tcgraw2 | Tom Clancy's Ghost Recon Advanced Warfighter 2 | | @@ -296,7 +297,6 @@ | trackmania2 | Trackmania 2 | [Notes](#nadeo-shootmania--trackmania--etc) | | trackmaniaforever | Trackmania Forever | [Notes](#nadeo-shootmania--trackmania--etc) | | tremulous | Tremulous | | -| tribes1starsiege | Tribes 1: Starsiege | | | tribesvengeance | Tribes: Vengeance | | | tron20 | Tron 2.0 | | | turok2 | Turok 2 | | From e05ac1fd488696c0415ead88232a84734cce7e07 Mon Sep 17 00:00:00 2001 From: CosminPerRam Date: Fri, 19 Jan 2024 00:27:53 +0200 Subject: [PATCH 04/43] feat: add Unreal 2: The Awakening - XMP support (#488) * feat: add Unreal 2: The Awakening (XMP) support * fix: game name --- CHANGELOG.md | 1 + GAMES_LIST.md | 1 + lib/games.js | 9 +++++++++ 3 files changed, 11 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index afb50b8..ba4a9c2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -48,6 +48,7 @@ placeholders in the `players` fields. * V Rising (2022) - Updated `options.port_query_offset` to `[1, 15]` (#438). * BeamMP (2021) - Added support. * Call of Duty: Black Ops 3 (2015) - Added support. +* Unreal 2: The Awakening - XMP - Added support. ### 4.3.1 * Fixed support for the Minecraft [Better Compatibility Checker](https://www.curseforge.com/minecraft/mc-mods/better-compatibility-checker) Mod (By @Douile, #436). diff --git a/GAMES_LIST.md b/GAMES_LIST.md index ab45f1d..1dd1c82 100644 --- a/GAMES_LIST.md +++ b/GAMES_LIST.md @@ -300,6 +300,7 @@ | tribesvengeance | Tribes: Vengeance | | | tron20 | Tron 2.0 | | | turok2 | Turok 2 | | +| u2tax | Unreal 2: The Awakening - XMP | | | universalcombat | Universal Combat | | | unreal | Unreal | | | unrealtournament | Unreal Tournament | | diff --git a/lib/games.js b/lib/games.js index 2f3f2f0..17c93b4 100644 --- a/lib/games.js +++ b/lib/games.js @@ -2541,6 +2541,15 @@ export const games = { }, release_year: 1998 }, + u2tax: { + name: 'Unreal 2: The Awakening - XMP', + options: { + port: 7777, + port_query_offset: 1, + protocol: 'unreal2' + }, + release_year: 2003 + }, universalcombat: { name: 'Universal Combat', options: { From 10718d917cb836922649eb10bb9bce41c845c41f Mon Sep 17 00:00:00 2001 From: CosminPerRam Date: Fri, 19 Jan 2024 00:33:27 +0200 Subject: [PATCH 05/43] feat: add xonotic support (#472) --- CHANGELOG.md | 1 + GAMES_LIST.md | 1 + lib/games.js | 8 ++++++++ 3 files changed, 10 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index ba4a9c2..df9b235 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -47,6 +47,7 @@ placeholders in the `players` fields. * Stabilized field `numplayers`. * V Rising (2022) - Updated `options.port_query_offset` to `[1, 15]` (#438). * BeamMP (2021) - Added support. +* Xonotic (2011) - Added support. * Call of Duty: Black Ops 3 (2015) - Added support. * Unreal 2: The Awakening - XMP - Added support. diff --git a/GAMES_LIST.md b/GAMES_LIST.md index 1dd1c82..02247e8 100644 --- a/GAMES_LIST.md +++ b/GAMES_LIST.md @@ -323,6 +323,7 @@ | wolfenstein | Wolfenstein | | | wot | Wheel of Time | | | wurmunlimited | Wurm Unlimited | [Valve Protocol](#valve) | +| xonotic | Xonotic | | | xpandrally | Xpand Rally | | | zombiemaster | Zombie Master | [Valve Protocol](#valve) | | zps | Zombie Panic: Source | [Valve Protocol](#valve) | diff --git a/lib/games.js b/lib/games.js index 17c93b4..5e03096 100644 --- a/lib/games.js +++ b/lib/games.js @@ -2742,6 +2742,14 @@ export const games = { }, release_year: 2006 }, + xonotic: { + name: 'Xonotic', + options: { + port: 26000, + protocol: 'quake3' + }, + release_year: 2011 + }, xpandrally: { name: 'Xpand Rally', options: { From 68a3ad40d1bbdf91054f5533d2d98b59071363f0 Mon Sep 17 00:00:00 2001 From: Pedro Ivo Hudson Date: Thu, 18 Jan 2024 19:39:59 -0300 Subject: [PATCH 06/43] chore: add EOS protocol note (#489) * chore: add EOS notes * Update CHANGELOG.md --- CHANGELOG.md | 1 + GAMES_LIST.md | 17 ++++++++++++----- tools/generate_games_list.js | 3 +++ 3 files changed, 16 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index df9b235..ad637f3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -45,6 +45,7 @@ placeholders in the `players` fields. * Valve: dont skip players with no name and keep state.raw.players. * Stabilized field `numplayers`. +* Add note about EOS Protocol not providing players data. * V Rising (2022) - Updated `options.port_query_offset` to `[1, 15]` (#438). * BeamMP (2021) - Added support. * Xonotic (2011) - Added support. diff --git a/GAMES_LIST.md b/GAMES_LIST.md index 02247e8..d93a545 100644 --- a/GAMES_LIST.md +++ b/GAMES_LIST.md @@ -20,7 +20,7 @@ | armagetronadvanced | Armagetron Advanced | | | armareforger | ARMA: Reforger | [Valve Protocol](#valve) | | armaresistance | ARMA: Resistance | | -| asa | Ark: Survival Ascended | | +| asa | Ark: Survival Ascended | [EOS Protocol](#eos) | | ase | Ark: Survival Evolved | [Valve Protocol](#valve) | | asr08 | Arca Sim Racing '08 | | | assettocorsa | Assetto Corsa | | @@ -445,12 +445,19 @@ Valheim servers will only respond to queries if they are started in public mode ### DayZ DayZ stores some of it's servers information inside the `tags` attribute. Make sure to set `requestRules: true` to access it. Some data inside `dayzMods` attribute may be fuzzy, due to how mods are loaded into the servers. Players can be fetched, but will not show ingame names. Alternatively, some servers may have a [third party tool](https://dayzsalauncher.com/#/tools) that you can use to get the mods information. If it's installed, you can access it via browser with the game servers IP:PORT, but add up 10 to the port. (eg. if game port is 2302 then use 2312). -### Valve Protocol -For many valve games, additional 'rules' may be fetched into the unstable `raw` field by passing the additional -option: `requestRules: true`. Beware that this may increase query time. - ### The Front Responses with wrong `name` (gives out a steamid instead of the server name) and `maxplayers` (always 200, whatever the config would be) field values. ### Conan Exiles Conan Exiles never responds to player query. + + +Protocols with Additional Notes +--- + +### Valve Protocol +For many valve games, additional 'rules' may be fetched into the unstable `raw` field by passing the additional +option: `requestRules: true`. Beware that this may increase query time. + +### Epic Online Services (EOS) Protocol +EOS does not provide players data. \ No newline at end of file diff --git a/tools/generate_games_list.js b/tools/generate_games_list.js index 9b61d61..a5cdd45 100644 --- a/tools/generate_games_list.js +++ b/tools/generate_games_list.js @@ -34,6 +34,9 @@ for (const id in sortedGames) { if (game.options.protocol === 'valve' || game.options.protocol === 'dayz') { notes.push('[Valve Protocol](#valve)') } + if (game.options.protocol === 'epic' || game.options.protocol === 'asa') { + notes.push('[EOS Protocol](#epic)') + } if (notes.length) { generated += ' | ' + notes.join(', ') } From c502790295815b5051690b2f7861c6cd872d9b5a Mon Sep 17 00:00:00 2001 From: CosminPerRam Date: Sat, 20 Jan 2024 18:02:17 +0200 Subject: [PATCH 07/43] chore: run eslint on tools/run-id-tests --- tools/run-id-tests.js | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/tools/run-id-tests.js b/tools/run-id-tests.js index 2504e2e..799a8e4 100644 --- a/tools/run-id-tests.js +++ b/tools/run-id-tests.js @@ -1,18 +1,18 @@ -import { spawnSync } from 'node:child_process'; -import process from 'node:process'; +import { spawnSync } from 'node:child_process' +import process from 'node:process' // Import directly from file so that this script works without dependencies installed. -import { games } from './../lib/games.js'; +import { games } from './../lib/games.js' -const ID_TEST_BIN = process.env["GAMEDIG_ID_TESTER"] || "gamedig-id-tests"; +const ID_TEST_BIN = process.env.GAMEDIG_ID_TESTER || 'gamedig-id-tests' const result = spawnSync(ID_TEST_BIN, { - input: JSON.stringify(games), - stdio: ['pipe', 'inherit', 'inherit'], -}); + input: JSON.stringify(games), + stdio: ['pipe', 'inherit', 'inherit'] +}) if (result.error) { - throw result.error; + throw result.error } -process.exit(result.status); +process.exit(result.status) From cbf66e127cbb6e776ce8e000396e94e365ab9f97 Mon Sep 17 00:00:00 2001 From: Pedro Ivo Hudson Date: Sat, 20 Jan 2024 13:21:53 -0300 Subject: [PATCH 08/43] chore: add Minecraft notes (#492) * chore: add Minecraft note about players * Update CHANGELOG.md --- CHANGELOG.md | 1 + GAMES_LIST.md | 4 +++- lib/games.js | 3 +++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ad637f3..2a48b93 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -47,6 +47,7 @@ placeholders in the `players` fields. * Stabilized field `numplayers`. * Add note about EOS Protocol not providing players data. * V Rising (2022) - Updated `options.port_query_offset` to `[1, 15]` (#438). +* Minecraft (2009) - Add note about players data * BeamMP (2021) - Added support. * Xonotic (2011) - Added support. * Call of Duty: Black Ops 3 (2015) - Added support. diff --git a/GAMES_LIST.md b/GAMES_LIST.md index d93a545..f990d13 100644 --- a/GAMES_LIST.md +++ b/GAMES_LIST.md @@ -171,7 +171,7 @@ | mbe | Minecraft: Bedrock Edition | | | medievalengineers | Medieval Engineers | [Valve Protocol](#valve) | | mgm | Mumble - GT Murmur | [Notes](#mumble) | -| minecraft | Minecraft | | +| minecraft | Minecraft | [Notes](#minecraft) | | mnc | Monday Night Combat | [Valve Protocol](#valve) | | moh | Medal of Honor | | | moha | Medal of Honor: Airborne | | @@ -451,6 +451,8 @@ Responses with wrong `name` (gives out a steamid instead of the server name) and ### Conan Exiles Conan Exiles never responds to player query. +### Minecraft +Many Minecraft servers do not respond with players data. Protocols with Additional Notes --- diff --git a/lib/games.js b/lib/games.js index 5e03096..05ea501 100644 --- a/lib/games.js +++ b/lib/games.js @@ -1517,6 +1517,9 @@ export const games = { port: 25565, protocol: 'minecraft' }, + extra: { + doc_notes: 'minecraft' + }, release_year: 2009 }, mbe: { From 96e2054a0461d3118b650a2b7bd806574f1d49ab Mon Sep 17 00:00:00 2001 From: Jonathan Lambert Date: Sat, 20 Jan 2024 22:36:05 +0000 Subject: [PATCH 09/43] feat: add support for Palworld (#495) * Added Palworld * Tidy up * Improve variable wording for Epic auth --- GAMES_LIST.md | 1 + lib/games.js | 8 ++++++ protocols/epic.js | 61 ++++++++++++++++++++++++++++++++++++++++--- protocols/index.js | 3 ++- protocols/palworld.js | 13 +++++++++ 5 files changed, 81 insertions(+), 5 deletions(-) create mode 100644 protocols/palworld.js diff --git a/GAMES_LIST.md b/GAMES_LIST.md index f990d13..0fc2237 100644 --- a/GAMES_LIST.md +++ b/GAMES_LIST.md @@ -203,6 +203,7 @@ | openarena | OpenArena | | | openttd | OpenTTD | | | painkiller | Painkiller | | +| palworld | Palworld | [EOS Protocol](#eos) | | pce | Primal Carnage: Extinction | [Valve Protocol](#valve) | | pixark | PixARK | [Valve Protocol](#valve) | | postal2 | Postal 2 | | diff --git a/lib/games.js b/lib/games.js index 05ea501..ad0354e 100644 --- a/lib/games.js +++ b/lib/games.js @@ -1754,6 +1754,14 @@ export const games = { }, release_year: 2004 }, + palworld: { + name: 'Palworld', + release_year: 2024, + options: { + port: 8221, + protocol: 'palworld' + } + }, pvak2: { name: 'Pirates, Vikings, and Knights II', options: { diff --git a/protocols/epic.js b/protocols/epic.js index 5225fcf..5fc5960 100644 --- a/protocols/epic.js +++ b/protocols/epic.js @@ -15,6 +15,9 @@ export default class Epic extends Core { this.clientSecret = null this.deploymentId = null this.epicApi = 'https://api.epicgames.dev' + this.authByExternalToken = false // Some games require a client access token to POST to the matchmaking endpoint. + + this.deviceIdAccessToken = null this.accessToken = null // Don't use the tcp ping probing @@ -22,13 +25,18 @@ export default class Epic extends Core { } async run (state) { - await this.getAccessToken() + if (this.authByExternalToken) { + await this.getExternalAccessToken() + } else { + await this.getClientAccessToken() + } + await this.queryInfo(state) await this.cleanup(state) } - async getAccessToken () { - this.logger.debug('Requesting acess token ...') + async getClientAccessToken () { + this.logger.debug('Requesting client access token ...') const url = `${this.epicApi}/auth/v1/oauth/token` const body = `grant_type=client_credentials&deployment_id=${this.deploymentId}` @@ -43,6 +51,50 @@ export default class Epic extends Core { this.accessToken = response.access_token } + async _getDeviceIdToken () { + this.logger.debug('Requesting deviceId access token ...') + + const url = `${this.epicApi}/auth/v1/accounts/deviceid` + const body = 'deviceModel=PC' + const headers = { + Authorization: `Basic ${Buffer.from(`${this.clientId}:${this.clientSecret}`).toString('base64')}`, + 'Content-Type': 'application/x-www-form-urlencoded' + } + + this.logger.debug(`POST: ${url}`) + const response = await this.request({ url, body, headers, method: 'POST', responseType: 'json' }) + + return response.access_token + } + + async getExternalAccessToken () { + this.logger.debug('Requesting external access token ...') + + const deviceIdToken = await this._getDeviceIdToken() + + const url = `${this.epicApi}/auth/v1/oauth/token` + + const bodyParts = [ + 'grant_type=external_auth', + 'external_auth_type=deviceid_access_token', + `external_auth_token=${deviceIdToken}`, + 'nonce=ABCHFA3qgUCJ1XTPAoGDEF', // This is required but can be set to anything + `deployment_id=${this.deploymentId}`, + 'display_name=User' + ] + + const body = bodyParts.join('&') + const headers = { + Authorization: `Basic ${Buffer.from(`${this.clientId}:${this.clientSecret}`).toString('base64')}`, + 'Content-Type': 'application/x-www-form-urlencoded' + } + + this.logger.debug(`POST: ${url}`) + const response = await this.request({ url, body, headers, method: 'POST', responseType: 'json' }) + + this.accessToken = response.access_token + } + async queryInfo (state) { const url = `${this.epicApi}/matchmaking/v1/${this.deploymentId}/filter` const body = { @@ -65,7 +117,8 @@ export default class Epic extends Core { // Epic returns a list of sessions, we need to find the one with the desired port. const hasDesiredPort = (session) => session.attributes.ADDRESSBOUND_s === `0.0.0.0:${this.options.port}` || - session.attributes.ADDRESSBOUND_s === `${this.options.address}:${this.options.port}` + session.attributes.ADDRESSBOUND_s === `${this.options.address}:${this.options.port}` || + session.attributes.GAMESERVER_PORT_l === this.options.port const desiredServer = response.sessions.find(hasDesiredPort) diff --git a/protocols/index.js b/protocols/index.js index ab72a60..89571cf 100644 --- a/protocols/index.js +++ b/protocols/index.js @@ -29,6 +29,7 @@ import mumble from './mumble.js' import mumbleping from './mumbleping.js' import nadeo from './nadeo.js' import openttd from './openttd.js' +import palworld from './palworld.js' import quake1 from './quake1.js' import quake2 from './quake2.js' import quake3 from './quake3.js' @@ -55,7 +56,7 @@ import dayz from './dayz.js' export { armagetron, ase, asa, assettocorsa, battlefield, buildandshoot, cs2d, discord, doom3, eco, epic, ffow, fivem, gamespy1, gamespy2, gamespy3, geneshift, goldsrc, hexen2, jc2mp, kspdmp, mafia2mp, mafia2online, minecraft, - minecraftbedrock, minecraftvanilla, mumble, mumbleping, nadeo, openttd, quake1, quake2, quake3, rfactor, samp, + minecraftbedrock, minecraftvanilla, mumble, mumbleping, nadeo, openttd, palworld, quake1, quake2, quake3, rfactor, samp, savage2, starmade, starsiege, teamspeak2, teamspeak3, terraria, tribes1, tribes1master, unreal2, ut3, valve, vcmp, ventrilo, warsow, eldewrito, beammpmaster, beammp, dayz } diff --git a/protocols/palworld.js b/protocols/palworld.js new file mode 100644 index 0000000..6894bb2 --- /dev/null +++ b/protocols/palworld.js @@ -0,0 +1,13 @@ +import Epic from './epic.js' + +export default class palworld extends Epic { + constructor () { + super() + + // OAuth2 credentials extracted from Palworld files. + this.clientId = 'xyza78916PZ5DF0fAahu4tnrKKyFpqRE' + this.clientSecret = 'j0NapLEPm3R3EOrlQiM8cRLKq3Rt02ZVVwT0SkZstSg' + this.deploymentId = '0a18471f93d448e2a1f60e47e03d3413' + this.authByExternalToken = true + } +} From 4b0c98b3cb227fbfd8d6c78baeafbc4fe7fe5bfe Mon Sep 17 00:00:00 2001 From: CosminPerRam Date: Sun, 21 Jan 2024 00:42:11 +0200 Subject: [PATCH 10/43] chore: add Palworld to changelog and games_list Forgot to mention to do in #495 --- CHANGELOG.md | 1 + GAMES_LIST.md | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2a48b93..c2facb6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -52,6 +52,7 @@ placeholders in the `players` fields. * Xonotic (2011) - Added support. * Call of Duty: Black Ops 3 (2015) - Added support. * Unreal 2: The Awakening - XMP - Added support. +* Palworld - Added support (By @jonathanprl, #495). ### 4.3.1 * Fixed support for the Minecraft [Better Compatibility Checker](https://www.curseforge.com/minecraft/mc-mods/better-compatibility-checker) Mod (By @Douile, #436). diff --git a/GAMES_LIST.md b/GAMES_LIST.md index 0fc2237..8163905 100644 --- a/GAMES_LIST.md +++ b/GAMES_LIST.md @@ -20,7 +20,7 @@ | armagetronadvanced | Armagetron Advanced | | | armareforger | ARMA: Reforger | [Valve Protocol](#valve) | | armaresistance | ARMA: Resistance | | -| asa | Ark: Survival Ascended | [EOS Protocol](#eos) | +| asa | Ark: Survival Ascended | [EOS Protocol](#epic) | | ase | Ark: Survival Evolved | [Valve Protocol](#valve) | | asr08 | Arca Sim Racing '08 | | | assettocorsa | Assetto Corsa | | @@ -203,7 +203,7 @@ | openarena | OpenArena | | | openttd | OpenTTD | | | painkiller | Painkiller | | -| palworld | Palworld | [EOS Protocol](#eos) | +| palworld | Palworld | | | pce | Primal Carnage: Extinction | [Valve Protocol](#valve) | | pixark | PixARK | [Valve Protocol](#valve) | | postal2 | Postal 2 | | @@ -462,5 +462,5 @@ Protocols with Additional Notes For many valve games, additional 'rules' may be fetched into the unstable `raw` field by passing the additional option: `requestRules: true`. Beware that this may increase query time. -### Epic Online Services (EOS) Protocol -EOS does not provide players data. \ No newline at end of file +### Epic Online Services (EOS) Protocol +EOS does not provide players data. From e176ee128196ffe1d5de39f98cb6a89779d1ef0c Mon Sep 17 00:00:00 2001 From: CosminPerRam Date: Sun, 21 Jan 2024 00:52:58 +0200 Subject: [PATCH 11/43] chore: reformat a bit changelog updated dependencies section --- CHANGELOG.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c2facb6..84912da 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,11 +18,11 @@ * Replaced usage of deprecated `substr` with `substring`. * Replaced deprecated internal `punycode` with the [punycode](https://www.npmjs.com/package/punycode) package. * Updated dependencies: -* * [got](https://github.com/sindresorhus/got) from 12.1 to 13. -* * [minimist](https://github.com/minimistjs/minimist) from 1.2.6 to 1.2.8. -* * [long](https://github.com/dcodeIO/long.js) from 5.2.0 to 5.2.3. -* * @types/node from 14.18.13 to 16.18.58. -* * [cheerio](https://github.com/cheeriojs/cheerio) from 1.0.0-rc.10 to 1.0.0-rc.12. + * [got](https://github.com/sindresorhus/got) from 12.1 to 13. + * [minimist](https://github.com/minimistjs/minimist) from 1.2.6 to 1.2.8. + * [long](https://github.com/dcodeIO/long.js) from 5.2.0 to 5.2.3. + * @types/node from 14.18.13 to 16.18.58. + * [cheerio](https://github.com/cheeriojs/cheerio) from 1.0.0-rc.10 to 1.0.0-rc.12. * Added eslint which spotted some unused variables and other lints. * CLI: Resolved incorrect error message when querying with a non-existent protocol name. * Added Deno support: the library and CLI can now be experimentally used with the [Deno runtime](https://deno.com) From 9d79a8eef1b3abcfbb8194f55a7b518e68ea7143 Mon Sep 17 00:00:00 2001 From: CosminPerRam Date: Sun, 21 Jan 2024 01:05:18 +0200 Subject: [PATCH 12/43] chore: update changelog to move some other changes to breaking --- CHANGELOG.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 84912da..927a9f6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,9 @@ * Made the library a `module`. * Removed `GameResolver`, moved the `GameDig` class in a separate file. * Modified exports, now the library exports `games` and `protocols` alongside the `GameDig` class. + * A game always has these fields: `name`, `release_year` and `options` (which always contains `port`/`port_query`/`port_query_offset` and `protocol`). +* Removed the `games.txt` file, the games definitions are now stored in-code (exported on `games`). +* `maxAttempts` has been renamed to `maxRetries`. #### Games * Almost all games ids have been changed to follow a standard, see [CONTRIBUTING.md#naming](https://github.com/gamedig/node-gamedig/blob/5ae12dd494c927abcbe43352609d9aa34a54753c/CONTRIBUTING.md?plain=1#L27C3-L27C3). @@ -14,7 +17,6 @@ ### Other changes #### Package -* Removed the `games.txt` file, the games definitions are now stored in-code. * Replaced usage of deprecated `substr` with `substring`. * Replaced deprecated internal `punycode` with the [punycode](https://www.npmjs.com/package/punycode) package. * Updated dependencies: @@ -38,7 +40,6 @@ * `requestPlayersRequired` (defaults to `false`) Valve games only. Querying players is always required to have a response or the query will timeout. Some [games](GAMES_LIST.md) may not provide a players response. * `noBreadthOrder` (defaults to `false`). If multiple attempts are to be made, disable doing one of each type until reaching the retry count. * Now documented: `address` (defaults to `undefined`) Override the IP address of the server skipping DNS resolution. When set, host will not be resolved, instead address will be connected to. However, some protocols still use host for other reasons e.g. as part of the query. -* `maxAttempts` has been renamed to `maxRetries`. #### Games * Removed the players::setNum method, the library will no longer add empty players as From 82772e0c022db0e79eb5a9f2a4af9018c47cc41c Mon Sep 17 00:00:00 2001 From: CosminPerRam Date: Sun, 21 Jan 2024 01:05:58 +0200 Subject: [PATCH 13/43] chore: correctly categorise removal of the games.txt file --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 927a9f6..086ef9d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,13 +7,13 @@ * Removed `GameResolver`, moved the `GameDig` class in a separate file. * Modified exports, now the library exports `games` and `protocols` alongside the `GameDig` class. * A game always has these fields: `name`, `release_year` and `options` (which always contains `port`/`port_query`/`port_query_offset` and `protocol`). -* Removed the `games.txt` file, the games definitions are now stored in-code (exported on `games`). * `maxAttempts` has been renamed to `maxRetries`. #### Games * Almost all games ids have been changed to follow a standard, see [CONTRIBUTING.md#naming](https://github.com/gamedig/node-gamedig/blob/5ae12dd494c927abcbe43352609d9aa34a54753c/CONTRIBUTING.md?plain=1#L27C3-L27C3). * Removed `minecraftping` (as it was deprecated and the same thing as `minecraft`) and `minecraftpe` (deprecated, which is now the same as `mbe` (Minecraft Bedrock Edition)). +* Removed the `games.txt` file, the games definitions are now stored in-code (exported on `games`). ### Other changes #### Package From 7466dd306ae2d2869554b354cdf203a755032692 Mon Sep 17 00:00:00 2001 From: Pedro Ivo Hudson Date: Sun, 21 Jan 2024 15:27:05 -0300 Subject: [PATCH 14/43] chore: add tool attempt success log message (#498) --- tools/attempt_protocols.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/attempt_protocols.js b/tools/attempt_protocols.js index 822273a..29cbfa3 100644 --- a/tools/attempt_protocols.js +++ b/tools/attempt_protocols.js @@ -31,7 +31,7 @@ const run = async () => { ...options, type: `protocol-${protocol}` }) - console.log(response) + console.log(`Success on '${protocol}':`, response) process.exit() } catch (e) { console.log(`Error on '${protocol}': ${e}`) From 7f373212bbbd1a5b7292f36013205f6697749501 Mon Sep 17 00:00:00 2001 From: Guilherme Werner Date: Sun, 21 Jan 2024 18:15:09 -0300 Subject: [PATCH 15/43] feat: add support for The Isle Evrima (#501) * Add support for The Isle Evrima * Move specific attributes to game protocol * Update changelog and fix gid * Keep attributes in eos protocol --- CHANGELOG.md | 1 + GAMES_LIST.md | 1 + lib/games.js | 8 ++++++++ protocols/index.js | 3 ++- protocols/theisleevrima.js | 18 ++++++++++++++++++ 5 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 protocols/theisleevrima.js diff --git a/CHANGELOG.md b/CHANGELOG.md index 086ef9d..045e729 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -54,6 +54,7 @@ placeholders in the `players` fields. * Call of Duty: Black Ops 3 (2015) - Added support. * Unreal 2: The Awakening - XMP - Added support. * Palworld - Added support (By @jonathanprl, #495). +* The Isle Evrima - Added support (By @GuilhermeWerner, #501). ### 4.3.1 * Fixed support for the Minecraft [Better Compatibility Checker](https://www.curseforge.com/minecraft/mc-mods/better-compatibility-checker) Mod (By @Douile, #436). diff --git a/GAMES_LIST.md b/GAMES_LIST.md index 8163905..0ce4978 100644 --- a/GAMES_LIST.md +++ b/GAMES_LIST.md @@ -287,6 +287,7 @@ | thefront | The Front | [Valve Protocol](#valve) | | thehidden | The Hidden | [Valve Protocol](#valve) | | theisle | The Isle | [Valve Protocol](#valve) | +| tie | The Isle Evrima | | | theship | The Ship | [Valve Protocol](#valve) | | thespecialists | The Specialists | [Valve Protocol](#valve) | | thps3 | Tony Hawk's Pro Skater 3 | | diff --git a/lib/games.js b/lib/games.js index ad0354e..de80704 100644 --- a/lib/games.js +++ b/lib/games.js @@ -1328,6 +1328,14 @@ export const games = { }, release_year: 2015 }, + tie: { + name: 'The Isle Evrima', + options: { + port: 7777, + protocol: 'theisleevrima' + }, + release_year: 2020 + }, jb007n: { name: 'James Bond 007: Nightfire', options: { diff --git a/protocols/index.js b/protocols/index.js index 89571cf..2cf657d 100644 --- a/protocols/index.js +++ b/protocols/index.js @@ -52,11 +52,12 @@ import warsow from './warsow.js' import beammpmaster from './beammpmaster.js' import beammp from './beammp.js' import dayz from './dayz.js' +import theisleevrima from './theisleevrima.js' export { armagetron, ase, asa, assettocorsa, battlefield, buildandshoot, cs2d, discord, doom3, eco, epic, ffow, fivem, gamespy1, gamespy2, gamespy3, geneshift, goldsrc, hexen2, jc2mp, kspdmp, mafia2mp, mafia2online, minecraft, minecraftbedrock, minecraftvanilla, mumble, mumbleping, nadeo, openttd, palworld, quake1, quake2, quake3, rfactor, samp, savage2, starmade, starsiege, teamspeak2, teamspeak3, terraria, tribes1, tribes1master, unreal2, ut3, valve, - vcmp, ventrilo, warsow, eldewrito, beammpmaster, beammp, dayz + vcmp, ventrilo, warsow, eldewrito, beammpmaster, beammp, dayz, theisleevrima } diff --git a/protocols/theisleevrima.js b/protocols/theisleevrima.js new file mode 100644 index 0000000..59c0b8a --- /dev/null +++ b/protocols/theisleevrima.js @@ -0,0 +1,18 @@ +import Epic from './epic.js' + +export default class theisleevrima extends Epic { + constructor () { + super() + + // OAuth2 credentials extracted from The Isle Evrima files. + this.clientId = 'xyza7891gk5PRo3J7G9puCJGFJjmEguW' + this.clientSecret = 'pKWl6t5i9NJK8gTpVlAxzENZ65P8hYzodV8Dqe5Rlc8' + this.deploymentId = '6db6bea492f94b1bbdfcdfe3e4f898dc' + } + + async run (state) { + await super.run(state) + state.name = state.raw.attributes.SERVERNAME_s + state.map = state.raw.attributes.MAP_NAME_s + } +} From 67e0cd8809e9b54a2fa104dfc0bb4ccca3a0dd14 Mon Sep 17 00:00:00 2001 From: Sebastian Schmidt <2270806+jammsen@users.noreply.github.com> Date: Sun, 21 Jan 2024 22:16:56 +0100 Subject: [PATCH 16/43] Fix: Palworld results - Name of the server is empty (#497) * Fix: Palworld results - Name of the server is empty * #497 - refactor of feedback * #497 - refactor of feedback from Cosmin --- protocols/palworld.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/protocols/palworld.js b/protocols/palworld.js index 6894bb2..973db49 100644 --- a/protocols/palworld.js +++ b/protocols/palworld.js @@ -10,4 +10,9 @@ export default class palworld extends Epic { this.deploymentId = '0a18471f93d448e2a1f60e47e03d3413' this.authByExternalToken = true } + + async run (state) { + await super.run(state) + state.name = state.raw.attributes.NAME_s + } } From 1f10ad0608903a6c2455f91e9e520da1ab4bcdc6 Mon Sep 17 00:00:00 2001 From: Pedro Ivo Hudson Date: Mon, 22 Jan 2024 17:16:58 -0300 Subject: [PATCH 17/43] feat: add checking for older GIDs (#496) * feat: add new games.extra.old_id * add extra.old_id; standard release_year * add option dontCheckOldIDs * update naming, README, CHANGELOG * Update CONTRIBUTING.md * fix games.js * add tool for checking duplicates * update GAMES_LIST * fix anchor links * fix notes in generated game list * Update GAMES_LIST.md * Update GAMES_LIST.md * add Game Object Example in CONTRIBUTING * Update find_id_duplicates.js * check skipOldIDs only once * remove old ids; tweaks GAMES_LIST * add MIGRATION document WIP * Update GAMES_LIST.md * update Halo Online name * revert changes tool/generate * remove extra line * Update GAMES_LIST.md * roll back GAME_LIST * Update GAMES_LIST.md * OMG * WAT * ok... hopefully the last change * Update GAMES_LIST.md * add MIGRATION ids * roll back CONTRIBUTING * Update CHANGELOG.md * update skipOldIDs to checkOldIDs * Update MIGRATION.md * add migration note on README --- CHANGELOG.md | 4 +- MIGRATION.md | 152 +++++ README.md | 3 + bin/gamedig.js | 2 +- lib/QueryRunner.js | 2 +- lib/game-resolver.js | 14 +- lib/games.js | 1085 ++++++++++++++++++++++++----------- tools/find_id_duplicates.js | 30 + 8 files changed, 943 insertions(+), 349 deletions(-) create mode 100644 MIGRATION.md create mode 100644 tools/find_id_duplicates.js diff --git a/CHANGELOG.md b/CHANGELOG.md index 045e729..679c6f6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ * Modified exports, now the library exports `games` and `protocols` alongside the `GameDig` class. * A game always has these fields: `name`, `release_year` and `options` (which always contains `port`/`port_query`/`port_query_offset` and `protocol`). * `maxAttempts` has been renamed to `maxRetries`. +* Updated `games` with new naming system, with new option field `options.extra.old_id` with the older ID #### Games * Almost all games ids have been changed to follow a standard, see [CONTRIBUTING.md#naming](https://github.com/gamedig/node-gamedig/blob/5ae12dd494c927abcbe43352609d9aa34a54753c/CONTRIBUTING.md?plain=1#L27C3-L27C3). @@ -38,7 +39,8 @@ * `stripColors` (defaults to `true`) for protocols that strips colors: unreal2, savage2, quake3, nadeo, gamespy2, doom3, armagetron. * `requestRulesRequired` (defaults to `false`) Valve games only. `requestRules` is always required to have a response or the query will timeout. * `requestPlayersRequired` (defaults to `false`) Valve games only. Querying players is always required to have a response or the query will timeout. Some [games](GAMES_LIST.md) may not provide a players response. - * `noBreadthOrder` (defaults to `false`). If multiple attempts are to be made, disable doing one of each type until reaching the retry count. + * `noBreadthOrder` (defaults to `false`). If multiple attempts are to be made, disable doing one of each type until reaching the retry count. + * `checkOldIDs` (defaults to `false`). Query will check for older game type IDs. See [migration](MIGRATION.md) document. * Now documented: `address` (defaults to `undefined`) Override the IP address of the server skipping DNS resolution. When set, host will not be resolved, instead address will be connected to. However, some protocols still use host for other reasons e.g. as part of the query. #### Games diff --git a/MIGRATION.md b/MIGRATION.md new file mode 100644 index 0000000..d49bd01 --- /dev/null +++ b/MIGRATION.md @@ -0,0 +1,152 @@ +# Migrating from v4 to v5 + +## Game Type IDs + +The naming system used to determine the Game Type IDs have been updated in GameDig v5 and some IDs have been changed. This means you should also update your queries. + +Make sure you check if your game's ID is in the table below. If not, then nothing to worry about. If it is, make sure to update. You can still use the older ID for now, but we strongly recommend that you update your queries, as older IDs will eventually not be supported anymore. + +## Optional Field + +| Field | Type | Default | Description | +|:---------------------------|:--------|:----------|:------------------------------------------| +| **checkOldIDs** | boolean | false | Query will check for older game type IDs. | + +### Old IDs Table + +| v4 | | v5 +|:---|:---|:--- +| americasarmypg | → | aapg +| 7d2d | → | sdtd +| americasarmypg | → | aapg +| as | → | actionsource +| ageofchivalry | → | aoc +| arkse | → | ase +| arcasimracing | → | asr08 +| arma | → | aaa +| arma2oa | → | a2oa +| armacwa | → | acwa +| armar | → | armaresistance +| armare | → | armareforger +| armagetron | → | armagetronadvanced +| bat1944 | → | battalion1944 +| bf1942 | → | battlefield1942 +| bfv | → | battlefieldvietnam +| bf2 | → | battlefield2 +| bf2142 | → | battlefield2142 +| bfbc2 | → | bbc2 +| bf3 | → | battlefield3 +| bf4 | → | battlefield4 +| bfh | → | battlefieldhardline +| bd | → | basedefense +| bs | → | bladesymphony +| buildandshoot | → | bas +| cod4 | → | cod4mw +| callofjuarez | → | coj +| chivalry | → | cmw +| commandos3 | → | c3db +| cacrenegade | → | cacr +| contactjack | → | contractjack +| cs15 | → | counterstrike15 +| cs16 | → | counterstrike16 +| cs2 | → | counterstrike2 +| crossracing | → | crce +| darkesthour | → | dhe4445 +| daysofwar | → | dow +| deadlydozenpt | → | ddpt +| dh2005 | → | deerhunter2005 +| dinodday | → | ddd +| dirttrackracing2 | → | dtr2 +| dmc | → | deathmatchclassic +| dnl | → | dal +| drakan | → | dootf +| dys | → | dystopia +| em | → | empiresmod +| empyrion | → | egs +| f12002 | → | formulaone2002 +| flashpointresistance | → | ofr +| fivem | → | gta5f +| forrest | → | theforrest +| graw | → | tcgraw +| graw2 | → | tcgraw2 +| giantscitizenkabuto | → | gck +| ges | → | goldeneyesource +| gore | → | gus +| hldm | → | hld +| hldms | → | hlds +| hlopfor | → | hlof +| hl2dm | → | hl2d +| hidden | → | thehidden +| had2 | → | hiddendangerous2 +| igi2 | → | i2cs +| il2 | → | il2sturmovik +| insurgencymic | → | imic +| isle | → | theisle +| jamesbondnightfire | → | jb007n +| jc2mp | → | jc2m +| jc3mp | → | jc3m +| kingpin | → | kloc +| kisspc | → | kpctnc +| kspdmp | → | kspd +| kzmod | → | kreedzclimbing +| left4dead | → | l4d +| left4dead2 | → | l4d2 +| m2mp | → | m2m +| mohsh | → | mohaas +| mohbt | → | mohaab +| mohab | → | moha +| moh2010 | → | moh +| mohwf | → | mohw +| minecraftbe | → | mbe +| mtavc | → | gtavcmta +| mtasa | → | gtasamta +| ns | → | naturalselection +| ns2 | → | naturalselection2 +| nwn | → | neverwinternights +| nwn2 | → | neverwinternights2 +| nolf | → | tonolf +| nolf2 | → | nolf2asihw +| pvkii | → | pvak2 +| ps | → | postscriptum +| primalcarnage | → | pce +| pc | → | projectcars +| pc2 | → | projectcars2 +| prbf2 | → | prb2 +| przomboid | → | projectzomboid +| quake1 | → | quake +| quake3 | → | q3a +| ragdollkungfu | → | rdkf +| r6 | → | rainbowsix +| r6roguespear | → | rs2rs +| r6ravenshield | → | rs3rs +| redorchestraost | → | roo4145 +| redm | → | rdr2r +| riseofnations | → | ron +| rs2 | → | rs2v +| samp | → | gtasam +| saomp | → | gtasao +| savage2 | → | s2ats +| ss | → | serioussam +| ss2 | → | serioussam2 +| ship | → | theship +| sinep | → | sinepisodes +| sonsoftheforest | → | sotf +| swbf | → | swb +| swbf2 | → | swb2 +| swjk | → | swjkja +| swjk2 | → | swjk2jo +| takeonhelicopters | → | toh +| tf2 | → | teamfortress2 +| terraria | → | terrariatshosck +| tribes1 | → | t1s +| ut | → | unrealtournament +| ut2003 | → | unrealtournament2003 +| ut2004 | → | unrealtournament2004 +| ut3 | → | unrealtournament3 +| v8supercar | → | v8sc +| vcmp | → | vcm +| vs | → | vampireslayer +| wheeloftime | → | wot +| wolfenstein2009 | → | wolfenstein +| wolfensteinet | → | wet +| wurm | → | wurmunlimited \ No newline at end of file diff --git a/README.md b/README.md index 309defb..2f60dc7 100644 --- a/README.md +++ b/README.md @@ -8,6 +8,9 @@ If a server makes its status publically available, GameDig can fetch it for you. Support is available on the [Discord](https://discord.gg/NVCMn3tnxH) for questions, or [GitHub](https://github.com/gamedig/node-gamedig/issues) for bugs. +## Migration from v4 to v5 +Game Type IDs have been updated in GameDig v5. Make sure to check if your game's ID is in the [migration document](MIGRATION.md). + ## Games List **node-GameDig** can query over 310 games + a few services! See the [GAMES_LIST.md](GAMES_LIST.md) file for the currently supported titles, not yet supported titles and notes about some of them. diff --git a/bin/gamedig.js b/bin/gamedig.js index e4d294a..8609d95 100644 --- a/bin/gamedig.js +++ b/bin/gamedig.js @@ -6,7 +6,7 @@ import Minimist from 'minimist' import { GameDig } from './../lib/index.js' const argv = Minimist(process.argv.slice(2), { - boolean: ['pretty', 'debug', 'givenPortOnly', 'requestRules', 'requestRulesRequired', 'requestPlayersRequired', 'stripColors', 'portCache', 'noBreadthOrder'], + boolean: ['pretty', 'debug', 'givenPortOnly', 'requestRules', 'requestRulesRequired', 'requestPlayersRequired', 'stripColors', 'portCache', 'noBreadthOrder', 'checkOldIDs'], string: ['guildId', 'listenUdpPort', 'ipFamily'], default: { stripColors: true, diff --git a/lib/QueryRunner.js b/lib/QueryRunner.js index 11288b6..b193704 100644 --- a/lib/QueryRunner.js +++ b/lib/QueryRunner.js @@ -32,7 +32,7 @@ export default class QueryRunner { port_query: gameQueryPort, port_query_offset: gameQueryPortOffset, ...gameOptions - } = lookup(userOptions.type) + } = lookup(userOptions) const attempts = [] const optionsCollection = { diff --git a/lib/game-resolver.js b/lib/game-resolver.js index 0e6d13f..d875c99 100644 --- a/lib/game-resolver.js +++ b/lib/game-resolver.js @@ -1,6 +1,8 @@ import { games } from './games.js' -export const lookup = (type) => { +export const lookup = (options) => { + const type = options.type + if (!type) { throw Error('No game specified') } if (type.startsWith('protocol-')) { @@ -9,7 +11,15 @@ export const lookup = (type) => { } } - const game = games[type] + let game = games[type] + + if (options.checkOldIDs) { + Object.keys(games).forEach((id) => { + if (games[id]?.extra.old_id) { + game = games[id] + } + }) + } if (!game) { throw Error('Invalid game: ' + type) } diff --git a/lib/games.js b/lib/games.js index de80704..2cb1621 100644 --- a/lib/games.js +++ b/lib/games.js @@ -5,6 +5,9 @@ export const games = { options: { port: 27015, protocol: 'valve' + }, + extra: { + old_id: 'as' } }, ahl: { @@ -21,6 +24,9 @@ export const games = { options: { port: 27015, protocol: 'valve' + }, + extra: { + old_id: 'ageofchivalry' } }, aoe2: { @@ -54,6 +60,9 @@ export const games = { port: 7777, port_query: 27015, protocol: 'valve' + }, + extra: { + old_id: 'arkse' } }, asa: { @@ -140,6 +149,9 @@ export const games = { port: 8777, port_query: 27020, protocol: 'valve' + }, + extra: { + old_id: 'americasarmypg' } }, asr08: { @@ -149,6 +161,9 @@ export const games = { port: 34397, port_query_offset: -100, protocol: 'rfactor' + }, + extra: { + old_id: 'arcasimracing' } }, aaa: { @@ -157,6 +172,9 @@ export const games = { options: { port: 2302, protocol: 'gamespy2' + }, + extra: { + old_id: 'arma' } }, arma2: { @@ -175,6 +193,9 @@ export const games = { port: 2302, port_query_offset: 1, protocol: 'valve' + }, + extra: { + old_id: 'arma2oa' } }, acwa: { @@ -184,6 +205,9 @@ export const games = { port: 2302, port_query_offset: 1, protocol: 'gamespy1' + }, + extra: { + old_id: 'armacwa' } }, armaresistance: { @@ -193,6 +217,9 @@ export const games = { port: 2302, port_query_offset: 1, protocol: 'gamespy1' + }, + extra: { + old_id: 'armar' } }, arma3: { @@ -211,6 +238,9 @@ export const games = { port: 2001, port_query: 17777, protocol: 'valve' + }, + extra: { + old_id: 'armare' } }, armagetronadvanced: { @@ -219,6 +249,9 @@ export const games = { options: { port: 4534, protocol: 'armagetron' + }, + extra: { + old_id: 'armagetron' } }, baldursgate: { @@ -255,6 +288,9 @@ export const games = { port: 7777, port_query_offset: 3, protocol: 'valve' + }, + extra: { + old_id: 'bat1944' } }, beammp: { @@ -271,6 +307,9 @@ export const games = { port: 14567, port_query: 23000, protocol: 'gamespy1' + }, + extra: { + old_id: 'bf1942' } }, battlefieldvietnam: { @@ -280,6 +319,9 @@ export const games = { port: 15567, port_query: 23000, protocol: 'gamespy2' + }, + extra: { + old_id: 'bfv' } }, battlefield2: { @@ -289,6 +331,9 @@ export const games = { port: 16567, port_query: 29900, protocol: 'gamespy3' + }, + extra: { + old_id: 'bf2' } }, battlefield2142: { @@ -298,6 +343,9 @@ export const games = { port: 16567, port_query: 29900, protocol: 'gamespy3' + }, + extra: { + old_id: 'bf2142' } }, bbc2: { @@ -307,6 +355,9 @@ export const games = { port: 19567, port_query: 48888, protocol: 'battlefield' + }, + extra: { + old_id: 'bfbc2' } }, battlefield3: { @@ -316,6 +367,9 @@ export const games = { port: 25200, port_query_offset: 22000, protocol: 'battlefield' + }, + extra: { + old_id: 'bf3' } }, battlefield4: { @@ -325,6 +379,9 @@ export const games = { port: 25200, port_query_offset: 22000, protocol: 'battlefield' + }, + extra: { + old_id: 'bf4' } }, battlefieldhardline: { @@ -334,6 +391,9 @@ export const games = { port: 25200, port_query_offset: 22000, protocol: 'battlefield' + }, + extra: { + old_id: 'bfh' } }, blackmesa: { @@ -390,6 +450,9 @@ export const games = { options: { port: 27015, protocol: 'valve' + }, + extra: { + old_id: 'bd' } }, bladesymphony: { @@ -398,25 +461,31 @@ export const games = { options: { port: 27015, protocol: 'valve' + }, + extra: { + old_id: 'bs' } }, bas: { name: 'Build and Shoot', + release_year: 2012, options: { port: 32887, port_query_offset: -1, protocol: 'buildandshoot' }, - release_year: 2012 + extra: { + old_id: 'buildandshoot' + } }, aosc: { name: 'Ace of Spades Classic', + release_year: 2012, options: { port: 32887, port_query_offset: -1, protocol: 'buildandshoot' - }, - release_year: 2012 + } }, cod: { name: 'Call of Duty', @@ -452,11 +521,14 @@ export const games = { }, cod4mw: { name: 'Call of Duty 4: Modern Warfare', + release_year: 2007, options: { port: 28960, protocol: 'quake3' }, - release_year: 2007 + extra: { + old_id: 'cod4' + } }, codbo3: { name: 'Call of Duty: Black Ops 3', @@ -496,6 +568,9 @@ export const games = { options: { port_query: 26000, protocol: 'ase' + }, + extra: { + old_id: 'callofjuarez' } }, chaser: { @@ -514,6 +589,9 @@ export const games = { port: 7777, port_query_offset: 2, protocol: 'valve' + }, + extra: { + old_id: 'chivalry' } }, chrome: { @@ -555,6 +633,9 @@ export const games = { options: { port_query: 6500, protocol: 'gamespy1' + }, + extra: { + old_id: 'commandos3' } }, cacr: { @@ -564,6 +645,9 @@ export const games = { port: 4848, port_query: 25300, protocol: 'gamespy1' + }, + extra: { + old_id: 'cacrenegade' } }, conanexiles: { @@ -592,6 +676,9 @@ export const games = { options: { port_query: 27888, protocol: 'gamespy1' + }, + extra: { + old_id: 'contactjack' } }, corekeeper: { @@ -609,6 +696,9 @@ export const games = { options: { port: 27015, protocol: 'goldsrc' + }, + extra: { + old_id: 'cs15' } }, counterstrike16: { @@ -617,6 +707,9 @@ export const games = { options: { port: 27015, protocol: 'valve' + }, + extra: { + old_id: 'cs16' } }, cs2d: { @@ -660,6 +753,9 @@ export const games = { options: { port: 27015, protocol: 'valve' + }, + extra: { + old_id: 'cs2' } }, creativerse: { @@ -678,6 +774,9 @@ export const games = { port: 12321, port_query_offset: 123, protocol: 'ase' + }, + extra: { + old_id: 'crossracing' } }, crysis: { @@ -736,6 +835,9 @@ export const games = { port: 7757, port_query_offset: 1, protocol: 'unreal2' + }, + extra: { + old_id: 'darkesthour' } }, dayofdragons: { @@ -753,6 +855,9 @@ export const games = { options: { port: 27015, protocol: 'valve' + }, + extra: { + old_id: 'daysofwar' } }, dayz: { @@ -782,6 +887,9 @@ export const games = { options: { port_query: 25300, protocol: 'gamespy1' + }, + extra: { + old_id: 'deadlydozenpt' } }, deerhunter2005: { @@ -791,6 +899,9 @@ export const games = { port: 23459, port_query: 34567, protocol: 'gamespy2' + }, + extra: { + old_id: 'dh2005' } }, descent3: { @@ -826,6 +937,9 @@ export const games = { options: { port: 27015, protocol: 'valve' + }, + extra: { + old_id: 'dinodday' } }, dtr2: { @@ -835,6 +949,9 @@ export const games = { port: 32240, port_query_offset: -100, protocol: 'gamespy1' + }, + extra: { + old_id: 'dirttrackracing2' } }, discord: { @@ -853,6 +970,9 @@ export const games = { options: { port: 27015, protocol: 'valve' + }, + extra: { + old_id: 'dmc' } }, dal: { @@ -862,6 +982,9 @@ export const games = { port: 7777, port_query: 27015, protocol: 'valve' + }, + extra: { + old_id: 'dnl' } }, dod: { @@ -911,6 +1034,9 @@ export const games = { port: 27045, port_query_offset: 1, protocol: 'gamespy1' + }, + extra: { + old_id: 'drakan' } }, dst: { @@ -928,6 +1054,9 @@ export const games = { options: { port: 27015, protocol: 'valve' + }, + extra: { + old_id: 'dys' } }, eco: { @@ -940,7 +1069,7 @@ export const games = { } }, eldewrito: { - name: 'Halo Online (ElDewrito)', + name: 'Halo Online - ElDewrito', options: { port: 11775, protocol: 'eldewrito' @@ -952,381 +1081,444 @@ export const games = { options: { port: 27015, protocol: 'valve' + }, + extra: { + old_id: 'em' } }, egs: { name: 'Empyrion - Galactic Survival', + release_year: 2015, options: { port: 30000, port_query_offset: 1, protocol: 'valve' }, - release_year: 2015 + extra: { + old_id: 'empyrion' + } }, etqw: { name: 'Enemy Territory: Quake Wars', + release_year: 2007, options: { port: 3074, port_query: 27733, protocol: 'doom3' - }, - release_year: 2007 + } }, fear: { name: 'F.E.A.R.', + release_year: 2005, options: { port_query: 27888, protocol: 'gamespy2' - }, - release_year: 2005 + } }, formulaone2002: { name: 'Formula One 2002', + release_year: 2002, options: { port_query: 3297, protocol: 'gamespy1' }, - release_year: 2002 + extra: { + old_id: 'f12002' + } }, f1c9902: { name: "F1 Challenge '99-'02", + release_year: 2002, options: { port_query: 34397, protocol: 'gamespy1' - }, - release_year: 2002 + } }, farcry: { name: 'Far Cry', + release_year: 2004, options: { port: 49001, port_query_offset: 123, protocol: 'ase' - }, - release_year: 2004 + } }, farcry2: { name: 'Far Cry 2', + release_year: 2008, options: { port_query: 14001, protocol: 'ase' - }, - release_year: 2008 + } }, fof: { name: 'Fistful of Frags', + release_year: 2014, options: { port: 27015, protocol: 'valve' - }, - release_year: 2014 + } }, fortressforever: { name: 'Fortress Forever', + release_year: 2007, options: { port: 27015, protocol: 'valve' - }, - release_year: 2007 + } }, ofcwc: { name: 'Operation Flashpoint: Cold War Crisis', + release_year: 2001, options: { port: 2302, port_query_offset: 1, protocol: 'gamespy1' - }, - release_year: 2001 + } }, ofr: { name: 'Operation Flashpoint: Resistance', + release_year: 2002, options: { port: 2302, port_query_offset: 1, protocol: 'gamespy1' }, - release_year: 2002 + extra: { + old_id: 'flashpointresistance' + } }, ffow: { name: 'Frontlines: Fuel of War', + release_year: 2008, options: { port: 5476, port_query_offset: 2, protocol: 'ffow' - }, - release_year: 2008 + } }, gta5f: { name: 'Grand Theft Auto V - FiveM', + release_year: 2013, options: { port: 30120, protocol: 'fivem' }, - release_year: 2013 + extra: { + old_id: 'fivem' + } }, theforrest: { name: 'The Forrest', + release_year: 2014, options: { port: 27015, port_query_offset: 1, protocol: 'valve' }, - release_year: 2014 + extra: { + old_id: 'forrest' + } }, garrysmod: { name: "Garry's Mod", + release_year: 2004, options: { port: 27015, protocol: 'valve' - }, - release_year: 2004 + } }, tcgraw: { name: "Tom Clancy's Ghost Recon Advanced Warfighter", + release_year: 2006, options: { port_query: 15250, protocol: 'gamespy2' }, - release_year: 2006 + extra: { + old_id: 'graw' + } }, tcgraw2: { name: "Tom Clancy's Ghost Recon Advanced Warfighter 2", + release_year: 2007, options: { port_query: 16250, protocol: 'gamespy2' }, - release_year: 2007 + extra: { + old_id: 'graw2' + } }, gck: { name: 'Giants: Citizen Kabuto', + release_year: 2000, options: { port_query: 8911, protocol: 'gamespy1' }, - release_year: 2000 + extra: { + old_id: 'giantscitizenkabuto' + } }, globaloperations: { name: 'Global Operations', + release_year: 2002, options: { port_query: 28672, protocol: 'gamespy1' - }, - release_year: 2002 + } }, geneshift: { name: 'Geneshift', + release_year: 2017, options: { port: 11235, protocol: 'geneshift' - }, - release_year: 2017 + } }, goldeneyesource: { name: 'GoldenEye: Source', + release_year: 2010, options: { port: 27015, protocol: 'valve' }, - release_year: 2010 + extra: { + old_id: 'ges' + } }, gus: { name: 'Gore: Ultimate Soldier', + release_year: 2002, options: { port: 27777, port_query_offset: 1, protocol: 'gamespy1' }, - release_year: 2002 + extra: { + old_id: 'gore' + } }, groundbreach: { name: 'Ground Breach', + release_year: 2018, options: { port: 27015, protocol: 'valve' - }, - release_year: 2018 + } }, gunmanchronicles: { name: 'Gunman Chronicles', + release_year: 2000, options: { port: 27015, protocol: 'valve' - }, - release_year: 2000 + } }, hld: { name: 'Half-Life Deathmatch', + release_year: 1998, options: { port: 27015, protocol: 'valve' }, - release_year: 1998 + extra: { + old_id: 'hldm' + } }, hlds: { name: 'Half-Life Deathmatch: Source', + release_year: 2005, options: { port: 27015, protocol: 'valve' }, - release_year: 2005 + extra: { + old_id: 'hldms' + } }, hlof: { name: 'Half-Life: Opposing Force', + release_year: 1999, options: { port: 27015, protocol: 'valve' }, - release_year: 1999 + extra: { + old_id: 'hlopfor' + } }, hl2d: { name: 'Half-Life 2: Deathmatch', + release_year: 2004, options: { port: 27015, protocol: 'valve' }, - release_year: 2004 + extra: { + old_id: 'hl2dm' + } }, halo: { name: 'Halo', + release_year: 2003, options: { port: 2302, protocol: 'gamespy2' - }, - release_year: 2003 + } }, halo2: { name: 'Halo 2', + release_year: 2007, options: { port: 2302, protocol: 'gamespy2' - }, - release_year: 2007 + } }, heretic2: { name: 'Heretic II', + release_year: 1998, options: { port: 27900, port_query_offset: 1, protocol: 'gamespy1' - }, - release_year: 1998 + } }, hexen2: { name: 'Hexen II', + release_year: 1997, options: { port: 26900, port_query_offset: 50, protocol: 'hexen2' - }, - release_year: 1997 + } }, thehidden: { name: 'The Hidden', + release_year: 2005, options: { port: 27015, protocol: 'valve' }, - release_year: 2005 + extra: { + old_id: 'hidden' + } }, hll: { name: 'Hell Let Loose', + release_year: 2019, options: { port: 27015, protocol: 'valve' - }, - release_year: 2019 + } }, hiddendangerous2: { name: 'Hidden & Dangerous 2', + release_year: 2003, options: { port: 11001, port_query_offset: 3, protocol: 'gamespy1' }, - release_year: 2003 + extra: { + old_id: 'had2' + } }, homefront: { name: 'Homefront', + release_year: 2011, options: { port: 27015, protocol: 'valve' - }, - release_year: 2011 + } }, homeworld2: { name: 'Homeworld 2', + release_year: 2003, options: { port_query: 6500, protocol: 'gamespy1' - }, - release_year: 2003 + } }, hurtworld: { name: 'Hurtworld', + release_year: 2015, options: { port: 12871, port_query: 12881, protocol: 'valve' - }, - release_year: 2015 + } }, i2cs: { name: 'IGI 2: Covert Strike', + release_year: 2003, options: { port_query: 26001, protocol: 'gamespy1' }, - release_year: 2003 + extra: { + old_id: 'igi2' + } }, il2sturmovik: { name: 'IL-2 Sturmovik', + release_year: 2001, options: { port_query: 21000, protocol: 'gamespy1' }, - release_year: 2001 + extra: { + old_id: 'il2' + } }, insurgency: { name: 'Insurgency', + release_year: 2014, options: { port: 27015, protocol: 'valve' - }, - release_year: 2014 + } }, imic: { name: 'Insurgency: Modern Infantry Combat', + release_year: 2007, options: { port: 27015, protocol: 'valve' }, - release_year: 2007 + extra: { + old_id: 'insurgencymic' + } }, insurgencysandstorm: { name: 'Insurgency: Sandstorm', + release_year: 2018, options: { port: 27015, port_query_offset: 1, protocol: 'valve' - }, - release_year: 2018 + } }, ironstorm: { name: 'Iron Storm', + release_year: 2002, options: { port_query: 3505, protocol: 'gamespy1' - }, - release_year: 2002 + } }, theisle: { name: 'The Isle', + release_year: 2015, options: { port: 7707, port_query_offset: 1, protocol: 'valve' }, - release_year: 2015 + extra: { + old_id: 'isle' + } }, tie: { name: 'The Isle Evrima', @@ -1338,244 +1530,299 @@ export const games = { }, jb007n: { name: 'James Bond 007: Nightfire', + release_year: 2002, options: { port_query: 6550, protocol: 'gamespy1' }, - release_year: 2002 + extra: { + old_id: 'jamesbondnightfire' + } }, jc2m: { name: 'Just Cause 2 - Multiplayer', + release_year: 2010, options: { port: 7777, protocol: 'jc2mp' }, - release_year: 2010 + extra: { + old_id: 'jc2mp' + } }, jc3m: { name: 'Just Cause 3 - Multiplayer', + release_year: 2017, options: { port: 4200, port_query_offset: 1, protocol: 'valve' }, - release_year: 2017 + extra: { + old_id: 'jc3mp' + } }, killingfloor: { name: 'Killing Floor', + release_year: 2009, options: { port: 7707, port_query_offset: 1, protocol: 'unreal2' - }, - release_year: 2009 + } }, killingfloor2: { name: 'Killing Floor 2', + release_year: 2016, options: { port: 7777, port_query: 27015, protocol: 'valve' - }, - release_year: 2016 + } }, kloc: { name: 'Kingpin: Life of Crime', + release_year: 1999, options: { port: 31510, port_query_offset: -10, protocol: 'gamespy1' }, - release_year: 1999 + extra: { + old_id: 'kingpin' + } }, kpctnc: { name: 'Kiss: Psycho Circus: The Nightmare Child', + release_year: 2000, options: { port: 7777, port_query_offset: 1, protocol: 'gamespy1' }, - release_year: 2000 + extra: { + old_id: 'kisspc' + } }, kspd: { name: 'Kerbal Space Program - DMP', + release_year: 2015, options: { port: 6702, port_query_offset: 1, protocol: 'kspdmp' }, - release_year: 2015 + extra: { + old_id: 'kspdmp' + } }, kreedzclimbing: { name: 'Kreedz Climbing', + release_year: 2017, options: { port: 27015, protocol: 'valve' }, - release_year: 2017 + extra: { + old_id: 'kzmod' + } }, l4d: { name: 'Left 4 Dead', + release_year: 2008, options: { port: 27015, protocol: 'valve' }, - release_year: 2008 + extra: { + old_id: 'left4dead' + } }, l4d2: { name: 'Left 4 Dead 2', + release_year: 2009, options: { port: 27015, protocol: 'valve' }, - release_year: 2009 + extra: { + old_id: 'left4dead2' + } }, m2m: { name: 'Mafia II - Multiplayer', + release_year: 2010, options: { port: 27016, port_query_offset: 1, protocol: 'mafia2mp' }, - release_year: 2010 + extra: { + old_id: 'm2mp' + } }, m2o: { name: 'Mafia II - Online', + release_year: 2010, options: { port: 27015, port_query_offset: 1, protocol: 'mafia2online' - }, - release_year: 2010 + } }, medievalengineers: { name: 'Medieval Engineers', + release_year: 2015, options: { port: 27015, protocol: 'valve' - }, - release_year: 2015 + } }, mohaa: { name: 'Medal of Honor: Allied Assault', + release_year: 2002, options: { port: 12203, port_query_offset: 97, protocol: 'gamespy1' - }, - release_year: 2002 + } }, mohaas: { name: 'Medal of Honor: Allied Assault Spearhead', + release_year: 2002, options: { port: 12203, port_query_offset: 97, protocol: 'gamespy1' }, - release_year: 2002 + extra: { + old_id: 'mohsh' + } }, mohaab: { name: 'Medal of Honor: Allied Assault Breakthrough', + release_year: 2003, options: { port: 12203, port_query_offset: 97, protocol: 'gamespy1' }, - release_year: 2003 + extra: { + old_id: 'mohbt' + } }, mohpa: { name: 'Medal of Honor: Pacific Assault', + release_year: 2004, options: { port: 13203, port_query_offset: 97, protocol: 'gamespy1' - }, - release_year: 2004 + } }, moha: { name: 'Medal of Honor: Airborne', + release_year: 2007, options: { port: 12203, port_query_offset: 97, protocol: 'gamespy1' }, - release_year: 2007 + extra: { + old_id: 'mohab' + } }, moh: { name: 'Medal of Honor', + release_year: 2010, options: { port: 7673, port_query: 48888, protocol: 'battlefield' }, - release_year: 2010 + extra: { + old_id: 'moh2010' + } }, mohw: { name: 'Medal of Honor: Warfighter', + release_year: 2012, options: { port: 25200, port_query_offset: 22000, protocol: 'battlefield' }, - release_year: 2012 + extra: { + old_id: 'mohwf' + } }, minecraft: { name: 'Minecraft', + release_year: 2009, options: { port: 25565, protocol: 'minecraft' }, extra: { doc_notes: 'minecraft' - }, - release_year: 2009 + } }, mbe: { name: 'Minecraft: Bedrock Edition', + release_year: 2011, options: { port: 19132, protocol: 'minecraft' }, - release_year: 2011 + extra: { + old_id: 'minecraftbe' + } }, mnc: { name: 'Monday Night Combat', + release_year: 2011, options: { port: 7777, port_query: 27016, protocol: 'valve' - }, - release_year: 2011 + } }, mordhau: { name: 'Mordhau', + release_year: 2019, options: { port: 7777, port_query: 27015, protocol: 'valve' - }, - release_year: 2019 + } }, gtavcmta: { name: 'Grand Theft Auto: Vice City - Multi Theft Auto', + release_year: 2002, options: { port: 22003, port_query_offset: 123, protocol: 'ase' }, - release_year: 2002 + extra: { + old_id: 'mtavc' + } }, gtasamta: { name: 'Grand Theft Auto: San Andreas - Multi Theft Auto', + release_year: 2004, options: { port: 22003, port_query_offset: 123, protocol: 'ase' }, - release_year: 2004 + extra: { + old_id: 'mtasa' + } }, mgm: { name: 'Mumble - GT Murmur', + release_year: 2005, options: { port: 64738, port_query: 27800, @@ -1583,184 +1830,201 @@ export const games = { }, extra: { doc_notes: 'mumble' - }, - release_year: 2005 + } }, mumble: { name: 'Mumble', + release_year: 2005, options: { port: 64738, protocol: 'mumbleping' }, extra: { doc_notes: 'mumble' - }, - release_year: 2005 + } }, mutantfactions: { name: 'Mutant Factions', + release_year: 2009, options: { port: 11235, protocol: 'geneshift' - }, - release_year: 2009 + } }, nascarthunder2004: { name: 'NASCAR Thunder 2004', + release_year: 2003, options: { port_query: 13333, protocol: 'gamespy2' - }, - release_year: 2003 + } }, netpanzer: { name: 'netPanzer', + release_year: 2002, options: { port: 3030, protocol: 'gamespy1' - }, - release_year: 2002 + } }, nmrih: { name: 'No More Room in Hell', + release_year: 2011, options: { port: 27015, protocol: 'valve' - }, - release_year: 2011 + } }, naturalselection: { name: 'Natural Selection', + release_year: 2002, options: { port: 27015, protocol: 'valve' }, - release_year: 2002 + extra: { + old_id: 'ns' + } }, naturalselection2: { name: 'Natural Selection 2', + release_year: 2012, options: { port_query_offset: 1, protocol: 'valve' }, - release_year: 2012 + extra: { + old_id: 'ns2' + } }, nfshp2: { name: 'Need for Speed: Hot Pursuit 2', + release_year: 2002, options: { port_query: 61220, protocol: 'gamespy1' - }, - release_year: 2002 + } }, nab: { name: 'Nerf Arena Blast', + release_year: 1999, options: { port: 4444, port_query_offset: 1, protocol: 'gamespy1' - }, - release_year: 1999 + } }, neverwinternights: { name: 'Neverwinter Nights', + release_year: 2002, options: { port_query: 5121, protocol: 'gamespy2' }, - release_year: 2002 + extra: { + old_id: 'nwn' + } }, neverwinternights2: { name: 'Neverwinter Nights 2', + release_year: 2006, options: { port: 5121, port_query: 6500, protocol: 'gamespy2' }, - release_year: 2006 + extra: { + old_id: 'nwn2' + } }, nexuiz: { name: 'Nexuiz', + release_year: 2005, options: { port_query: 26000, protocol: 'quake3' - }, - release_year: 2005 + } }, nitrofamily: { name: 'Nitro Family', + release_year: 2004, options: { port_query: 25601, protocol: 'gamespy1' - }, - release_year: 2004 + } }, tonolf: { name: 'The Operative: No One Lives Forever', + release_year: 2000, options: { port_query: 27888, protocol: 'gamespy1' }, - release_year: 2000 + extra: { + old_id: 'nolf' + } }, nolf2asihw: { name: "No One Lives Forever 2: A Spy in H.A.R.M.'s Way", + release_year: 2002, options: { port_query: 27890, protocol: 'gamespy1' }, - release_year: 2002 + extra: { + old_id: 'nolf2' + } }, nucleardawn: { name: 'Nuclear Dawn', + release_year: 2011, options: { port: 27015, protocol: 'valve' - }, - release_year: 2011 + } }, ohd: { name: 'Operation: Harsh Doorstop', + release_year: 2023, options: { port: 7777, port_query: 27005, protocol: 'valve' - }, - release_year: 2023 + } }, onset: { name: 'Onset', + release_year: 2019, options: { port: 7777, port_query_offset: -1, protocol: 'valve' - }, - release_year: 2019 + } }, openarena: { name: 'OpenArena', + release_year: 2005, options: { port_query: 27960, protocol: 'quake3' - }, - release_year: 2005 + } }, openttd: { name: 'OpenTTD', + release_year: 2004, options: { port: 3979, protocol: 'openttd' - }, - release_year: 2004 + } }, painkiller: { name: 'Painkiller', + release_year: 2004, options: { port: 3455, port_query_offset: 123, protocol: 'ase' - }, - release_year: 2004 + } }, palworld: { name: 'Palworld', @@ -1772,382 +2036,455 @@ export const games = { }, pvak2: { name: 'Pirates, Vikings, and Knights II', + release_year: 2007, options: { port: 27015, protocol: 'valve' }, - release_year: 2007 + extra: { + old_id: 'pvkii' + } }, pixark: { name: 'PixARK', + release_year: 2018, options: { port: 7777, port_query: 27015, protocol: 'valve' - }, - release_year: 2018 + } }, postscriptum: { name: 'Post Scriptum', + release_year: 2018, options: { port: 10037, protocol: 'valve' }, - release_year: 2018 + extra: { + old_id: 'ps' + } }, postal2: { name: 'Postal 2', + release_year: 2003, options: { port: 7777, port_query_offset: 1, protocol: 'gamespy1' - }, - release_year: 2003 + } }, prey: { name: 'Prey', + release_year: 2017, options: { port: 27719, protocol: 'doom3' - }, - release_year: 2017 + } }, pce: { name: 'Primal Carnage: Extinction', + release_year: 2015, options: { port: 7777, port_query: 27015, protocol: 'valve' }, - release_year: 2015 + extra: { + old_id: 'primalcarnage' + } }, projectcars: { name: 'Project Cars', + release_year: 2015, options: { port: 27015, query_port: 1, protocol: 'valve' }, - release_year: 2015 + extra: { + old_id: 'pc' + } }, projectcars2: { name: 'Project Cars 2', + release_year: 2017, options: { port: 27015, query_port: 1, protocol: 'valve' }, - release_year: 2017 + extra: { + old_id: 'pc2' + } }, prb2: { name: 'Project Reality: Battlefield 2', + release_year: 2005, options: { port: 16567, port_query: 29900, protocol: 'gamespy3' }, - release_year: 2005 + extra: { + old_id: 'prbf2' + } }, projectzomboid: { name: 'Project Zomboid', + release_year: 2013, options: { port: 16261, protocol: 'valve' }, - release_year: 2013 + extra: { + old_id: 'przomboid' + } }, quake: { name: 'Quake', + release_year: 1996, options: { port: 27500, protocol: 'quake1' }, - release_year: 1996 + extra: { + old_id: 'quake1' + } }, quake2: { name: 'Quake 2', + release_year: 1997, options: { port: 27910, protocol: 'quake2' - }, - release_year: 1997 + } }, q3a: { name: 'Quake 3: Arena', + release_year: 1999, options: { port: 27960, protocol: 'quake3' }, - release_year: 1999 + extra: { + old_id: 'quake3' + } }, quake4: { name: 'Quake 4', + release_year: 2005, options: { port: 28004, protocol: 'doom3' - }, - release_year: 2005 + } }, quakelive: { name: 'Quake Live', + release_year: 2010, options: { port: 27960, protocol: 'valve' - }, - release_year: 2010 + } }, rdkf: { name: 'Rag Doll Kung Fu', + release_year: 2005, options: { port: 27015, protocol: 'valve' }, - release_year: 2005 + extra: { + old_id: 'ragdollkungfu' + } }, rainbowsix: { name: 'Rainbow Six', + release_year: 1998, options: { port_query: 2348, protocol: 'gamespy1' }, - release_year: 1998 + extra: { + old_id: 'r6' + } }, rs2rs: { name: 'Rainbow Six 2: Rogue Spear', + release_year: 1999, options: { port_query: 2346, protocol: 'gamespy1' }, - release_year: 1999 + extra: { + old_id: 'r6roguespear' + } }, rs3rs: { name: 'Rainbow Six 3: Raven Shield', + release_year: 2003, options: { port: 7777, port_query_offset: 1000, protocol: 'gamespy1' }, - release_year: 2003 + extra: { + old_id: 'r6ravenshield' + } }, rallisportchallenge: { name: 'RalliSport Challenge', + release_year: 2002, options: { port_query: 17500, protocol: 'gamespy1' - }, - release_year: 2002 + } }, rallymasters: { name: 'Rally Masters', + release_year: 2000, options: { port_query: 16666, protocol: 'gamespy1' - }, - release_year: 2000 + } }, redorchestra: { name: 'Red Orchestra', + release_year: 2018, options: { port: 7758, port_query_offset: 1, protocol: 'unreal2' - }, - release_year: 2018 + } }, roo4145: { name: 'Red Orchestra: Ostfront 41-45', + release_year: 2006, options: { port: 7757, port_query_offset: 10, protocol: 'gamespy1' }, - release_year: 2006 + extra: { + old_id: 'redorchestraost' + } }, redorchestra2: { name: 'Red Orchestra 2', + release_year: 2011, options: { port: 7777, port_query: 27015, protocol: 'valve' - }, - release_year: 2011 + } }, redline: { name: 'Redline', + release_year: 2010, options: { port_query: 25252, protocol: 'gamespy1' - }, - release_year: 2010 + } }, rdr2r: { name: 'Red Dead Redemption 2 - RedM', + release_year: 2018, options: { port: 30120, protocol: 'fivem' }, - release_year: 2018 + extra: { + old_id: 'redm' + } }, rtcw: { name: 'Return to Castle Wolfenstein', + release_year: 2001, options: { port_query: 27960, protocol: 'quake3' - }, - release_year: 2001 + } }, rfactor: { name: 'rFactor', + release_year: 2018, options: { port: 34397, port_query_offset: -100, protocol: 'rfactor' - }, - release_year: 2018 + } }, ricochet: { name: 'Ricochet', + release_year: 2005, options: { port: 27015, protocol: 'valve' - }, - release_year: 2005 + } }, ron: { name: 'Rise of Nations', + release_year: 2003, options: { port_query: 6501, protocol: 'gamespy1' }, - release_year: 2003 + extra: { + old_id: 'riseofnations' + } }, risingworld: { name: 'Rising World', + release_year: 2014, options: { port: 4255, port_query_offset: -1, protocol: 'valve' - }, - release_year: 2014 + } }, ror2: { name: 'Risk of Rain 2', + release_year: 2020, options: { port: 27015, port_query_offset: 1, protocol: 'valve' - }, - release_year: 2020 + } }, rs2v: { name: 'Rising Storm 2: Vietnam', + release_year: 2017, options: { port: 27015, protocol: 'valve' }, - release_year: 2017 + extra: { + old_id: 'rs2' + } }, rune: { name: 'Rune', + release_year: 2000, options: { port: 7777, port_query_offset: 1, protocol: 'gamespy1' - }, - release_year: 2000 + } }, rust: { name: 'Rust', + release_year: 2013, options: { port: 28015, protocol: 'valve' - }, - release_year: 2013 + } }, gtasam: { name: 'Grand Theft Auto: San Andreas Multiplayer', + release_year: 2006, options: { port: 7777, protocol: 'samp' }, - release_year: 2006 + extra: { + old_id: 'samp' + } }, gtasao: { name: 'Grand Theft Auto: San Andreas OpenMP', + release_year: 2019, options: { port: 7777, protocol: 'samp' }, - release_year: 2019 + extra: { + old_id: 'saomp' + } }, s2ats: { name: 'Savage 2: A Tortured Soul', + release_year: 2008, options: { port_query: 11235, protocol: 'savage2' }, - release_year: 2008 + extra: { + old_id: 'savage2' + } }, sdtd: { name: '7 Days to Die', + release_year: 2013, options: { port: 26900, port_query_offset: 1, protocol: 'valve' }, - release_year: 2013 + extra: { + old_id: '7d2d' + } }, spaceengineers: { name: 'Space Engineers', + release_year: 2019, options: { port: 27015, protocol: 'valve' - }, - release_year: 2019 + } }, serioussam: { name: 'Serious Sam', + release_year: 2001, options: { port: 25600, port_query_offset: 1, protocol: 'gamespy1' }, - release_year: 2001 + extra: { + old_id: 'ss' + } }, serioussam2: { name: 'Serious Sam 2', + release_year: 2005, options: { port: 25600, protocol: 'gamespy2' }, - release_year: 2005 + extra: { + old_id: 'ss2' + } }, shatteredhorizon: { name: 'Shattered Horizon', + release_year: 2009, options: { port: 27015, protocol: 'valve' - }, - release_year: 2009 + } }, theship: { name: 'The Ship', + release_year: 2006, options: { port: 27015, protocol: 'valve' }, - release_year: 2006 + extra: { + old_id: 'ship' + } }, shogo: { name: 'Shogo', + release_year: 1998, options: { port_query: 27888, protocol: 'gamespy1' - }, - release_year: 1998 + } }, shootmania: { name: 'Shootmania', + release_year: 2013, options: { port: 2350, port_query: 5000, @@ -2155,340 +2492,365 @@ export const games = { }, extra: { doc_notes: 'nadeo-shootmania--trackmania--etc' - }, - release_year: 2013 + } }, sin: { name: 'SiN', + release_year: 1998, options: { port_query: 22450, protocol: 'gamespy1' - }, - release_year: 1998 + } }, sinepisodes: { name: 'SiN Episodes', + release_year: 2006, options: { port: 27015, protocol: 'valve' }, - release_year: 2006 + extra: { + old_id: 'sinep' + } }, soldat: { name: 'Soldat', + release_year: 2002, options: { port: 13073, port_query_offset: 123, protocol: 'ase' - }, - release_year: 2002 + } }, sof: { name: 'Soldier of Fortune', + release_year: 2000, options: { port_query: 28910, protocol: 'quake1' - }, - release_year: 2000 + } }, sof2: { name: 'Soldier of Fortune 2', + release_year: 2002, options: { port_query: 20100, protocol: 'quake3' - }, - release_year: 2002 + } }, sotf: { name: 'Sons Of The Forest', + release_year: 2023, options: { port: 8766, port_query: 27016, protocol: 'valve' }, - release_year: 2023 + extra: { + old_id: 'sonsoftheforest' + } }, stalker: { name: 'S.T.A.L.K.E.R.', + release_year: 2007, options: { port: 5445, port_query_offset: 2, protocol: 'gamespy3' - }, - release_year: 2007 + } }, stn: { name: 'Survive the Nights', + release_year: 2017, options: { port: 7950, port_query_offset: 1, protocol: 'valve' - }, - release_year: 2017 + } }, stbc: { name: 'Star Trek: Bridge Commander', + release_year: 2002, options: { port_query: 22101, protocol: 'gamespy1' - }, - release_year: 2002 + } }, stvef: { name: 'Star Trek: Voyager - Elite Force', + release_year: 2000, options: { port_query: 27960, protocol: 'quake3' - }, - release_year: 2000 + } }, stvef2: { name: 'Star Trek: Voyager - Elite Force 2', + release_year: 2003, options: { port_query: 29253, protocol: 'quake3' - }, - release_year: 2003 + } }, squad: { name: 'Squad', + release_year: 2020, options: { port: 7787, port_query: 27165, protocol: 'valve' - }, - release_year: 2020 + } }, swb: { name: 'Star Wars: Battlefront', + release_year: 2004, options: { port_query: 3658, protocol: 'gamespy2' }, - release_year: 2004 + extra: { + old_id: 'swbf' + } }, swb2: { name: 'Star Wars: Battlefront 2', + release_year: 2005, options: { port_query: 3658, protocol: 'gamespy2' }, - release_year: 2005 + extra: { + old_id: 'swbf2' + } }, swjkja: { name: 'Star Wars Jedi Knight: Jedi Academy', + release_year: 2003, options: { port_query: 29070, protocol: 'quake3' }, - release_year: 2003 + extra: { + old_id: 'swjk' + } }, swjk2jo: { name: 'Star Wars Jedi Knight II: Jedi Outcast', + release_year: 2002, options: { port_query: 28070, protocol: 'quake3' }, - release_year: 2002 + extra: { + old_id: 'swjk2' + } }, swrc: { name: 'Star Wars: Republic Commando', + release_year: 2005, options: { port: 7777, port_query: 11138, protocol: 'gamespy2' - }, - release_year: 2005 + } }, starbound: { name: 'Starbound', + release_year: 2016, options: { port: 21025, protocol: 'valve' - }, - release_year: 2016 + } }, starmade: { name: 'StarMade', + release_year: 2012, options: { port: 4242, protocol: 'starmade' - }, - release_year: 2012 + } }, starsiege: { name: 'Starsiege', + release_year: 2009, options: { port: 29001, protocol: 'starsiege' - }, - release_year: 2009 + } }, suicidesurvival: { name: 'Suicide Survival', + release_year: 2008, options: { port: 27015, protocol: 'valve' - }, - release_year: 2008 + } }, swat4: { name: 'SWAT 4', + release_year: 2005, options: { port: 10480, port_query_offset: 2, protocol: 'gamespy2' - }, - release_year: 2005 + } }, svencoop: { name: 'Sven Coop', + release_year: 1999, options: { port: 27015, protocol: 'valve' - }, - release_year: 1999 + } }, synergy: { name: 'Synergy', + release_year: 2005, options: { port: 27015, protocol: 'valve' - }, - release_year: 2005 + } }, tacticalops: { name: 'Tactical Ops', + release_year: 1999, options: { port: 7777, port_query_offset: 1, protocol: 'gamespy1' - }, - release_year: 1999 + } }, toh: { name: 'Take On Helicopters', + release_year: 2011, options: { port: 2302, port_query_offset: 1, protocol: 'gamespy1' }, - release_year: 2011 + extra: { + old_id: 'takeonhelicopters' + } }, teamfactor: { name: 'Team Factor', + release_year: 2002, options: { port_query: 57778, protocol: 'gamespy1' - }, - release_year: 2002 + } }, tfc: { name: 'Team Fortress Classic', + release_year: 1999, options: { port: 27015, protocol: 'valve' - }, - release_year: 1999 + } }, teamfortress2: { name: 'Team Fortress 2', + release_year: 2007, options: { port: 27015, protocol: 'valve' }, - release_year: 2007 + extra: { + old_id: 'tf2' + } }, teamspeak2: { name: 'Teamspeak 2', + release_year: 2001, options: { port: 8767, protocol: 'teamspeak2' - }, - release_year: 2001 + } }, teamspeak3: { name: 'Teamspeak 3', + release_year: 2011, options: { port: 9987, protocol: 'teamspeak3' }, extra: { doc_notes: 'teamspeak3' - }, - release_year: 2011 + } }, terminus: { name: 'Terminus', + release_year: 2000, options: { port_query: 12286, protocol: 'gamespy1' - }, - release_year: 2000 + } }, terrariatshosck: { name: 'Terraria - TShock', + release_year: 2011, options: { port: 7777, port_query_offset: 101, protocol: 'terraria' }, extra: { + old_id: 'terraria', doc_notes: 'terraria' }, - release_year: 2011 }, theforest: { name: 'The Forest', + release_year: 2014, options: { port: 27015, port_query_offset: 1, protocol: 'valve' - }, - release_year: 2014 + } }, thefront: { name: 'The Front', + release_year: 2023, options: { port_query: 27015, protocol: 'valve' - }, - release_year: 2023 + } }, thps3: { name: "Tony Hawk's Pro Skater 3", + release_year: 2001, options: { port_query: 6500, protocol: 'gamespy1' - }, - release_year: 2001 + } }, thps4: { name: "Tony Hawk's Pro Skater 4", + release_year: 2002, options: { port_query: 6500, protocol: 'gamespy1' - }, - release_year: 2002 + } }, thu2: { name: "Tony Hawk's Underground 2", + release_year: 2004, options: { port_query: 5153, protocol: 'gamespy1' - }, - release_year: 2004 + } }, towerunite: { name: 'Tower Unite', + release_year: 2016, options: { port: 27015, protocol: 'valve' - }, - release_year: 2016 + } }, trackmania2: { name: 'Trackmania 2', + release_year: 2011, options: { port: 2350, port_query: 5000, @@ -2496,11 +2858,11 @@ export const games = { }, extra: { doc_notes: 'nadeo-shootmania--trackmania--etc' - }, - release_year: 2011 + } }, trackmaniaforever: { name: 'Trackmania Forever', + release_year: 2008, options: { port: 2350, port_query: 5000, @@ -2508,148 +2870,166 @@ export const games = { }, extra: { doc_notes: 'nadeo-shootmania--trackmania--etc' - }, - release_year: 2008 + } }, tremulous: { name: 'Tremulous', + release_year: 2006, options: { port_query: 30720, protocol: 'quake3' - }, - release_year: 2006 + } }, t1s: { name: 'Tribes 1: Starsiege', + release_year: 1998, options: { port: 28001, protocol: 'tribes1' }, - release_year: 1998 + extra: { + old_id: 'tribes1' + } }, tribesvengeance: { name: 'Tribes: Vengeance', + release_year: 2004, options: { port: 7777, port_query_offset: 1, protocol: 'gamespy2' - }, - release_year: 2004 + } }, tron20: { name: 'Tron 2.0', + release_year: 2003, options: { port_query: 27888, protocol: 'gamespy2' - }, - release_year: 2003 + } }, thespecialists: { name: 'The Specialists', + release_year: 2002, options: { port: 27015, protocol: 'valve' - }, - release_year: 2002 + } }, turok2: { name: 'Turok 2', + release_year: 1998, options: { port_query: 12880, protocol: 'gamespy1' - }, - release_year: 1998 + } }, u2tax: { name: 'Unreal 2: The Awakening - XMP', + release_year: 2003, options: { port: 7777, port_query_offset: 1, protocol: 'unreal2' - }, - release_year: 2003 + } }, universalcombat: { name: 'Universal Combat', + release_year: 2004, options: { port: 1135, port_query_offset: 123, protocol: 'ase' - }, - release_year: 2004 + } }, unreal: { name: 'Unreal', + release_year: 1998, options: { port: 7777, port_query_offset: 1, protocol: 'gamespy1' - }, - release_year: 1998 + } }, unturned: { name: 'unturned', + release_year: 2014, options: { port: 27015, port_query_offset: 1, protocol: 'valve' - }, - release_year: 2014 + } }, unrealtournament: { name: 'Unreal Tournament', + release_year: 1993, options: { port: 7777, port_query_offset: 1, protocol: 'gamespy1' }, - release_year: 1993 + extra: { + old_id: 'ut' + } }, unrealtournament2003: { name: 'Unreal Tournament 2003', + release_year: 2003, options: { port: 7757, port_query_offset: 1, protocol: 'unreal2' }, - release_year: 2003 + extra: { + old_id: 'ut2003' + } }, unrealtournament2004: { name: 'Unreal Tournament 2004', + release_year: 2004, options: { port: 7777, port_query_offset: 1, protocol: 'unreal2' }, - release_year: 2004 + extra: { + old_id: 'ut2004' + } }, unrealtournament3: { name: 'Unreal Tournament 3', + release_year: 2007, options: { port: 7777, port_query_offset: -1277, protocol: 'ut3' }, - release_year: 2007 + extra: { + old_id: 'ut3' + } }, urbanterror: { name: 'Urban Terror', + release_year: 2000, options: { port_query: 27960, protocol: 'quake3' - }, - release_year: 2000 + } }, v8sc: { name: 'V8 Supercar Challenge', + release_year: 2002, options: { port_query: 16700, protocol: 'gamespy1' }, - release_year: 2002 + extra: { + old_id: 'v8supercar' + } }, valheim: { name: 'Valheim', + release_year: 2021, options: { port: 2456, port_query_offset: 1, @@ -2657,141 +3037,158 @@ export const games = { }, extra: { doc_notes: 'valheim' - }, - release_year: 2021 + } }, vcm: { name: 'Vice City Multiplayer', + release_year: 2015, options: { port: 8192, protocol: 'vcmp' }, - release_year: 2015 + extra: { + old_id: 'vcmp' + } }, ventrilo: { name: 'Ventrilo', + release_year: 2002, options: { port: 3784, protocol: 'ventrilo' - }, - release_year: 2002 + } }, vietcong: { name: 'Vietcong', + release_year: 2003, options: { port: 5425, port_query: 15425, protocol: 'gamespy1' - }, - release_year: 2003 + } }, vietcong2: { name: 'Vietcong 2', + release_year: 2005, options: { port: 5001, port_query: 19967, protocol: 'gamespy2' - }, - release_year: 2005 + } }, vrising: { name: 'V Rising', + release_year: 2022, options: { port: 27015, port_query_offset: [1, 15], protocol: 'valve' - }, - release_year: 2022 + } }, vampireslayer: { name: 'Vampire Slayer', + release_year: 2000, options: { port: 27015, protocol: 'valve' }, - release_year: 2000 + extra: { + old_id: 'vs' + } }, warsow: { name: 'Warsow', + release_year: 2012, options: { port: 44400, protocol: 'warsow' - }, - release_year: 2012 + } }, warfork: { name: 'Warfork', + release_year: 2019, options: { port_query: 44400, protocol: 'warsow' - }, - release_year: 2019 + } }, wot: { name: 'Wheel of Time', + release_year: 1999, options: { port: 7777, port_query_offset: 1, protocol: 'gamespy1' }, - release_year: 1999 + extra: { + old_id: 'wheeloftime' + } }, wolfenstein: { name: 'Wolfenstein', + release_year: 2009, options: { port: 27666, protocol: 'doom3' }, - release_year: 2009 + extra: { + old_id: 'wolfenstein2009' + } }, wet: { name: 'Wolfenstein: Enemy Territory', + release_year: 2003, options: { port_query: 27960, protocol: 'quake3' }, - release_year: 2003 + extra: { + old_id: 'wolfensteinet' + } }, wurmunlimited: { name: 'Wurm Unlimited', + release_year: 2006, options: { port: 3724, query_port: 27016, protocol: 'valve' }, - release_year: 2006 + extra: { + old_id: 'wurm' + } }, xonotic: { name: 'Xonotic', + release_year: 2011, options: { port: 26000, protocol: 'quake3' - }, - release_year: 2011 + } }, xpandrally: { name: 'Xpand Rally', + release_year: 2004, options: { port: 28015, port_query_offset: 123, protocol: 'ase' - }, - release_year: 2004 + } }, zombiemaster: { name: 'Zombie Master', + release_year: 2007, options: { port: 27015, protocol: 'valve' - }, - release_year: 2007 + } }, zps: { name: 'Zombie Panic: Source', + release_year: 2007, options: { port: 27015, protocol: 'valve' - }, - release_year: 2007 + } } } diff --git a/tools/find_id_duplicates.js b/tools/find_id_duplicates.js new file mode 100644 index 0000000..9139181 --- /dev/null +++ b/tools/find_id_duplicates.js @@ -0,0 +1,30 @@ +import { games } from '../lib/games.js' + +const ids = Object.keys(games) + +Object.keys(games).forEach((key) => { + if (games[key].extra && games[key].extra.old_id) { + const idOld = games[key].extra.old_id + ids.push(idOld) + } +}) + +function hasDuplicates(obj) { + const uniqueSet = new Set() + + for (const item of obj) { + if (uniqueSet.has(item)) { + console.log('Duplicate:', item) + return true + } + uniqueSet.add(item) + } + + return false +} + +if (hasDuplicates(ids)) { + console.log('Duplicates found.') +} else { + console.log('No duplicates found.') +} From f46580d1ad330d7ab919841da3617dcf99d9dd43 Mon Sep 17 00:00:00 2001 From: CosminPerRam Date: Mon, 22 Jan 2024 22:31:03 +0200 Subject: [PATCH 18/43] fix: remove query_port and fix those with the use of it (#503) --- CHANGELOG.md | 4 +++- lib/games.js | 8 ++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 679c6f6..bb965c1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -50,7 +50,9 @@ placeholders in the `players` fields. * Stabilized field `numplayers`. * Add note about EOS Protocol not providing players data. * V Rising (2022) - Updated `options.port_query_offset` to `[1, 15]` (#438). -* Minecraft (2009) - Add note about players data +* Minecraft (2009) - Add note about players data. +* Fixed Project Cars and Project Cars 2 port offsets. +* Fixed Wurm Unlimited port_query being missnamed. * BeamMP (2021) - Added support. * Xonotic (2011) - Added support. * Call of Duty: Black Ops 3 (2015) - Added support. diff --git a/lib/games.js b/lib/games.js index 2cb1621..726ee62 100644 --- a/lib/games.js +++ b/lib/games.js @@ -2099,7 +2099,7 @@ export const games = { release_year: 2015, options: { port: 27015, - query_port: 1, + port_query_offset: 1, protocol: 'valve' }, extra: { @@ -2111,7 +2111,7 @@ export const games = { release_year: 2017, options: { port: 27015, - query_port: 1, + port_query_offset: 1, protocol: 'valve' }, extra: { @@ -2797,7 +2797,7 @@ export const games = { extra: { old_id: 'terraria', doc_notes: 'terraria' - }, + } }, theforest: { name: 'The Forest', @@ -3151,7 +3151,7 @@ export const games = { release_year: 2006, options: { port: 3724, - query_port: 27016, + port_query: 27016, protocol: 'valve' }, extra: { From 898037bf762e504a62582d2fd788232fcb3f50ad Mon Sep 17 00:00:00 2001 From: CosminPerRam Date: Mon, 22 Jan 2024 22:57:22 +0200 Subject: [PATCH 19/43] docs: rewrite migration document --- CHANGELOG.md | 4 +- MIGRATE_IDS.md | 149 ++++++++++++++++++++++++++++++++++++++++++++++++ MIGRATION.md | 152 ------------------------------------------------- README.md | 4 +- 4 files changed, 153 insertions(+), 156 deletions(-) create mode 100644 MIGRATE_IDS.md delete mode 100644 MIGRATION.md diff --git a/CHANGELOG.md b/CHANGELOG.md index bb965c1..a8a57eb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,9 +6,9 @@ * Made the library a `module`. * Removed `GameResolver`, moved the `GameDig` class in a separate file. * Modified exports, now the library exports `games` and `protocols` alongside the `GameDig` class. - * A game always has these fields: `name`, `release_year` and `options` (which always contains `port`/`port_query`/`port_query_offset` and `protocol`). + * Many game ids have changed, see the [migrate ids](MIGRATE_IDS.md) file for more info regarding this. + * A game always has these fields: `name`, `release_year` and `options` (which always contains `port`/`port_query`/`port_query_offset` and `protocol`) and could contain `extra.old_id`. * `maxAttempts` has been renamed to `maxRetries`. -* Updated `games` with new naming system, with new option field `options.extra.old_id` with the older ID #### Games * Almost all games ids have been changed to follow a standard, see [CONTRIBUTING.md#naming](https://github.com/gamedig/node-gamedig/blob/5ae12dd494c927abcbe43352609d9aa34a54753c/CONTRIBUTING.md?plain=1#L27C3-L27C3). diff --git a/MIGRATE_IDS.md b/MIGRATE_IDS.md new file mode 100644 index 0000000..dd1f489 --- /dev/null +++ b/MIGRATE_IDS.md @@ -0,0 +1,149 @@ +# Migrating game ids from v4 to v5 + +**Tip**: Checkout the [changelog](CHANGELOG.md) file to see all changes. + +## Game IDs +The naming system used to determine the Game IDs have been updated in `v5` and some IDs have been changed. +This means some ids will not work as they could have been changed to something else, see the table below to check which one is which. +(*Don't see your id here? That means it stayed the same.*) + +**Note**: If you are heavily using the old ids, just pass the `checkOldIDs` as true in options (or `--checkOldIDs` via the CLI) to also use them. +**Warning**: We strongly recommend that you update your game id, as these older IDs will eventually not be supported anymore and will be removed. + +### Old IDs Table +| v4 | | v5 | +|:---------------------|:--|:---------------------| +| americasarmypg | → | aapg | +| 7d2d | → | sdtd | +| americasarmypg | → | aapg | +| as | → | actionsource | +| ageofchivalry | → | aoc | +| arkse | → | ase | +| arcasimracing | → | asr08 | +| arma | → | aaa | +| arma2oa | → | a2oa | +| armacwa | → | acwa | +| armar | → | armaresistance | +| armare | → | armareforger | +| armagetron | → | armagetronadvanced | +| bat1944 | → | battalion1944 | +| bf1942 | → | battlefield1942 | +| bfv | → | battlefieldvietnam | +| bf2 | → | battlefield2 | +| bf2142 | → | battlefield2142 | +| bfbc2 | → | bbc2 | +| bf3 | → | battlefield3 | +| bf4 | → | battlefield4 | +| bfh | → | battlefieldhardline | +| bd | → | basedefense | +| bs | → | bladesymphony | +| buildandshoot | → | bas | +| cod4 | → | cod4mw | +| callofjuarez | → | coj | +| chivalry | → | cmw | +| commandos3 | → | c3db | +| cacrenegade | → | cacr | +| contactjack | → | contractjack | +| cs15 | → | counterstrike15 | +| cs16 | → | counterstrike16 | +| cs2 | → | counterstrike2 | +| crossracing | → | crce | +| darkesthour | → | dhe4445 | +| daysofwar | → | dow | +| deadlydozenpt | → | ddpt | +| dh2005 | → | deerhunter2005 | +| dinodday | → | ddd | +| dirttrackracing2 | → | dtr2 | +| dmc | → | deathmatchclassic | +| dnl | → | dal | +| drakan | → | dootf | +| dys | → | dystopia | +| em | → | empiresmod | +| empyrion | → | egs | +| f12002 | → | formulaone2002 | +| flashpointresistance | → | ofr | +| fivem | → | gta5f | +| forrest | → | theforrest | +| graw | → | tcgraw | +| graw2 | → | tcgraw2 | +| giantscitizenkabuto | → | gck | +| ges | → | goldeneyesource | +| gore | → | gus | +| hldm | → | hld | +| hldms | → | hlds | +| hlopfor | → | hlof | +| hl2dm | → | hl2d | +| hidden | → | thehidden | +| had2 | → | hiddendangerous2 | +| igi2 | → | i2cs | +| il2 | → | il2sturmovik | +| insurgencymic | → | imic | +| isle | → | theisle | +| jamesbondnightfire | → | jb007n | +| jc2mp | → | jc2m | +| jc3mp | → | jc3m | +| kingpin | → | kloc | +| kisspc | → | kpctnc | +| kspdmp | → | kspd | +| kzmod | → | kreedzclimbing | +| left4dead | → | l4d | +| left4dead2 | → | l4d2 | +| m2mp | → | m2m | +| mohsh | → | mohaas | +| mohbt | → | mohaab | +| mohab | → | moha | +| moh2010 | → | moh | +| mohwf | → | mohw | +| minecraftbe | → | mbe | +| mtavc | → | gtavcmta | +| mtasa | → | gtasamta | +| ns | → | naturalselection | +| ns2 | → | naturalselection2 | +| nwn | → | neverwinternights | +| nwn2 | → | neverwinternights2 | +| nolf | → | tonolf | +| nolf2 | → | nolf2asihw | +| pvkii | → | pvak2 | +| ps | → | postscriptum | +| primalcarnage | → | pce | +| pc | → | projectcars | +| pc2 | → | projectcars2 | +| prbf2 | → | prb2 | +| przomboid | → | projectzomboid | +| quake1 | → | quake | +| quake3 | → | q3a | +| ragdollkungfu | → | rdkf | +| r6 | → | rainbowsix | +| r6roguespear | → | rs2rs | +| r6ravenshield | → | rs3rs | +| redorchestraost | → | roo4145 | +| redm | → | rdr2r | +| riseofnations | → | ron | +| rs2 | → | rs2v | +| samp | → | gtasam | +| saomp | → | gtasao | +| savage2 | → | s2ats | +| ss | → | serioussam | +| ss2 | → | serioussam2 | +| ship | → | theship | +| sinep | → | sinepisodes | +| sonsoftheforest | → | sotf | +| swbf | → | swb | +| swbf2 | → | swb2 | +| swjk | → | swjkja | +| swjk2 | → | swjk2jo | +| takeonhelicopters | → | toh | +| tf2 | → | teamfortress2 | +| terraria | → | terrariatshosck | +| tribes1 | → | t1s | +| ut | → | unrealtournament | +| ut2003 | → | unrealtournament2003 | +| ut2004 | → | unrealtournament2004 | +| ut3 | → | unrealtournament3 | +| v8supercar | → | v8sc | +| vcmp | → | vcm | +| vs | → | vampireslayer | +| wheeloftime | → | wot | +| wolfenstein2009 | → | wolfenstein | +| wolfensteinet | → | wet | +| wurm | → | wurmunlimited | diff --git a/MIGRATION.md b/MIGRATION.md deleted file mode 100644 index d49bd01..0000000 --- a/MIGRATION.md +++ /dev/null @@ -1,152 +0,0 @@ -# Migrating from v4 to v5 - -## Game Type IDs - -The naming system used to determine the Game Type IDs have been updated in GameDig v5 and some IDs have been changed. This means you should also update your queries. - -Make sure you check if your game's ID is in the table below. If not, then nothing to worry about. If it is, make sure to update. You can still use the older ID for now, but we strongly recommend that you update your queries, as older IDs will eventually not be supported anymore. - -## Optional Field - -| Field | Type | Default | Description | -|:---------------------------|:--------|:----------|:------------------------------------------| -| **checkOldIDs** | boolean | false | Query will check for older game type IDs. | - -### Old IDs Table - -| v4 | | v5 -|:---|:---|:--- -| americasarmypg | → | aapg -| 7d2d | → | sdtd -| americasarmypg | → | aapg -| as | → | actionsource -| ageofchivalry | → | aoc -| arkse | → | ase -| arcasimracing | → | asr08 -| arma | → | aaa -| arma2oa | → | a2oa -| armacwa | → | acwa -| armar | → | armaresistance -| armare | → | armareforger -| armagetron | → | armagetronadvanced -| bat1944 | → | battalion1944 -| bf1942 | → | battlefield1942 -| bfv | → | battlefieldvietnam -| bf2 | → | battlefield2 -| bf2142 | → | battlefield2142 -| bfbc2 | → | bbc2 -| bf3 | → | battlefield3 -| bf4 | → | battlefield4 -| bfh | → | battlefieldhardline -| bd | → | basedefense -| bs | → | bladesymphony -| buildandshoot | → | bas -| cod4 | → | cod4mw -| callofjuarez | → | coj -| chivalry | → | cmw -| commandos3 | → | c3db -| cacrenegade | → | cacr -| contactjack | → | contractjack -| cs15 | → | counterstrike15 -| cs16 | → | counterstrike16 -| cs2 | → | counterstrike2 -| crossracing | → | crce -| darkesthour | → | dhe4445 -| daysofwar | → | dow -| deadlydozenpt | → | ddpt -| dh2005 | → | deerhunter2005 -| dinodday | → | ddd -| dirttrackracing2 | → | dtr2 -| dmc | → | deathmatchclassic -| dnl | → | dal -| drakan | → | dootf -| dys | → | dystopia -| em | → | empiresmod -| empyrion | → | egs -| f12002 | → | formulaone2002 -| flashpointresistance | → | ofr -| fivem | → | gta5f -| forrest | → | theforrest -| graw | → | tcgraw -| graw2 | → | tcgraw2 -| giantscitizenkabuto | → | gck -| ges | → | goldeneyesource -| gore | → | gus -| hldm | → | hld -| hldms | → | hlds -| hlopfor | → | hlof -| hl2dm | → | hl2d -| hidden | → | thehidden -| had2 | → | hiddendangerous2 -| igi2 | → | i2cs -| il2 | → | il2sturmovik -| insurgencymic | → | imic -| isle | → | theisle -| jamesbondnightfire | → | jb007n -| jc2mp | → | jc2m -| jc3mp | → | jc3m -| kingpin | → | kloc -| kisspc | → | kpctnc -| kspdmp | → | kspd -| kzmod | → | kreedzclimbing -| left4dead | → | l4d -| left4dead2 | → | l4d2 -| m2mp | → | m2m -| mohsh | → | mohaas -| mohbt | → | mohaab -| mohab | → | moha -| moh2010 | → | moh -| mohwf | → | mohw -| minecraftbe | → | mbe -| mtavc | → | gtavcmta -| mtasa | → | gtasamta -| ns | → | naturalselection -| ns2 | → | naturalselection2 -| nwn | → | neverwinternights -| nwn2 | → | neverwinternights2 -| nolf | → | tonolf -| nolf2 | → | nolf2asihw -| pvkii | → | pvak2 -| ps | → | postscriptum -| primalcarnage | → | pce -| pc | → | projectcars -| pc2 | → | projectcars2 -| prbf2 | → | prb2 -| przomboid | → | projectzomboid -| quake1 | → | quake -| quake3 | → | q3a -| ragdollkungfu | → | rdkf -| r6 | → | rainbowsix -| r6roguespear | → | rs2rs -| r6ravenshield | → | rs3rs -| redorchestraost | → | roo4145 -| redm | → | rdr2r -| riseofnations | → | ron -| rs2 | → | rs2v -| samp | → | gtasam -| saomp | → | gtasao -| savage2 | → | s2ats -| ss | → | serioussam -| ss2 | → | serioussam2 -| ship | → | theship -| sinep | → | sinepisodes -| sonsoftheforest | → | sotf -| swbf | → | swb -| swbf2 | → | swb2 -| swjk | → | swjkja -| swjk2 | → | swjk2jo -| takeonhelicopters | → | toh -| tf2 | → | teamfortress2 -| terraria | → | terrariatshosck -| tribes1 | → | t1s -| ut | → | unrealtournament -| ut2003 | → | unrealtournament2003 -| ut2004 | → | unrealtournament2004 -| ut3 | → | unrealtournament3 -| v8supercar | → | v8sc -| vcmp | → | vcm -| vs | → | vampireslayer -| wheeloftime | → | wot -| wolfenstein2009 | → | wolfenstein -| wolfensteinet | → | wet -| wurm | → | wurmunlimited \ No newline at end of file diff --git a/README.md b/README.md index 2f60dc7..21e4fe6 100644 --- a/README.md +++ b/README.md @@ -8,8 +8,8 @@ If a server makes its status publically available, GameDig can fetch it for you. Support is available on the [Discord](https://discord.gg/NVCMn3tnxH) for questions, or [GitHub](https://github.com/gamedig/node-gamedig/issues) for bugs. -## Migration from v4 to v5 -Game Type IDs have been updated in GameDig v5. Make sure to check if your game's ID is in the [migration document](MIGRATION.md). +**Are you updating from v4 to v5?** Many game ids have changed. +Make sure to check if your game's ID is in the [id migration document](MIGRATE_IDS.md) and don't forget to check the [changelog](CHANGELOG.md) file. ## Games List **node-GameDig** can query over 310 games + a few services! From b0ca4df6870f55e7736edceb0f3bfbe90a5aae52 Mon Sep 17 00:00:00 2001 From: CosminPerRam Date: Mon, 22 Jan 2024 23:05:52 +0200 Subject: [PATCH 20/43] fix: rewrite migration document and fix check old ids (#504) * docs: rewrite migration document * fix: old games check --- CHANGELOG.md | 4 +- MIGRATE_IDS.md | 149 ++++++++++++++++++++++++++++++++++++++++++ MIGRATION.md | 152 ------------------------------------------- README.md | 4 +- lib/game-resolver.js | 4 +- 5 files changed, 155 insertions(+), 158 deletions(-) create mode 100644 MIGRATE_IDS.md delete mode 100644 MIGRATION.md diff --git a/CHANGELOG.md b/CHANGELOG.md index bb965c1..a8a57eb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,9 +6,9 @@ * Made the library a `module`. * Removed `GameResolver`, moved the `GameDig` class in a separate file. * Modified exports, now the library exports `games` and `protocols` alongside the `GameDig` class. - * A game always has these fields: `name`, `release_year` and `options` (which always contains `port`/`port_query`/`port_query_offset` and `protocol`). + * Many game ids have changed, see the [migrate ids](MIGRATE_IDS.md) file for more info regarding this. + * A game always has these fields: `name`, `release_year` and `options` (which always contains `port`/`port_query`/`port_query_offset` and `protocol`) and could contain `extra.old_id`. * `maxAttempts` has been renamed to `maxRetries`. -* Updated `games` with new naming system, with new option field `options.extra.old_id` with the older ID #### Games * Almost all games ids have been changed to follow a standard, see [CONTRIBUTING.md#naming](https://github.com/gamedig/node-gamedig/blob/5ae12dd494c927abcbe43352609d9aa34a54753c/CONTRIBUTING.md?plain=1#L27C3-L27C3). diff --git a/MIGRATE_IDS.md b/MIGRATE_IDS.md new file mode 100644 index 0000000..dd1f489 --- /dev/null +++ b/MIGRATE_IDS.md @@ -0,0 +1,149 @@ +# Migrating game ids from v4 to v5 + +**Tip**: Checkout the [changelog](CHANGELOG.md) file to see all changes. + +## Game IDs +The naming system used to determine the Game IDs have been updated in `v5` and some IDs have been changed. +This means some ids will not work as they could have been changed to something else, see the table below to check which one is which. +(*Don't see your id here? That means it stayed the same.*) + +**Note**: If you are heavily using the old ids, just pass the `checkOldIDs` as true in options (or `--checkOldIDs` via the CLI) to also use them. +**Warning**: We strongly recommend that you update your game id, as these older IDs will eventually not be supported anymore and will be removed. + +### Old IDs Table +| v4 | | v5 | +|:---------------------|:--|:---------------------| +| americasarmypg | → | aapg | +| 7d2d | → | sdtd | +| americasarmypg | → | aapg | +| as | → | actionsource | +| ageofchivalry | → | aoc | +| arkse | → | ase | +| arcasimracing | → | asr08 | +| arma | → | aaa | +| arma2oa | → | a2oa | +| armacwa | → | acwa | +| armar | → | armaresistance | +| armare | → | armareforger | +| armagetron | → | armagetronadvanced | +| bat1944 | → | battalion1944 | +| bf1942 | → | battlefield1942 | +| bfv | → | battlefieldvietnam | +| bf2 | → | battlefield2 | +| bf2142 | → | battlefield2142 | +| bfbc2 | → | bbc2 | +| bf3 | → | battlefield3 | +| bf4 | → | battlefield4 | +| bfh | → | battlefieldhardline | +| bd | → | basedefense | +| bs | → | bladesymphony | +| buildandshoot | → | bas | +| cod4 | → | cod4mw | +| callofjuarez | → | coj | +| chivalry | → | cmw | +| commandos3 | → | c3db | +| cacrenegade | → | cacr | +| contactjack | → | contractjack | +| cs15 | → | counterstrike15 | +| cs16 | → | counterstrike16 | +| cs2 | → | counterstrike2 | +| crossracing | → | crce | +| darkesthour | → | dhe4445 | +| daysofwar | → | dow | +| deadlydozenpt | → | ddpt | +| dh2005 | → | deerhunter2005 | +| dinodday | → | ddd | +| dirttrackracing2 | → | dtr2 | +| dmc | → | deathmatchclassic | +| dnl | → | dal | +| drakan | → | dootf | +| dys | → | dystopia | +| em | → | empiresmod | +| empyrion | → | egs | +| f12002 | → | formulaone2002 | +| flashpointresistance | → | ofr | +| fivem | → | gta5f | +| forrest | → | theforrest | +| graw | → | tcgraw | +| graw2 | → | tcgraw2 | +| giantscitizenkabuto | → | gck | +| ges | → | goldeneyesource | +| gore | → | gus | +| hldm | → | hld | +| hldms | → | hlds | +| hlopfor | → | hlof | +| hl2dm | → | hl2d | +| hidden | → | thehidden | +| had2 | → | hiddendangerous2 | +| igi2 | → | i2cs | +| il2 | → | il2sturmovik | +| insurgencymic | → | imic | +| isle | → | theisle | +| jamesbondnightfire | → | jb007n | +| jc2mp | → | jc2m | +| jc3mp | → | jc3m | +| kingpin | → | kloc | +| kisspc | → | kpctnc | +| kspdmp | → | kspd | +| kzmod | → | kreedzclimbing | +| left4dead | → | l4d | +| left4dead2 | → | l4d2 | +| m2mp | → | m2m | +| mohsh | → | mohaas | +| mohbt | → | mohaab | +| mohab | → | moha | +| moh2010 | → | moh | +| mohwf | → | mohw | +| minecraftbe | → | mbe | +| mtavc | → | gtavcmta | +| mtasa | → | gtasamta | +| ns | → | naturalselection | +| ns2 | → | naturalselection2 | +| nwn | → | neverwinternights | +| nwn2 | → | neverwinternights2 | +| nolf | → | tonolf | +| nolf2 | → | nolf2asihw | +| pvkii | → | pvak2 | +| ps | → | postscriptum | +| primalcarnage | → | pce | +| pc | → | projectcars | +| pc2 | → | projectcars2 | +| prbf2 | → | prb2 | +| przomboid | → | projectzomboid | +| quake1 | → | quake | +| quake3 | → | q3a | +| ragdollkungfu | → | rdkf | +| r6 | → | rainbowsix | +| r6roguespear | → | rs2rs | +| r6ravenshield | → | rs3rs | +| redorchestraost | → | roo4145 | +| redm | → | rdr2r | +| riseofnations | → | ron | +| rs2 | → | rs2v | +| samp | → | gtasam | +| saomp | → | gtasao | +| savage2 | → | s2ats | +| ss | → | serioussam | +| ss2 | → | serioussam2 | +| ship | → | theship | +| sinep | → | sinepisodes | +| sonsoftheforest | → | sotf | +| swbf | → | swb | +| swbf2 | → | swb2 | +| swjk | → | swjkja | +| swjk2 | → | swjk2jo | +| takeonhelicopters | → | toh | +| tf2 | → | teamfortress2 | +| terraria | → | terrariatshosck | +| tribes1 | → | t1s | +| ut | → | unrealtournament | +| ut2003 | → | unrealtournament2003 | +| ut2004 | → | unrealtournament2004 | +| ut3 | → | unrealtournament3 | +| v8supercar | → | v8sc | +| vcmp | → | vcm | +| vs | → | vampireslayer | +| wheeloftime | → | wot | +| wolfenstein2009 | → | wolfenstein | +| wolfensteinet | → | wet | +| wurm | → | wurmunlimited | diff --git a/MIGRATION.md b/MIGRATION.md deleted file mode 100644 index d49bd01..0000000 --- a/MIGRATION.md +++ /dev/null @@ -1,152 +0,0 @@ -# Migrating from v4 to v5 - -## Game Type IDs - -The naming system used to determine the Game Type IDs have been updated in GameDig v5 and some IDs have been changed. This means you should also update your queries. - -Make sure you check if your game's ID is in the table below. If not, then nothing to worry about. If it is, make sure to update. You can still use the older ID for now, but we strongly recommend that you update your queries, as older IDs will eventually not be supported anymore. - -## Optional Field - -| Field | Type | Default | Description | -|:---------------------------|:--------|:----------|:------------------------------------------| -| **checkOldIDs** | boolean | false | Query will check for older game type IDs. | - -### Old IDs Table - -| v4 | | v5 -|:---|:---|:--- -| americasarmypg | → | aapg -| 7d2d | → | sdtd -| americasarmypg | → | aapg -| as | → | actionsource -| ageofchivalry | → | aoc -| arkse | → | ase -| arcasimracing | → | asr08 -| arma | → | aaa -| arma2oa | → | a2oa -| armacwa | → | acwa -| armar | → | armaresistance -| armare | → | armareforger -| armagetron | → | armagetronadvanced -| bat1944 | → | battalion1944 -| bf1942 | → | battlefield1942 -| bfv | → | battlefieldvietnam -| bf2 | → | battlefield2 -| bf2142 | → | battlefield2142 -| bfbc2 | → | bbc2 -| bf3 | → | battlefield3 -| bf4 | → | battlefield4 -| bfh | → | battlefieldhardline -| bd | → | basedefense -| bs | → | bladesymphony -| buildandshoot | → | bas -| cod4 | → | cod4mw -| callofjuarez | → | coj -| chivalry | → | cmw -| commandos3 | → | c3db -| cacrenegade | → | cacr -| contactjack | → | contractjack -| cs15 | → | counterstrike15 -| cs16 | → | counterstrike16 -| cs2 | → | counterstrike2 -| crossracing | → | crce -| darkesthour | → | dhe4445 -| daysofwar | → | dow -| deadlydozenpt | → | ddpt -| dh2005 | → | deerhunter2005 -| dinodday | → | ddd -| dirttrackracing2 | → | dtr2 -| dmc | → | deathmatchclassic -| dnl | → | dal -| drakan | → | dootf -| dys | → | dystopia -| em | → | empiresmod -| empyrion | → | egs -| f12002 | → | formulaone2002 -| flashpointresistance | → | ofr -| fivem | → | gta5f -| forrest | → | theforrest -| graw | → | tcgraw -| graw2 | → | tcgraw2 -| giantscitizenkabuto | → | gck -| ges | → | goldeneyesource -| gore | → | gus -| hldm | → | hld -| hldms | → | hlds -| hlopfor | → | hlof -| hl2dm | → | hl2d -| hidden | → | thehidden -| had2 | → | hiddendangerous2 -| igi2 | → | i2cs -| il2 | → | il2sturmovik -| insurgencymic | → | imic -| isle | → | theisle -| jamesbondnightfire | → | jb007n -| jc2mp | → | jc2m -| jc3mp | → | jc3m -| kingpin | → | kloc -| kisspc | → | kpctnc -| kspdmp | → | kspd -| kzmod | → | kreedzclimbing -| left4dead | → | l4d -| left4dead2 | → | l4d2 -| m2mp | → | m2m -| mohsh | → | mohaas -| mohbt | → | mohaab -| mohab | → | moha -| moh2010 | → | moh -| mohwf | → | mohw -| minecraftbe | → | mbe -| mtavc | → | gtavcmta -| mtasa | → | gtasamta -| ns | → | naturalselection -| ns2 | → | naturalselection2 -| nwn | → | neverwinternights -| nwn2 | → | neverwinternights2 -| nolf | → | tonolf -| nolf2 | → | nolf2asihw -| pvkii | → | pvak2 -| ps | → | postscriptum -| primalcarnage | → | pce -| pc | → | projectcars -| pc2 | → | projectcars2 -| prbf2 | → | prb2 -| przomboid | → | projectzomboid -| quake1 | → | quake -| quake3 | → | q3a -| ragdollkungfu | → | rdkf -| r6 | → | rainbowsix -| r6roguespear | → | rs2rs -| r6ravenshield | → | rs3rs -| redorchestraost | → | roo4145 -| redm | → | rdr2r -| riseofnations | → | ron -| rs2 | → | rs2v -| samp | → | gtasam -| saomp | → | gtasao -| savage2 | → | s2ats -| ss | → | serioussam -| ss2 | → | serioussam2 -| ship | → | theship -| sinep | → | sinepisodes -| sonsoftheforest | → | sotf -| swbf | → | swb -| swbf2 | → | swb2 -| swjk | → | swjkja -| swjk2 | → | swjk2jo -| takeonhelicopters | → | toh -| tf2 | → | teamfortress2 -| terraria | → | terrariatshosck -| tribes1 | → | t1s -| ut | → | unrealtournament -| ut2003 | → | unrealtournament2003 -| ut2004 | → | unrealtournament2004 -| ut3 | → | unrealtournament3 -| v8supercar | → | v8sc -| vcmp | → | vcm -| vs | → | vampireslayer -| wheeloftime | → | wot -| wolfenstein2009 | → | wolfenstein -| wolfensteinet | → | wet -| wurm | → | wurmunlimited \ No newline at end of file diff --git a/README.md b/README.md index 2f60dc7..21e4fe6 100644 --- a/README.md +++ b/README.md @@ -8,8 +8,8 @@ If a server makes its status publically available, GameDig can fetch it for you. Support is available on the [Discord](https://discord.gg/NVCMn3tnxH) for questions, or [GitHub](https://github.com/gamedig/node-gamedig/issues) for bugs. -## Migration from v4 to v5 -Game Type IDs have been updated in GameDig v5. Make sure to check if your game's ID is in the [migration document](MIGRATION.md). +**Are you updating from v4 to v5?** Many game ids have changed. +Make sure to check if your game's ID is in the [id migration document](MIGRATE_IDS.md) and don't forget to check the [changelog](CHANGELOG.md) file. ## Games List **node-GameDig** can query over 310 games + a few services! diff --git a/lib/game-resolver.js b/lib/game-resolver.js index d875c99..f04ba52 100644 --- a/lib/game-resolver.js +++ b/lib/game-resolver.js @@ -12,10 +12,10 @@ export const lookup = (options) => { } let game = games[type] - + if (options.checkOldIDs) { Object.keys(games).forEach((id) => { - if (games[id]?.extra.old_id) { + if (games[id]?.extra?.old_id === type) { game = games[id] } }) From 16e9454beb03d8b0023ca13b47399fc813c1e9a3 Mon Sep 17 00:00:00 2001 From: CosminPerRam Date: Mon, 22 Jan 2024 23:17:07 +0200 Subject: [PATCH 21/43] fix: readme example and add more options to the simple example --- README.md | 6 +++--- examples/simple.js | 4 +++- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 21e4fe6..b480d8e 100644 --- a/README.md +++ b/README.md @@ -18,15 +18,15 @@ See the [GAMES_LIST.md](GAMES_LIST.md) file for the currently supported titles, ## Usage from Node.js Install using your favorite package manager: `npm install gamedig`, then use! ```js -import GameDig from 'gamedig'; +import { GameDig } from 'gamedig'; GameDig.query({ type: 'minecraft', - host: 'mc.example.com' + host: 'mc.hypixel.net' }).then((state) => { console.log(state); }).catch((error) => { - console.log("Server is offline"); + console.log(`Server is offline, error: ${error}`); }); ``` Confused on how this works, or you want to see more? Checkout the [examples](/examples) folder! diff --git a/examples/simple.js b/examples/simple.js index a0c52c1..31295db 100644 --- a/examples/simple.js +++ b/examples/simple.js @@ -3,7 +3,9 @@ import { GameDig } from '../lib/index.js' GameDig.query({ type: 'minecraft', - host: 'mc.hypixel.net' + host: 'mc.hypixel.net', + port: 25565, // lets us explicitly specify the query port of this server + givenPortOnly: true // the library will attempt multiple ports in order to ensure success, to avoid this pass this option }).then((state) => { console.log(state) }).catch((error) => { From 398b32d5e5ae29568762d8a213e79e6fec752907 Mon Sep 17 00:00:00 2001 From: CosminPerRam Date: Mon, 22 Jan 2024 23:19:25 +0200 Subject: [PATCH 22/43] docs: mention checkOldIDs in the readme options --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index b480d8e..7ca2904 100644 --- a/README.md +++ b/README.md @@ -56,6 +56,7 @@ Confused on how this works, or you want to see more? Checkout the [examples](/ex | **stripColors** | boolean | true | Enables stripping colors for protocols: unreal2, savage2, quake3, nadeo, gamespy2, doom3, armagetron. | | **portCache** | boolean | true | After you queried a server, the second time you query that exact server (identified by specified ip and port), first add an attempt to query with the last successful port. | | **noBreadthOrder** | boolean | false | Enable the behaviour of retrying an attempt X times followed by the next attempt X times, otherwise try attempt A, then B, then A, then B until reaching the X retry count of each. | +| **checkOldIDs** | boolean | false | Also checks the old ids amongst the current ones. | ## Query Response From 38c6712fd7b5ab181773c03675958e132d14c26d Mon Sep 17 00:00:00 2001 From: CosminPerRam Date: Mon, 22 Jan 2024 23:23:05 +0200 Subject: [PATCH 23/43] fix: terraria tshock mistype --- GAMES_LIST.md | 2 +- lib/games.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/GAMES_LIST.md b/GAMES_LIST.md index 0ce4978..0c78ac4 100644 --- a/GAMES_LIST.md +++ b/GAMES_LIST.md @@ -280,7 +280,7 @@ | teamspeak2 | Teamspeak 2 | | | teamspeak3 | Teamspeak 3 | [Notes](#teamspeak3) | | terminus | Terminus | | -| terrariatshosck | Terraria - TShock | [Notes](#terraria) | +| terrariatshock | Terraria - TShock | [Notes](#terraria) | | tfc | Team Fortress Classic | [Valve Protocol](#valve) | | theforest | The Forest | [Valve Protocol](#valve) | | theforrest | The Forrest | [Valve Protocol](#valve) | diff --git a/lib/games.js b/lib/games.js index 726ee62..f4f0a6f 100644 --- a/lib/games.js +++ b/lib/games.js @@ -2786,7 +2786,7 @@ export const games = { protocol: 'gamespy1' } }, - terrariatshosck: { + terrariatshock: { name: 'Terraria - TShock', release_year: 2011, options: { From c6dd2105915cc77bc00891fb3959cf62e989fb19 Mon Sep 17 00:00:00 2001 From: CosminPerRam Date: Mon, 22 Jan 2024 23:24:18 +0200 Subject: [PATCH 24/43] chore: update readme game support count --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 7ca2904..9a4279d 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ Support is available on the [Discord](https://discord.gg/NVCMn3tnxH) for questio Make sure to check if your game's ID is in the [id migration document](MIGRATE_IDS.md) and don't forget to check the [changelog](CHANGELOG.md) file. ## Games List -**node-GameDig** can query over 310 games + a few services! +**node-GameDig** can query over 320 games + a few services! See the [GAMES_LIST.md](GAMES_LIST.md) file for the currently supported titles, not yet supported titles and notes about some of them. ## Usage from Node.js From 21add425babd067470582454aa490b3bf35fbe8c Mon Sep 17 00:00:00 2001 From: CosminPerRam Date: Mon, 22 Jan 2024 23:36:08 +0200 Subject: [PATCH 25/43] feat: release version 5.0.0-beta.0 --- CHANGELOG.md | 2 ++ package.json | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a8a57eb..e56e40a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,7 @@ ## To Be Released... + +## 5.0.0-beta.0 ### Breaking Changes #### Package * Node.js 16.20 is now required (from 14). diff --git a/package.json b/package.json index ab8f0dd..281c7d4 100644 --- a/package.json +++ b/package.json @@ -27,7 +27,7 @@ "type": "module", "main": "lib/index.js", "author": "GameDig Contributors", - "version": "4.1.0", + "version": "5.0.0-beta.0", "repository": { "type": "git", "url": "https://github.com/gamedig/node-gamedig.git" From c7b8fa205311942ed1bb3c6bd1c006b1c6cf3fa0 Mon Sep 17 00:00:00 2001 From: CosminPerRam Date: Tue, 23 Jan 2024 00:17:59 +0200 Subject: [PATCH 26/43] docs: remove misleading source data references --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 9a4279d..b14fc2b 100644 --- a/README.md +++ b/README.md @@ -67,9 +67,9 @@ The returned state object will contain the following keys: | **name** | string | Server name. | | **map** | string | Server map. | | **password** | boolean | If a password is required. | -| **numplayers** | number | Number of players connected. Data via [A2S_INFO](https://developer.valvesoftware.com/wiki/Server_queries#A2S_INFO). | +| **numplayers** | number | Number of players connected. | | **maxplayers** | number | Maximum number of connected players. | -| **players** | array of objects | Note that this could be of a different length compared to **numplayers**. Data via [A2S_PLAYER](https://developer.valvesoftware.com/wiki/Server_queries#A2S_PLAYER). | +| **players** | array of objects | Note that this could be of a different length compared to **numplayers**. | | **players.name** | string | If the player's name is unknown, the string will be empty. | | **players.raw** | object | Additional information about the player if available. | | **bots** | array of objects | Same schema as `players`. | From 46db10fcc707b934974a4d0d035808ec1c9d72e0 Mon Sep 17 00:00:00 2001 From: Sebastian Schmidt <2270806+jammsen@users.noreply.github.com> Date: Wed, 24 Jan 2024 14:18:05 +0100 Subject: [PATCH 27/43] : Incorrect numplayers on Palworld (#508) * Fix: Palworld results - Name of the server is empty * #497 - refactor of feedback * #497 - refactor of feedback from Cosmin * Fix for current-players bug - #491 and #507 * Fix for current-players bug - #491 and #507 - added changelog --- CHANGELOG.md | 2 ++ protocols/palworld.js | 1 + 2 files changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index e56e40a..212c54f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,7 @@ ## To Be Released... +## 5.0.0-beta.1 +* Fixed numplayers on Palworld not beeing accurate ## 5.0.0-beta.0 ### Breaking Changes diff --git a/protocols/palworld.js b/protocols/palworld.js index 973db49..33ca9c8 100644 --- a/protocols/palworld.js +++ b/protocols/palworld.js @@ -14,5 +14,6 @@ export default class palworld extends Epic { async run (state) { await super.run(state) state.name = state.raw.attributes.NAME_s + state.numplayers = state.raw.attributes.PLAYERS_l } } From dbf83ab083cdf3a9242f8fd80c50213d659eb291 Mon Sep 17 00:00:00 2001 From: Guilherme Werner Date: Wed, 24 Jan 2024 17:51:48 -0300 Subject: [PATCH 28/43] feat: add support for Enshrouded (#512) * Add support to Enshrouded * Update CHANGELOG.md --- CHANGELOG.md | 1 + GAMES_LIST.md | 1 + lib/games.js | 9 +++++++++ 3 files changed, 11 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 212c54f..16e4d4c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ ## To Be Released... ## 5.0.0-beta.1 * Fixed numplayers on Palworld not beeing accurate +* Enshrouded - Added support (By @GuilhermeWerner #512). ## 5.0.0-beta.0 ### Breaking Changes diff --git a/GAMES_LIST.md b/GAMES_LIST.md index 0c78ac4..66ca0cd 100644 --- a/GAMES_LIST.md +++ b/GAMES_LIST.md @@ -114,6 +114,7 @@ | egs | Empyrion - Galactic Survival | [Valve Protocol](#valve) | | eldewrito | Halo Online (ElDewrito) | | | empiresmod | Empires Mod | [Valve Protocol](#valve) | +| enshrouded | Enshrouded | [Valve Protocol](#valve) | | etqw | Enemy Territory: Quake Wars | | | f1c9902 | F1 Challenge '99-'02 | | | farcry | Far Cry | | diff --git a/lib/games.js b/lib/games.js index f4f0a6f..242c295 100644 --- a/lib/games.js +++ b/lib/games.js @@ -1098,6 +1098,15 @@ export const games = { old_id: 'empyrion' } }, + enshrouded: { + name: 'enshrouded', + release_year: 2024, + options: { + port: 15636, + port_query: 15637, + protocol: 'valve' + } + }, etqw: { name: 'Enemy Territory: Quake Wars', release_year: 2007, From 0bf6645921608fe3f191b476d86a42830b3efddf Mon Sep 17 00:00:00 2001 From: Sebastian Schmidt <2270806+jammsen@users.noreply.github.com> Date: Sat, 27 Jan 2024 12:00:27 +0100 Subject: [PATCH 29/43] fix: typo in standard port for Palworld (#516) * Fix: Palworld results - Name of the server is empty * #497 - refactor of feedback * #497 - refactor of feedback from Cosmin * Fix for current-players bug - #491 and #507 * Fix for current-players bug - #491 and #507 - added changelog * #515 fixed typo in standard port for Palworld --- CHANGELOG.md | 1 + lib/games.js | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 16e4d4c..5a185a2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ ## 5.0.0-beta.1 * Fixed numplayers on Palworld not beeing accurate * Enshrouded - Added support (By @GuilhermeWerner #512). +* Fixed typo in standard port on Palworld (By jammsen #515) ## 5.0.0-beta.0 ### Breaking Changes diff --git a/lib/games.js b/lib/games.js index 242c295..7ece58a 100644 --- a/lib/games.js +++ b/lib/games.js @@ -2039,7 +2039,7 @@ export const games = { name: 'Palworld', release_year: 2024, options: { - port: 8221, + port: 8211, protocol: 'palworld' } }, From 731f553607e7078b1114f9695af1014047e0d4c8 Mon Sep 17 00:00:00 2001 From: Pedro Ivo Hudson Date: Mon, 29 Jan 2024 14:03:07 -0300 Subject: [PATCH 30/43] feat: add Duke Nukem Forever 2001 support (#499) --- CHANGELOG.md | 1 + GAMES_LIST.md | 1 + lib/games.js | 9 +++++++++ 3 files changed, 11 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5a185a2..d4420eb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ * Fixed numplayers on Palworld not beeing accurate * Enshrouded - Added support (By @GuilhermeWerner #512). * Fixed typo in standard port on Palworld (By jammsen #515) +* Duke Nukem Forever 2001 (2022) - Added support (By @podrivo #499) ## 5.0.0-beta.0 ### Breaking Changes diff --git a/GAMES_LIST.md b/GAMES_LIST.md index 66ca0cd..781298c 100644 --- a/GAMES_LIST.md +++ b/GAMES_LIST.md @@ -101,6 +101,7 @@ | discord | Discord | [Notes](#discord) | | dmomam | Dark Messiah of Might and Magic | [Valve Protocol](#valve) | | dod | Day of Defeat | [Valve Protocol](#valve) | +| dnf2001 | Duke Nukem Forever 2001 | | | dods | Day of Defeat: Source | [Valve Protocol](#valve) | | doi | Day of Infamy | [Valve Protocol](#valve) | | doom3 | Doom 3 | | diff --git a/lib/games.js b/lib/games.js index 7ece58a..8b3f554 100644 --- a/lib/games.js +++ b/lib/games.js @@ -987,6 +987,15 @@ export const games = { old_id: 'dnl' } }, + dnf2001: { + name: 'Duke Nukem Forever 2001', + release_year: 2022, + options: { + port: 7777, + port_query_offset: 1, + protocol: 'gamespy1' + } + }, dod: { name: 'Day of Defeat', release_year: 2003, From 38ddfd61f32554f3172c87f064947851304e8171 Mon Sep 17 00:00:00 2001 From: Guilherme Werner Date: Mon, 29 Jan 2024 17:55:25 -0300 Subject: [PATCH 31/43] feat: add support to CommonJS (#519) * Add support to CommonJS * Fixes * Update CHANGELOG.md --- .gitignore | 1 + CHANGELOG.md | 1 + examples/{simple.js => import.mjs} | 0 examples/require.cjs | 13 + package-lock.json | 642 ++++++++++++++++++++++++++++- package.json | 11 +- tools/esbuild.js | 15 + 7 files changed, 679 insertions(+), 4 deletions(-) rename examples/{simple.js => import.mjs} (100%) create mode 100644 examples/require.cjs create mode 100644 tools/esbuild.js diff --git a/.gitignore b/.gitignore index c6b9c72..4687c38 100644 --- a/.gitignore +++ b/.gitignore @@ -2,5 +2,6 @@ /npm-debug.log /*.iml /.idea +/dist # Deno bin/gamedig executable gamedig diff --git a/CHANGELOG.md b/CHANGELOG.md index d4420eb..c7a12cb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ * Fixed numplayers on Palworld not beeing accurate * Enshrouded - Added support (By @GuilhermeWerner #512). * Fixed typo in standard port on Palworld (By jammsen #515) +* Re-added support for projects using `require` (By @GuilhermeWerner #519). * Duke Nukem Forever 2001 (2022) - Added support (By @podrivo #499) ## 5.0.0-beta.0 diff --git a/examples/simple.js b/examples/import.mjs similarity index 100% rename from examples/simple.js rename to examples/import.mjs diff --git a/examples/require.cjs b/examples/require.cjs new file mode 100644 index 0000000..c30f9cb --- /dev/null +++ b/examples/require.cjs @@ -0,0 +1,13 @@ +const { GameDig } = require('../dist/index.cjs') +// Instead of '../dist/index.cjs' you would have here 'gamedig'. + +GameDig.query({ + type: 'minecraft', + host: 'mc.hypixel.net', + port: 25565, // lets us explicitly specify the query port of this server + givenPortOnly: true // the library will attempt multiple ports in order to ensure success, to avoid this pass this option +}).then((state) => { + console.log(state) +}).catch((error) => { + console.log(`Server is offline, error: ${error}`) +}) diff --git a/package-lock.json b/package-lock.json index df2e823..089f40e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "gamedig", - "version": "4.1.0", + "version": "5.0.0-beta.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "gamedig", - "version": "4.1.0", + "version": "5.0.0-beta.0", "license": "MIT", "dependencies": { "cheerio": "^1.0.0-rc.12", @@ -25,6 +25,8 @@ "devDependencies": { "@types/cheerio": "^0.22.31", "@types/node": "^16.18.58", + "esbuild": "^0.19.10", + "esbuild-node-externals": "^1.12.0", "eslint": "^8.49.0", "eslint-config-standard": "^17.1.0", "eslint-plugin-import": "^2.28.1", @@ -44,6 +46,374 @@ "node": ">=0.10.0" } }, + "node_modules/@esbuild/aix-ppc64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.19.12.tgz", + "integrity": "sha512-bmoCYyWdEL3wDQIVbcyzRyeKLgk2WtWLTWz1ZIAZF/EGbNOwSA6ew3PftJ1PqMiOOGu0OyFMzG53L0zqIpPeNA==", + "cpu": [ + "ppc64" + ], + "dev": true, + "optional": true, + "os": [ + "aix" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/android-arm": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.19.12.tgz", + "integrity": "sha512-qg/Lj1mu3CdQlDEEiWrlC4eaPZ1KztwGJ9B6J+/6G+/4ewxJg7gqj8eVYWvao1bXrqGiW2rsBZFSX3q2lcW05w==", + "cpu": [ + "arm" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/android-arm64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.19.12.tgz", + "integrity": "sha512-P0UVNGIienjZv3f5zq0DP3Nt2IE/3plFzuaS96vihvD0Hd6H/q4WXUGpCxD/E8YrSXfNyRPbpTq+T8ZQioSuPA==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/android-x64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.19.12.tgz", + "integrity": "sha512-3k7ZoUW6Q6YqhdhIaq/WZ7HwBpnFBlW905Fa4s4qWJyiNOgT1dOqDiVAQFwBH7gBRZr17gLrlFCRzF6jFh7Kew==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/darwin-arm64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.19.12.tgz", + "integrity": "sha512-B6IeSgZgtEzGC42jsI+YYu9Z3HKRxp8ZT3cqhvliEHovq8HSX2YX8lNocDn79gCKJXOSaEot9MVYky7AKjCs8g==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/darwin-x64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.19.12.tgz", + "integrity": "sha512-hKoVkKzFiToTgn+41qGhsUJXFlIjxI/jSYeZf3ugemDYZldIXIxhvwN6erJGlX4t5h417iFuheZ7l+YVn05N3A==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/freebsd-arm64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.19.12.tgz", + "integrity": "sha512-4aRvFIXmwAcDBw9AueDQ2YnGmz5L6obe5kmPT8Vd+/+x/JMVKCgdcRwH6APrbpNXsPz+K653Qg8HB/oXvXVukA==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/freebsd-x64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.19.12.tgz", + "integrity": "sha512-EYoXZ4d8xtBoVN7CEwWY2IN4ho76xjYXqSXMNccFSx2lgqOG/1TBPW0yPx1bJZk94qu3tX0fycJeeQsKovA8gg==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-arm": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.19.12.tgz", + "integrity": "sha512-J5jPms//KhSNv+LO1S1TX1UWp1ucM6N6XuL6ITdKWElCu8wXP72l9MM0zDTzzeikVyqFE6U8YAV9/tFyj0ti+w==", + "cpu": [ + "arm" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-arm64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.19.12.tgz", + "integrity": "sha512-EoTjyYyLuVPfdPLsGVVVC8a0p1BFFvtpQDB/YLEhaXyf/5bczaGeN15QkR+O4S5LeJ92Tqotve7i1jn35qwvdA==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-ia32": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.19.12.tgz", + "integrity": "sha512-Thsa42rrP1+UIGaWz47uydHSBOgTUnwBwNq59khgIwktK6x60Hivfbux9iNR0eHCHzOLjLMLfUMLCypBkZXMHA==", + "cpu": [ + "ia32" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-loong64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.19.12.tgz", + "integrity": "sha512-LiXdXA0s3IqRRjm6rV6XaWATScKAXjI4R4LoDlvO7+yQqFdlr1Bax62sRwkVvRIrwXxvtYEHHI4dm50jAXkuAA==", + "cpu": [ + "loong64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-mips64el": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.19.12.tgz", + "integrity": "sha512-fEnAuj5VGTanfJ07ff0gOA6IPsvrVHLVb6Lyd1g2/ed67oU1eFzL0r9WL7ZzscD+/N6i3dWumGE1Un4f7Amf+w==", + "cpu": [ + "mips64el" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-ppc64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.19.12.tgz", + "integrity": "sha512-nYJA2/QPimDQOh1rKWedNOe3Gfc8PabU7HT3iXWtNUbRzXS9+vgB0Fjaqr//XNbd82mCxHzik2qotuI89cfixg==", + "cpu": [ + "ppc64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-riscv64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.19.12.tgz", + "integrity": "sha512-2MueBrlPQCw5dVJJpQdUYgeqIzDQgw3QtiAHUC4RBz9FXPrskyyU3VI1hw7C0BSKB9OduwSJ79FTCqtGMWqJHg==", + "cpu": [ + "riscv64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-s390x": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.19.12.tgz", + "integrity": "sha512-+Pil1Nv3Umes4m3AZKqA2anfhJiVmNCYkPchwFJNEJN5QxmTs1uzyy4TvmDrCRNT2ApwSari7ZIgrPeUx4UZDg==", + "cpu": [ + "s390x" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-x64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.19.12.tgz", + "integrity": "sha512-B71g1QpxfwBvNrfyJdVDexenDIt1CiDN1TIXLbhOw0KhJzE78KIFGX6OJ9MrtC0oOqMWf+0xop4qEU8JrJTwCg==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/netbsd-x64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.19.12.tgz", + "integrity": "sha512-3ltjQ7n1owJgFbuC61Oj++XhtzmymoCihNFgT84UAmJnxJfm4sYCiSLTXZtE00VWYpPMYc+ZQmB6xbSdVh0JWA==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/openbsd-x64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.19.12.tgz", + "integrity": "sha512-RbrfTB9SWsr0kWmb9srfF+L933uMDdu9BIzdA7os2t0TXhCRjrQyCeOt6wVxr79CKD4c+p+YhCj31HBkYcXebw==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/sunos-x64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.19.12.tgz", + "integrity": "sha512-HKjJwRrW8uWtCQnQOz9qcU3mUZhTUQvi56Q8DPTLLB+DawoiQdjsYq+j+D3s9I8VFtDr+F9CjgXKKC4ss89IeA==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "sunos" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/win32-arm64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.19.12.tgz", + "integrity": "sha512-URgtR1dJnmGvX864pn1B2YUYNzjmXkuJOIqG2HdU62MVS4EHpU2946OZoTMnRUHklGtJdJZ33QfzdjGACXhn1A==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/win32-ia32": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.19.12.tgz", + "integrity": "sha512-+ZOE6pUkMOJfmxmBZElNOx72NKpIa/HFOMGzu8fqzQJ5kgf6aTGrcJaFsNiVMH4JKpMipyK+7k0n2UXN7a8YKQ==", + "cpu": [ + "ia32" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/win32-x64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.19.12.tgz", + "integrity": "sha512-T1QyPSDCyMXaO3pzBkF96E8xMkiRYbUEZADd29SyPGabqxMViNoii+NcK7eWJAEoU6RZyEm5lVSIjTmcdoB9HA==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, "node_modules/@eslint-community/eslint-utils": { "version": "4.4.0", "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.4.0.tgz", @@ -883,6 +1253,60 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/esbuild": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.19.12.tgz", + "integrity": "sha512-aARqgq8roFBj054KvQr5f1sFu0D65G+miZRCuJyJ0G13Zwx7vRar5Zhn2tkQNzIXcBrNVsv/8stehpj+GAjgbg==", + "dev": true, + "hasInstallScript": true, + "bin": { + "esbuild": "bin/esbuild" + }, + "engines": { + "node": ">=12" + }, + "optionalDependencies": { + "@esbuild/aix-ppc64": "0.19.12", + "@esbuild/android-arm": "0.19.12", + "@esbuild/android-arm64": "0.19.12", + "@esbuild/android-x64": "0.19.12", + "@esbuild/darwin-arm64": "0.19.12", + "@esbuild/darwin-x64": "0.19.12", + "@esbuild/freebsd-arm64": "0.19.12", + "@esbuild/freebsd-x64": "0.19.12", + "@esbuild/linux-arm": "0.19.12", + "@esbuild/linux-arm64": "0.19.12", + "@esbuild/linux-ia32": "0.19.12", + "@esbuild/linux-loong64": "0.19.12", + "@esbuild/linux-mips64el": "0.19.12", + "@esbuild/linux-ppc64": "0.19.12", + "@esbuild/linux-riscv64": "0.19.12", + "@esbuild/linux-s390x": "0.19.12", + "@esbuild/linux-x64": "0.19.12", + "@esbuild/netbsd-x64": "0.19.12", + "@esbuild/openbsd-x64": "0.19.12", + "@esbuild/sunos-x64": "0.19.12", + "@esbuild/win32-arm64": "0.19.12", + "@esbuild/win32-ia32": "0.19.12", + "@esbuild/win32-x64": "0.19.12" + } + }, + "node_modules/esbuild-node-externals": { + "version": "1.12.0", + "resolved": "https://registry.npmjs.org/esbuild-node-externals/-/esbuild-node-externals-1.12.0.tgz", + "integrity": "sha512-0rQM4N9QZwnLetzkUCOHj7Dj+YkD2IlHJIO/+3bb/AOAyDPG4D4tSTdli4QjrXRfPIffS5zAUrhxSbeyqmXhAg==", + "dev": true, + "dependencies": { + "find-up": "^5.0.0", + "tslib": "^2.4.1" + }, + "engines": { + "node": ">=12" + }, + "peerDependencies": { + "esbuild": "0.12 - 0.19" + } + }, "node_modules/escape-string-regexp": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", @@ -2875,6 +3299,12 @@ "strip-bom": "^3.0.0" } }, + "node_modules/tslib": { + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz", + "integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==", + "dev": true + }, "node_modules/type-check": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", @@ -3101,6 +3531,167 @@ "integrity": "sha512-1Yjs2SvM8TflER/OD3cOjhWWOZb58A2t7wpE2S9XfBYTiIl+XFhQG2bjy4Pu1I+EAlCNUzRDYDdFwFYUKvXcIA==", "dev": true }, + "@esbuild/aix-ppc64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.19.12.tgz", + "integrity": "sha512-bmoCYyWdEL3wDQIVbcyzRyeKLgk2WtWLTWz1ZIAZF/EGbNOwSA6ew3PftJ1PqMiOOGu0OyFMzG53L0zqIpPeNA==", + "dev": true, + "optional": true + }, + "@esbuild/android-arm": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.19.12.tgz", + "integrity": "sha512-qg/Lj1mu3CdQlDEEiWrlC4eaPZ1KztwGJ9B6J+/6G+/4ewxJg7gqj8eVYWvao1bXrqGiW2rsBZFSX3q2lcW05w==", + "dev": true, + "optional": true + }, + "@esbuild/android-arm64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.19.12.tgz", + "integrity": "sha512-P0UVNGIienjZv3f5zq0DP3Nt2IE/3plFzuaS96vihvD0Hd6H/q4WXUGpCxD/E8YrSXfNyRPbpTq+T8ZQioSuPA==", + "dev": true, + "optional": true + }, + "@esbuild/android-x64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.19.12.tgz", + "integrity": "sha512-3k7ZoUW6Q6YqhdhIaq/WZ7HwBpnFBlW905Fa4s4qWJyiNOgT1dOqDiVAQFwBH7gBRZr17gLrlFCRzF6jFh7Kew==", + "dev": true, + "optional": true + }, + "@esbuild/darwin-arm64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.19.12.tgz", + "integrity": "sha512-B6IeSgZgtEzGC42jsI+YYu9Z3HKRxp8ZT3cqhvliEHovq8HSX2YX8lNocDn79gCKJXOSaEot9MVYky7AKjCs8g==", + "dev": true, + "optional": true + }, + "@esbuild/darwin-x64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.19.12.tgz", + "integrity": "sha512-hKoVkKzFiToTgn+41qGhsUJXFlIjxI/jSYeZf3ugemDYZldIXIxhvwN6erJGlX4t5h417iFuheZ7l+YVn05N3A==", + "dev": true, + "optional": true + }, + "@esbuild/freebsd-arm64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.19.12.tgz", + "integrity": "sha512-4aRvFIXmwAcDBw9AueDQ2YnGmz5L6obe5kmPT8Vd+/+x/JMVKCgdcRwH6APrbpNXsPz+K653Qg8HB/oXvXVukA==", + "dev": true, + "optional": true + }, + "@esbuild/freebsd-x64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.19.12.tgz", + "integrity": "sha512-EYoXZ4d8xtBoVN7CEwWY2IN4ho76xjYXqSXMNccFSx2lgqOG/1TBPW0yPx1bJZk94qu3tX0fycJeeQsKovA8gg==", + "dev": true, + "optional": true + }, + "@esbuild/linux-arm": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.19.12.tgz", + "integrity": "sha512-J5jPms//KhSNv+LO1S1TX1UWp1ucM6N6XuL6ITdKWElCu8wXP72l9MM0zDTzzeikVyqFE6U8YAV9/tFyj0ti+w==", + "dev": true, + "optional": true + }, + "@esbuild/linux-arm64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.19.12.tgz", + "integrity": "sha512-EoTjyYyLuVPfdPLsGVVVC8a0p1BFFvtpQDB/YLEhaXyf/5bczaGeN15QkR+O4S5LeJ92Tqotve7i1jn35qwvdA==", + "dev": true, + "optional": true + }, + "@esbuild/linux-ia32": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.19.12.tgz", + "integrity": "sha512-Thsa42rrP1+UIGaWz47uydHSBOgTUnwBwNq59khgIwktK6x60Hivfbux9iNR0eHCHzOLjLMLfUMLCypBkZXMHA==", + "dev": true, + "optional": true + }, + "@esbuild/linux-loong64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.19.12.tgz", + "integrity": "sha512-LiXdXA0s3IqRRjm6rV6XaWATScKAXjI4R4LoDlvO7+yQqFdlr1Bax62sRwkVvRIrwXxvtYEHHI4dm50jAXkuAA==", + "dev": true, + "optional": true + }, + "@esbuild/linux-mips64el": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.19.12.tgz", + "integrity": "sha512-fEnAuj5VGTanfJ07ff0gOA6IPsvrVHLVb6Lyd1g2/ed67oU1eFzL0r9WL7ZzscD+/N6i3dWumGE1Un4f7Amf+w==", + "dev": true, + "optional": true + }, + "@esbuild/linux-ppc64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.19.12.tgz", + "integrity": "sha512-nYJA2/QPimDQOh1rKWedNOe3Gfc8PabU7HT3iXWtNUbRzXS9+vgB0Fjaqr//XNbd82mCxHzik2qotuI89cfixg==", + "dev": true, + "optional": true + }, + "@esbuild/linux-riscv64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.19.12.tgz", + "integrity": "sha512-2MueBrlPQCw5dVJJpQdUYgeqIzDQgw3QtiAHUC4RBz9FXPrskyyU3VI1hw7C0BSKB9OduwSJ79FTCqtGMWqJHg==", + "dev": true, + "optional": true + }, + "@esbuild/linux-s390x": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.19.12.tgz", + "integrity": "sha512-+Pil1Nv3Umes4m3AZKqA2anfhJiVmNCYkPchwFJNEJN5QxmTs1uzyy4TvmDrCRNT2ApwSari7ZIgrPeUx4UZDg==", + "dev": true, + "optional": true + }, + "@esbuild/linux-x64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.19.12.tgz", + "integrity": "sha512-B71g1QpxfwBvNrfyJdVDexenDIt1CiDN1TIXLbhOw0KhJzE78KIFGX6OJ9MrtC0oOqMWf+0xop4qEU8JrJTwCg==", + "dev": true, + "optional": true + }, + "@esbuild/netbsd-x64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.19.12.tgz", + "integrity": "sha512-3ltjQ7n1owJgFbuC61Oj++XhtzmymoCihNFgT84UAmJnxJfm4sYCiSLTXZtE00VWYpPMYc+ZQmB6xbSdVh0JWA==", + "dev": true, + "optional": true + }, + "@esbuild/openbsd-x64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.19.12.tgz", + "integrity": "sha512-RbrfTB9SWsr0kWmb9srfF+L933uMDdu9BIzdA7os2t0TXhCRjrQyCeOt6wVxr79CKD4c+p+YhCj31HBkYcXebw==", + "dev": true, + "optional": true + }, + "@esbuild/sunos-x64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.19.12.tgz", + "integrity": "sha512-HKjJwRrW8uWtCQnQOz9qcU3mUZhTUQvi56Q8DPTLLB+DawoiQdjsYq+j+D3s9I8VFtDr+F9CjgXKKC4ss89IeA==", + "dev": true, + "optional": true + }, + "@esbuild/win32-arm64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.19.12.tgz", + "integrity": "sha512-URgtR1dJnmGvX864pn1B2YUYNzjmXkuJOIqG2HdU62MVS4EHpU2946OZoTMnRUHklGtJdJZ33QfzdjGACXhn1A==", + "dev": true, + "optional": true + }, + "@esbuild/win32-ia32": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.19.12.tgz", + "integrity": "sha512-+ZOE6pUkMOJfmxmBZElNOx72NKpIa/HFOMGzu8fqzQJ5kgf6aTGrcJaFsNiVMH4JKpMipyK+7k0n2UXN7a8YKQ==", + "dev": true, + "optional": true + }, + "@esbuild/win32-x64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.19.12.tgz", + "integrity": "sha512-T1QyPSDCyMXaO3pzBkF96E8xMkiRYbUEZADd29SyPGabqxMViNoii+NcK7eWJAEoU6RZyEm5lVSIjTmcdoB9HA==", + "dev": true, + "optional": true + }, "@eslint-community/eslint-utils": { "version": "4.4.0", "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.4.0.tgz", @@ -3716,6 +4307,47 @@ "is-symbol": "^1.0.2" } }, + "esbuild": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.19.12.tgz", + "integrity": "sha512-aARqgq8roFBj054KvQr5f1sFu0D65G+miZRCuJyJ0G13Zwx7vRar5Zhn2tkQNzIXcBrNVsv/8stehpj+GAjgbg==", + "dev": true, + "requires": { + "@esbuild/aix-ppc64": "0.19.12", + "@esbuild/android-arm": "0.19.12", + "@esbuild/android-arm64": "0.19.12", + "@esbuild/android-x64": "0.19.12", + "@esbuild/darwin-arm64": "0.19.12", + "@esbuild/darwin-x64": "0.19.12", + "@esbuild/freebsd-arm64": "0.19.12", + "@esbuild/freebsd-x64": "0.19.12", + "@esbuild/linux-arm": "0.19.12", + "@esbuild/linux-arm64": "0.19.12", + "@esbuild/linux-ia32": "0.19.12", + "@esbuild/linux-loong64": "0.19.12", + "@esbuild/linux-mips64el": "0.19.12", + "@esbuild/linux-ppc64": "0.19.12", + "@esbuild/linux-riscv64": "0.19.12", + "@esbuild/linux-s390x": "0.19.12", + "@esbuild/linux-x64": "0.19.12", + "@esbuild/netbsd-x64": "0.19.12", + "@esbuild/openbsd-x64": "0.19.12", + "@esbuild/sunos-x64": "0.19.12", + "@esbuild/win32-arm64": "0.19.12", + "@esbuild/win32-ia32": "0.19.12", + "@esbuild/win32-x64": "0.19.12" + } + }, + "esbuild-node-externals": { + "version": "1.12.0", + "resolved": "https://registry.npmjs.org/esbuild-node-externals/-/esbuild-node-externals-1.12.0.tgz", + "integrity": "sha512-0rQM4N9QZwnLetzkUCOHj7Dj+YkD2IlHJIO/+3bb/AOAyDPG4D4tSTdli4QjrXRfPIffS5zAUrhxSbeyqmXhAg==", + "dev": true, + "requires": { + "find-up": "^5.0.0", + "tslib": "^2.4.1" + } + }, "escape-string-regexp": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", @@ -5137,6 +5769,12 @@ "strip-bom": "^3.0.0" } }, + "tslib": { + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz", + "integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==", + "dev": true + }, "type-check": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", diff --git a/package.json b/package.json index 281c7d4..fe4fdea 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,9 @@ "description": "Query for the status of any game server in Node.JS", "scripts": { "lint:check": "eslint .", - "lint:fix": "eslint --fix ." + "lint:fix": "eslint --fix .", + "prepare": "npm run build", + "build": "node tools/esbuild.js" }, "keywords": [ "srcds", @@ -25,7 +27,10 @@ "minecraft" ], "type": "module", - "main": "lib/index.js", + "exports": { + "import": "./lib/index.js", + "require": "./dist/index.cjs" + }, "author": "GameDig Contributors", "version": "5.0.0-beta.0", "repository": { @@ -65,6 +70,8 @@ "devDependencies": { "@types/cheerio": "^0.22.31", "@types/node": "^16.18.58", + "esbuild": "^0.19.10", + "esbuild-node-externals": "^1.12.0", "eslint": "^8.49.0", "eslint-config-standard": "^17.1.0", "eslint-plugin-import": "^2.28.1", diff --git a/tools/esbuild.js b/tools/esbuild.js new file mode 100644 index 0000000..38d8a6c --- /dev/null +++ b/tools/esbuild.js @@ -0,0 +1,15 @@ +import { build } from 'esbuild' +import { nodeExternalsPlugin } from 'esbuild-node-externals' + +const buildConfig = { + entryPoints: ['lib/index.js'], + platform: 'node', + target: 'node16', + bundle: true, + outfile: 'dist/index.cjs', + format: 'cjs', + // got is a esm module, so we need to add it to the allowList, to include it in the bundle. + plugins: [nodeExternalsPlugin({ allowList: ['got'] })] +} + +build(buildConfig).then(() => { }).catch(() => { process.exit(1) }) From d737304f14d70f1869cfe83216ea2815610449a3 Mon Sep 17 00:00:00 2001 From: CosminPerRam Date: Mon, 29 Jan 2024 23:18:31 +0200 Subject: [PATCH 32/43] chore: modify the readme to mention commonjs --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index b14fc2b..4224ec4 100644 --- a/README.md +++ b/README.md @@ -19,6 +19,8 @@ See the [GAMES_LIST.md](GAMES_LIST.md) file for the currently supported titles, Install using your favorite package manager: `npm install gamedig`, then use! ```js import { GameDig } from 'gamedig'; +// Or if you're using CommonJS: +// const { GameDig } = require('gamedig'); GameDig.query({ type: 'minecraft', From 453bafa3def97e49328486ac4c2aaef5acb89f01 Mon Sep 17 00:00:00 2001 From: Pedro Ivo Hudson Date: Mon, 29 Jan 2024 18:32:40 -0300 Subject: [PATCH 33/43] chore: Add EOS notes on Palworld and The Isle Evrima (#522) * add EOS protocols notes * add protocol options --- GAMES_LIST.md | 4 ++-- tools/generate_games_list.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/GAMES_LIST.md b/GAMES_LIST.md index 781298c..430276c 100644 --- a/GAMES_LIST.md +++ b/GAMES_LIST.md @@ -205,7 +205,7 @@ | openarena | OpenArena | | | openttd | OpenTTD | | | painkiller | Painkiller | | -| palworld | Palworld | | +| palworld | Palworld | [EOS Protocol](#epic) | | pce | Primal Carnage: Extinction | [Valve Protocol](#valve) | | pixark | PixARK | [Valve Protocol](#valve) | | postal2 | Postal 2 | | @@ -289,7 +289,7 @@ | thefront | The Front | [Valve Protocol](#valve) | | thehidden | The Hidden | [Valve Protocol](#valve) | | theisle | The Isle | [Valve Protocol](#valve) | -| tie | The Isle Evrima | | +| tie | The Isle Evrima | [EOS Protocol](#epic) | | theship | The Ship | [Valve Protocol](#valve) | | thespecialists | The Specialists | [Valve Protocol](#valve) | | thps3 | Tony Hawk's Pro Skater 3 | | diff --git a/tools/generate_games_list.js b/tools/generate_games_list.js index a5cdd45..d0c6146 100644 --- a/tools/generate_games_list.js +++ b/tools/generate_games_list.js @@ -34,7 +34,7 @@ for (const id in sortedGames) { if (game.options.protocol === 'valve' || game.options.protocol === 'dayz') { notes.push('[Valve Protocol](#valve)') } - if (game.options.protocol === 'epic' || game.options.protocol === 'asa') { + if (game.options.protocol === 'epic' || game.options.protocol === 'asa' || game.options.protocol === 'palworld' || game.options.protocol === 'theisleevrima') { notes.push('[EOS Protocol](#epic)') } if (notes.length) { From 3b6c8dfcfb83ab011c5daab830960265cb3b92a0 Mon Sep 17 00:00:00 2001 From: CosminPerRam Date: Tue, 30 Jan 2024 00:15:21 +0200 Subject: [PATCH 34/43] feat: release version 5.0.0-beta.1 --- CHANGELOG.md | 3 +++ package.json | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c7a12cb..ad613b1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,8 @@ ## To Be Released... +## 5.0.0-beta.2 +* *Soon to come!* + ## 5.0.0-beta.1 * Fixed numplayers on Palworld not beeing accurate * Enshrouded - Added support (By @GuilhermeWerner #512). diff --git a/package.json b/package.json index fe4fdea..651fdd3 100644 --- a/package.json +++ b/package.json @@ -32,7 +32,7 @@ "require": "./dist/index.cjs" }, "author": "GameDig Contributors", - "version": "5.0.0-beta.0", + "version": "5.0.0-beta.1", "repository": { "type": "git", "url": "https://github.com/gamedig/node-gamedig.git" From ab3ff936a78196b929e7457f96c8e9dc54a7d049 Mon Sep 17 00:00:00 2001 From: CosminPerRam Date: Tue, 30 Jan 2024 00:23:40 +0200 Subject: [PATCH 35/43] feat: release version 5.0.0-beta.2 --- CHANGELOG.md | 2 +- package.json | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ad613b1..8245ddc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,6 @@ ## To Be Released... -## 5.0.0-beta.2 +## 5.0.0-beta.2 / 5.0.0-beta.3 * *Soon to come!* ## 5.0.0-beta.1 diff --git a/package.json b/package.json index 651fdd3..fd41247 100644 --- a/package.json +++ b/package.json @@ -32,7 +32,7 @@ "require": "./dist/index.cjs" }, "author": "GameDig Contributors", - "version": "5.0.0-beta.1", + "version": "5.0.0-beta.2", "repository": { "type": "git", "url": "https://github.com/gamedig/node-gamedig.git" @@ -48,6 +48,7 @@ "gamedig": "bin/gamedig.js" }, "files": [ + "dist/index.cjs", "bin/gamedig.js", "lib/", "protocols/", From 5fea103cd3c7118eed32c9c249ba86ea9c41250d Mon Sep 17 00:00:00 2001 From: CosminPerRam Date: Tue, 30 Jan 2024 00:26:04 +0200 Subject: [PATCH 36/43] chore: update changelog to better represent 5.0.0-beta.2 changes --- CHANGELOG.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8245ddc..8dea9f7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,8 +1,11 @@ ## To Be Released... -## 5.0.0-beta.2 / 5.0.0-beta.3 +## 5.0.0-beta.3 * *Soon to come!* +## 5.0.0-beta.2 +* Fixed support for projects using `require`. + ## 5.0.0-beta.1 * Fixed numplayers on Palworld not beeing accurate * Enshrouded - Added support (By @GuilhermeWerner #512). From e4d59a9f893b766765de28336b26a253a7313113 Mon Sep 17 00:00:00 2001 From: Pedro Ivo Hudson Date: Wed, 31 Jan 2024 11:01:17 -0300 Subject: [PATCH 37/43] feat: add Euro Truck Simulator 2 support (#523) * feat: add Euro Truck Simulator 2 support * Update CHANGELOG.md --- CHANGELOG.md | 2 +- GAMES_LIST.md | 1 + lib/games.js | 9 +++++++++ 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8dea9f7..92f17af 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,7 @@ ## To Be Released... ## 5.0.0-beta.3 -* *Soon to come!* +* Euro Truck Simulator 2 (2012) - Added support (By @podrivo #523) ## 5.0.0-beta.2 * Fixed support for projects using `require`. diff --git a/GAMES_LIST.md b/GAMES_LIST.md index 430276c..4753f04 100644 --- a/GAMES_LIST.md +++ b/GAMES_LIST.md @@ -117,6 +117,7 @@ | empiresmod | Empires Mod | [Valve Protocol](#valve) | | enshrouded | Enshrouded | [Valve Protocol](#valve) | | etqw | Enemy Territory: Quake Wars | | +| ets2 | Euro Truck Simulator 2 | [Valve Protocol](#valve) | | f1c9902 | F1 Challenge '99-'02 | | | farcry | Far Cry | | | farcry2 | Far Cry 2 | | diff --git a/lib/games.js b/lib/games.js index 8b3f554..ea9ada3 100644 --- a/lib/games.js +++ b/lib/games.js @@ -1125,6 +1125,15 @@ export const games = { protocol: 'doom3' } }, + ets2: { + name: 'Euro Truck Simulator 2', + release_year: 2012, + options: { + port: 27015, + port_query_offset: 1, + protocol: 'valve' + } + }, fear: { name: 'F.E.A.R.', release_year: 2005, From b2de68f551f491cc96f865652c6683d049453f6f Mon Sep 17 00:00:00 2001 From: Vito0912 <86927734+Vito0912@users.noreply.github.com> Date: Wed, 31 Jan 2024 19:29:02 +0100 Subject: [PATCH 38/43] fix: Updated the eco protocol to include player names and fix problems encountered when using the eco web interface behind a proxy. (#526) * Update eco protocol to include player names and fixed problems when using eco webinterface behind a proxy * changelog + readability * Typo * Typo --- CHANGELOG.md | 1 + protocols/eco.js | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 92f17af..a857544 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ ## To Be Released... ## 5.0.0-beta.3 * Euro Truck Simulator 2 (2012) - Added support (By @podrivo #523) +* Eco - Added support for Eco servers that require connection from a domain (By @Vito0912) ## 5.0.0-beta.2 * Fixed support for projects using `require`. diff --git a/protocols/eco.js b/protocols/eco.js index 714b86c..c3c3854 100644 --- a/protocols/eco.js +++ b/protocols/eco.js @@ -5,16 +5,17 @@ export default class eco extends Core { if (!this.options.port) this.options.port = 3001 const request = await this.request({ - url: `http://${this.options.address}:${this.options.port}/frontpage`, + url: `http://${this.options.host}:${this.options.port}/frontpage`, responseType: 'json' }) const serverInfo = request.Info state.name = serverInfo.Description - state.numplayers = serverInfo.OnlinePlayers; + state.numplayers = serverInfo.OnlinePlayers state.maxplayers = serverInfo.TotalPlayers state.password = serverInfo.HasPassword state.gamePort = serverInfo.GamePort + state.players = serverInfo.OnlinePlayersNames?.map(name => ({ name, raw: {} })) || [] state.raw = serverInfo } } From 3416e8c21ac924d09bf4e4994d90e4283dd801c5 Mon Sep 17 00:00:00 2001 From: CosminPerRam Date: Wed, 31 Jan 2024 20:30:56 +0200 Subject: [PATCH 39/43] docs: Update #526 changelog line to better represent it --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a857544..996b8c5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,7 @@ ## To Be Released... ## 5.0.0-beta.3 * Euro Truck Simulator 2 (2012) - Added support (By @podrivo #523) -* Eco - Added support for Eco servers that require connection from a domain (By @Vito0912) +* Eco - Fixed querying servers using reverse queries and player names (By @Vito0912 #526) ## 5.0.0-beta.2 * Fixed support for projects using `require`. From 2338b82307719f92566170671e9e4ba453d061b0 Mon Sep 17 00:00:00 2001 From: Vito0912 <86927734+Vito0912@users.noreply.github.com> Date: Wed, 31 Jan 2024 22:38:17 +0100 Subject: [PATCH 40/43] feat: Add Factorio support (#527) * Update eco protocol to include player names and fixed problems when using eco webinterface behind a proxy * changelog + readability * Typo * Typo * Added Factorio * wrong comment * CHANGELOG --- CHANGELOG.md | 1 + GAMES_LIST.md | 1 + lib/games.js | 8 ++++++++ protocols/factorio.js | 25 +++++++++++++++++++++++++ protocols/index.js | 3 ++- 5 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 protocols/factorio.js diff --git a/CHANGELOG.md b/CHANGELOG.md index 996b8c5..80b4497 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ ## 5.0.0-beta.3 * Euro Truck Simulator 2 (2012) - Added support (By @podrivo #523) * Eco - Fixed querying servers using reverse queries and player names (By @Vito0912 #526) +* Factorio (2016) - Added support (By @Vito0912 #527) ## 5.0.0-beta.2 * Fixed support for projects using `require`. diff --git a/GAMES_LIST.md b/GAMES_LIST.md index 4753f04..2341254 100644 --- a/GAMES_LIST.md +++ b/GAMES_LIST.md @@ -119,6 +119,7 @@ | etqw | Enemy Territory: Quake Wars | | | ets2 | Euro Truck Simulator 2 | [Valve Protocol](#valve) | | f1c9902 | F1 Challenge '99-'02 | | +| factorio | Factorio | | | farcry | Far Cry | | | farcry2 | Far Cry 2 | | | fear | F.E.A.R. | | diff --git a/lib/games.js b/lib/games.js index ea9ada3..ecfc851 100644 --- a/lib/games.js +++ b/lib/games.js @@ -1161,6 +1161,14 @@ export const games = { protocol: 'gamespy1' } }, + factorio: { + name: 'Factorio', + release_year: 2016, + options: { + port_query: 34197, + protocol: 'factorio' + } + }, farcry: { name: 'Far Cry', release_year: 2004, diff --git a/protocols/factorio.js b/protocols/factorio.js new file mode 100644 index 0000000..1109409 --- /dev/null +++ b/protocols/factorio.js @@ -0,0 +1,25 @@ +import Core from './core.js' + +export default class factorio extends Core { + async run (state) { + if (!this.options.port) this.options.port = 34197 + + // Don't use the tcp ping probing + this.usedTcp = true + + const request = await this.request({ + url: `https://multiplayer.factorio.com/get-game-details/${this.options.address}:${this.options.port}`, + responseType: 'json' + }) + + const serverInfo = request + + state.name = serverInfo.name + state.password = serverInfo.has_password + state.numplayers = serverInfo.players?.length || 0 // players is undefined if there are no players + state.maxplayers = serverInfo.max_players + state.players = serverInfo.players?.map(player => ({ name: player, raw: {} })) || [] + + state.raw = serverInfo + } +} diff --git a/protocols/index.js b/protocols/index.js index 2cf657d..cb74dcb 100644 --- a/protocols/index.js +++ b/protocols/index.js @@ -10,6 +10,7 @@ import doom3 from './doom3.js' import eco from './eco.js' import eldewrito from './eldewrito.js' import epic from './epic.js' +import factorio from './factorio.js' import ffow from './ffow.js' import fivem from './fivem.js' import gamespy1 from './gamespy1.js' @@ -55,7 +56,7 @@ import dayz from './dayz.js' import theisleevrima from './theisleevrima.js' export { - armagetron, ase, asa, assettocorsa, battlefield, buildandshoot, cs2d, discord, doom3, eco, epic, ffow, fivem, gamespy1, + armagetron, ase, asa, assettocorsa, battlefield, buildandshoot, cs2d, discord, doom3, eco, epic, factorio, ffow, fivem, gamespy1, gamespy2, gamespy3, geneshift, goldsrc, hexen2, jc2mp, kspdmp, mafia2mp, mafia2online, minecraft, minecraftbedrock, minecraftvanilla, mumble, mumbleping, nadeo, openttd, palworld, quake1, quake2, quake3, rfactor, samp, savage2, starmade, starsiege, teamspeak2, teamspeak3, terraria, tribes1, tribes1master, unreal2, ut3, valve, From ce9a1b0fecfb29bd2f6d5a7c6e9e7eba06ba2b09 Mon Sep 17 00:00:00 2001 From: CosminPerRam Date: Wed, 31 Jan 2024 23:45:44 +0200 Subject: [PATCH 41/43] feat: simplify factorio protocol cod a bit --- protocols/factorio.js | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/protocols/factorio.js b/protocols/factorio.js index 1109409..e1ebd7d 100644 --- a/protocols/factorio.js +++ b/protocols/factorio.js @@ -3,23 +3,21 @@ import Core from './core.js' export default class factorio extends Core { async run (state) { if (!this.options.port) this.options.port = 34197 - - // Don't use the tcp ping probing this.usedTcp = true - const request = await this.request({ - url: `https://multiplayer.factorio.com/get-game-details/${this.options.address}:${this.options.port}`, - responseType: 'json' - }) + const serverInfo = await this.request({ + url: `https://multiplayer.factorio.com/get-game-details/${this.options.address}:${this.options.port}`, + responseType: 'json' + }) - const serverInfo = request + const players = serverInfo.players || [] // the 'players' field is undefined if there are no players state.name = serverInfo.name state.password = serverInfo.has_password - state.numplayers = serverInfo.players?.length || 0 // players is undefined if there are no players + state.numplayers = players.length state.maxplayers = serverInfo.max_players - state.players = serverInfo.players?.map(player => ({ name: player, raw: {} })) || [] - + state.players = players.map(player => ({ name: player, raw: {} })) + state.raw = serverInfo } } From 321f35999ec470ce1fccec85978281c8f0a83e46 Mon Sep 17 00:00:00 2001 From: CosminPerRam Date: Thu, 1 Feb 2024 22:31:32 +0200 Subject: [PATCH 42/43] docs: update the unsupported games list by removing a bunch --- GAMES_LIST.md | 21 ++------------------- 1 file changed, 2 insertions(+), 19 deletions(-) diff --git a/GAMES_LIST.md b/GAMES_LIST.md index 2341254..fb5e1d5 100644 --- a/GAMES_LIST.md +++ b/GAMES_LIST.md @@ -341,17 +341,12 @@ * Assault Cube * Cube 2: Sauerbraten * Blood Frontier -* Alien vs Predator -* Armed Assault 2: Operation Arrowhead -* Battlefield Bad Company 2: Vietnam * BFRIS * Call of Duty: Black Ops 1 and 2 (no documentation, may require rcon) * Crysis Warhead -* Days of War * DirtyBomb * Doom - Skulltag * Doom - ZDaemon -* ECO Global Survival ([Ref](https://github.com/Austinb/GameQ/blob/v3/src/GameQ/Protocols/Eco.php)) * Farming Simulator * Freelancer * Ghost Recon @@ -378,10 +373,8 @@ * Tibia ([Ref](https://github.com/Austinb/GameQ/blob/v3/src/GameQ/Protocols/Tibia.php)) * Titanfall * Tribes 2 -* Unreal 2 XMP * World in Conflict * World Opponent Network -* Wurm Unlimited > Want support for one of these games? Please open an issue to show your interest! > __Know how to code?__ Protocol details for many of the games above are documented @@ -391,18 +384,8 @@ > Don't see your game listed here? > > First, let us know, so we can fix it. Then, you can try using some common query -> protocols directly by using one of these server types: -> * protocol-ase -> * protocol-battlefield -> * protocol-doom3 -> * protocol-gamespy1 -> * protocol-gamespy2 -> * protocol-gamespy3 -> * protocol-nadeo -> * protocol-quake2 -> * protocol-quake3 -> * protocol-unreal2 -> * protocol-valve +> protocols directly from the [protocols folder](/protocols). We also have a little tool +> that could come in handy, [attempt protocols](/tools/attempt_protocols.js) Games with Additional Notes --- From 3a17184862e8de56832f6ca441832f793b6e325a Mon Sep 17 00:00:00 2001 From: Vito0912 <86927734+Vito0912@users.noreply.github.com> Date: Mon, 5 Feb 2024 16:29:01 +0100 Subject: [PATCH 43/43] feat: Add Farming Simulator 22/19 (#531) * Added token paramter * Added Farming Simulator 2022 * Fixed order * Undo debug line * Update Farming Simulator 22 support (By @Vito0912 #531) * Added Farming Simulator 2019 support * Revert change * Update release year for Farming Simulator 2019 * Update mods array to raw.mods in farmingsimulator.js * Update Farming Simulator naming in GAMES_LIST.md * Missed some names * Add server version to state.raw and eslint --- CHANGELOG.md | 2 ++ GAMES_LIST.md | 7 ++++- bin/gamedig.js | 2 +- lib/games.js | 16 ++++++++++ protocols/farmingsimulator.js | 55 +++++++++++++++++++++++++++++++++++ protocols/index.js | 5 ++-- 6 files changed, 83 insertions(+), 4 deletions(-) create mode 100644 protocols/farmingsimulator.js diff --git a/CHANGELOG.md b/CHANGELOG.md index 80b4497..d75a350 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,8 @@ * Euro Truck Simulator 2 (2012) - Added support (By @podrivo #523) * Eco - Fixed querying servers using reverse queries and player names (By @Vito0912 #526) * Factorio (2016) - Added support (By @Vito0912 #527) +* Farming Simulator 22 (2021) - Added support (By @Vito0912 #531) +* Farming Simulator 19 (2018) - Added support (By @Vito0912 #531) ## 5.0.0-beta.2 * Fixed support for projects using `require`. diff --git a/GAMES_LIST.md b/GAMES_LIST.md index fb5e1d5..26ee8e4 100644 --- a/GAMES_LIST.md +++ b/GAMES_LIST.md @@ -122,6 +122,8 @@ | factorio | Factorio | | | farcry | Far Cry | | | farcry2 | Far Cry 2 | | +| farmingsimulator19 | Farming Simulator 19 | [Notes](#farmingsimulator) | +| farmingsimulator22 | Farming Simulator 22 | [Notes](#farmingsimulator) | | fear | F.E.A.R. | | | ffow | Frontlines: Fuel of War | | | fof | Fistful of Frags | [Valve Protocol](#valve) | @@ -347,7 +349,6 @@ * DirtyBomb * Doom - Skulltag * Doom - ZDaemon -* Farming Simulator * Freelancer * Ghost Recon * GRAV Online @@ -443,6 +444,10 @@ Conan Exiles never responds to player query. ### Minecraft Many Minecraft servers do not respond with players data. +### Farming Simulator +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. + Protocols with Additional Notes --- diff --git a/bin/gamedig.js b/bin/gamedig.js index 8609d95..077d8fd 100644 --- a/bin/gamedig.js +++ b/bin/gamedig.js @@ -7,7 +7,7 @@ import { GameDig } from './../lib/index.js' const argv = Minimist(process.argv.slice(2), { boolean: ['pretty', 'debug', 'givenPortOnly', 'requestRules', 'requestRulesRequired', 'requestPlayersRequired', 'stripColors', 'portCache', 'noBreadthOrder', 'checkOldIDs'], - string: ['guildId', 'listenUdpPort', 'ipFamily'], + string: ['guildId', 'listenUdpPort', 'ipFamily', 'token'], default: { stripColors: true, portCache: true diff --git a/lib/games.js b/lib/games.js index ecfc851..97a3436 100644 --- a/lib/games.js +++ b/lib/games.js @@ -1186,6 +1186,22 @@ export const games = { protocol: 'ase' } }, + farmingsimulator19: { + name: 'Farming Simulator 19', + release_year: 2018, + options: { + port: 8080, + protocol: 'farmingsimulator' + } + }, + farmingsimulator22: { + name: 'Farming Simulator 22', + release_year: 2021, + options: { + port: 8080, + protocol: 'farmingsimulator' + } + }, fof: { name: 'Fistful of Frags', release_year: 2014, diff --git a/protocols/farmingsimulator.js b/protocols/farmingsimulator.js new file mode 100644 index 0000000..7a51846 --- /dev/null +++ b/protocols/farmingsimulator.js @@ -0,0 +1,55 @@ +import Core from './core.js' +import cheerio from 'cheerio' + +export default class farmingsimulator extends Core { + async run (state) { + if (!this.options.port) this.options.port = 8080 + if (!this.options.token) throw new Error(`No token provided. You can get it from http://${this.options.host}:${this.options.port}/settings.html`) + + const request = await this.request({ + url: `http://${this.options.host}:${this.options.port}/feed/dedicated-server-stats.xml?code=${this.options.token}`, + responseType: 'text' + }) + + const $ = cheerio.load(request, { + xmlMode: true + }) + + const serverInfo = $('Server') + const playerInfo = serverInfo.find('Slots') + + state.name = serverInfo.attr('name') + state.map = serverInfo.attr('mapName') + state.numplayers = playerInfo.attr('numUsed') + state.maxplayers = playerInfo.attr('capacity') + + $('Player').each(function () { + if ($(this).attr('isUsed') === 'true') { + state.players.push({ + name: $(this).text(), + raw: { + isAdmin: $(this).attr('isAdmin') === 'true', + uptime: parseInt($(this).attr('uptime'), 10) + } + }) + } + }) + + state.raw.mods = [] + $('Mod').each(function () { + if ($(this).attr('name') !== undefined) { + state.raw.mods.push({ + name: $(this).text(), + short_name: $(this).attr('name'), + author: $(this).attr('author'), + version: $(this).attr('version'), + hash: $(this).attr('hash') + }) + } + }) + + state.raw.version = serverInfo.attr('version') + + // TODO: Add state.raw + } +} diff --git a/protocols/index.js b/protocols/index.js index cb74dcb..8156718 100644 --- a/protocols/index.js +++ b/protocols/index.js @@ -11,6 +11,7 @@ import eco from './eco.js' import eldewrito from './eldewrito.js' import epic from './epic.js' import factorio from './factorio.js' +import farmingsimulator from './farmingsimulator.js' import ffow from './ffow.js' import fivem from './fivem.js' import gamespy1 from './gamespy1.js' @@ -56,8 +57,8 @@ import dayz from './dayz.js' import theisleevrima from './theisleevrima.js' export { - armagetron, ase, asa, assettocorsa, battlefield, buildandshoot, cs2d, discord, doom3, eco, epic, factorio, ffow, fivem, gamespy1, - gamespy2, gamespy3, geneshift, goldsrc, hexen2, jc2mp, kspdmp, mafia2mp, mafia2online, minecraft, + armagetron, ase, asa, assettocorsa, battlefield, buildandshoot, cs2d, discord, doom3, eco, epic, factorio, farmingsimulator, ffow, + fivem, gamespy1, gamespy2, gamespy3, geneshift, goldsrc, hexen2, jc2mp, kspdmp, mafia2mp, mafia2online, minecraft, minecraftbedrock, minecraftvanilla, mumble, mumbleping, nadeo, openttd, palworld, quake1, quake2, quake3, rfactor, samp, savage2, starmade, starsiege, teamspeak2, teamspeak3, terraria, tribes1, tribes1master, unreal2, ut3, valve, vcmp, ventrilo, warsow, eldewrito, beammpmaster, beammp, dayz, theisleevrima