Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

gamedig

gamedig138.8kMIT5.2.0TypeScript support: definitely-typed

Query for the status of any game server in Node.JS

srcds, query, game, utility, util, server, gameserver, game-server-query, game server query, server query, game server, gameserverquery, serverquery, terraria, counter strike, csgo, minecraft

readme

node-GameDig - Game Server Query Library

npmjs.com Node deno compatibility Bun

node-GameDig is a game server query Node.js module (as well as a command line executable), capable of querying for the status of nearly any game or voice server.

If a server makes its status publicly available, GameDig can fetch it for you.

Support is available on the Discord for questions, or GitHub for bugs.

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 and don't forget to check the changelog file.

Games List

node-GameDig can query over 320 games + a few services!
See the GAMES_LIST.md file for the currently supported titles, not yet supported titles and notes about some of them.

Usage from Node.js

Install using your favorite package manager: npm install gamedig, then use!
Tip: Do you want to try and use the latest features? Install GameDig from this repository via npm i git+https://github.com/gamedig/node-gamedig!

import { GameDig } from 'gamedig';
// Or if you're using CommonJS:
// const { GameDig } = require('gamedig'); 

GameDig.query({
    type: 'minecraft',
    host: 'mc.hypixel.net'
}).then((state) => {
    console.log(state);
}).catch((error) => {
    console.log(`Server is offline, error: ${error}`);
});

Confused on how this works, or you want to see more? Checkout the examples folder!

Required Fields

Field Type Description
type string One of the game type IDs listed in the games list. Or you can use protocol-[name] to select a specific protocol. Protocols are listed here.
host string Hostname or IP of the game server.

Optional Fields

Field Type Default Description
address string 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.
port number Game port Connection port or query port for the game server. Some games utilize a separate "query" port. If specifying the game port does not seem to work as expected, passing in this query port may work instead.
maxRetries number 1 Number of retries to query server in case of failure. Note that this amount multiplies with the number of attempts.
socketTimeout number 2000 Milliseconds to wait for a single packet. Beware that increasing this will cause many queries to take longer even if the server is online.
attemptTimeout number 10000 Milliseconds allowed for an entire query attempt (including socketTimeout, beware that if this value is smaller (or even equal) to the socket one, the query will always fail).
givenPortOnly boolean false Only attempt to query server on given port. It will ignore the game's default port.
ipFamily number 0 IP family/version returned when looking up hostnames via DNS, can be 0 (IPv4 and IPv6), 4 (IPv4 only) or 6 (IPv6 only).
debug boolean false Enables massive amounts of debug logging to stdout.
requestRules boolean false Valve games only. Additional 'rules' may be fetched into the raw key.
requestPlayers boolean true Valve games only. Disable this if you don't want to fetch players data.
requestRulesRequired boolean false Valve games only. requestRules is always required to have a response or the query will timeout.
requestPlayersRequired boolean false Valve games only. Querying players is always required to have a response or the query will timeout. Some games 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.
checkOldIDs boolean false Also checks the old ids amongst the current ones.

Query Response

The returned state object will contain the following keys:

Key Type Default Description
name string An empty string Server name.
map string An empty string Server map.
password boolean false If a password is required.
numplayers number 0 Number of players connected.
maxplayers number 0 Maximum number of connected players.
players array of objects [] Note that this could be of a different length compared to numplayers.
players.name string An empty 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.
connect string '${ip}:${port}' This will typically include the game's IP:PORT. The port will reflect the server's game port, even if your request specified the game's query port in the request. For some entries, this may be a server ID or connection URL if the previous isn't applicable.
ping number 0 Round trip time to the server (in milliseconds). Note that this is not the RTT of an ICMP echo, as ICMP packets are often blocked by NATs and node has poor support for raw sockets. This value is derived from the RTT of one of the query packets, which is usually quite accurate, but may add a bit due to server lag.
queryPort number 0 Indicates on which port the query was done on, if this is not applicable its the default value.
version string An empty string Game version that is running on the server.
raw object {} Contains all information received from the server in a disorganized format.

Note that raw (or unstable) objects contents MAY change on a per-protocol basis between GameDig patch releases (although not typical).

Usage from Command Line

Want to integrate server queries from a batch script or other programming language? You'll still need npm to install gamedig:

npm install gamedig -g

After installing gamedig globally, you can call gamedig via the command line:

gamedig --type minecraft mc.example.com:11234
# Alternatively, if you don't want to install gamedig globally, you can run it with npx:
npx gamedig --type minecraft mc.example.com:11234

The output of the command will be in JSON format.
Additional advanced parameters can be passed in as well:

  • --debug: Print debugging information, useful when stating an issue.
  • --pretty: Outputs the JSON format nicely.
  • --requestRules: Request Valve games rules.
  • --givenPortOnly: Run the query with the specified port only (if any).
  • --socketTimeout N: Specifies socket timeout (where N is a number, e.g. 5000).
  • ... and the rest in the same format.

Using with other runtimes

While we still expect to be some minor issues with these, the library works, if any problems arises please open an issue, and we'll look into it.

  • Deno: Minimum supported deno version is 1.39.2 and the --allow-net permission is required.
  • Bun: Minimum supported version is 1.1.21.

Common Issues

Firewalls block incoming UDP

(replit / docker / some VPS providers)

Most game query protocols require a UDP request and response. This means that in some environments, gamedig may not be able to receive the response required due to environmental restrictions.

Some examples include:

  • Docker containers
    • You may need to run the container in --network host mode so that gamedig can bind a UDP listen port.
    • Alternatively, you can forward a single UDP port to your container, and force gamedig to listen on that port using the instructions in the section down below.
  • replit
    • Most online IDEs run in an isolated container, which will never receive UDP responses from outside networks.
  • Various VPS / server providers
    • Even if your server provider doesn't explicitly block incoming UDP packets, some server hosts block other server hosts from connecting to them for DDOS-mitigation and anti-botting purposes.

Gamedig doesn't work in the browser

Gamedig cannot operate within a browser. This means you cannot package it as part of your webpack / browserify / rollup / parcel package.
Even if you were able to get it packaged into a bundle, unfortunately no browsers support the UDP protocols required to query server status from most game servers.
As an alternative, we'd recommend using gamedig on your server-side, then expose your own API to your webapp's frontend displaying the status information. If your application is thin (with no constant server component), you may wish to investigate a server-less lambda provider.

Specifying a listen UDP port override

In some very rare scenarios, you may need to bind / listen on a fixed local UDP port. The is usually not needed except behind some extremely strict firewalls, or within a docker container (where you only wish to forward a single UDP port).
To use a fixed listen udp port, construct a new Gamedig object like this:

const gamedig = new GameDig({
    listenUdpPort: 13337
});
gamedig.query(...)

changelog

To Be Released...

5.X.Y

5.2.0

  • Fix: Palworld not respecting query output players schema (#666)
  • Fix: Minecraft name being duplicated in the name string (#656)
  • Fix: Use cp tag to get player count on Rust (By @xCausxn #663)
  • Fix: Nadeo failing queries on map info (also added version field) (#667 with @Hornochs)
  • Feat: Farming Simulator 25 (2024) - Added support (#660)
  • Feat: Exfil (2024) - Added support (#661)
  • Docs: Valheim numplayers being always 0 on crossplay servers (#668)

5.1.4

  • Feat: Replaced punycode package usage with url.domainToASCII (#630).
  • Feat: World of Padman (2007) - Added support (#636)
  • Feat: Satisfactory - Added support (By @Smidy13 #645, #652, #653)
  • Feat: Update Soldat protocol (#642)
  • Feat: TOXIKK (2016) - Added support (#641)
  • Feat: Renegade X (2014) - Added support (#643)
  • Feat: Hawakening (2024) - Added support (#648)
  • Feat: BROKE PROTOCOL (2024) - Added support (#651)

5.1.3

  • Fix: Deus Ex using the wrong protocol (#621)
  • Fix: Soldier of Fortune using the wrong protocol (#623)
  • Feat: Serious Sam: The Second Encounter (2002) - Added support (#625)
  • Feat: Icarus (2021) - Added support (By @xCausxn #626)
  • Feat: For the Quake2 protocol version's field, also look for version in the raw object
  • Feat: Add option requestPlayers, defaults to true.

5.1.2

  • Added Vintage Story support via the master server (#606)
  • Fixed registerRtt breaking successful queries if it didn't respond in the query timeout (#610)
  • Added support for rFactor 2 (By @xCausxn #614)

4.3.2

  • Locked dependencies versions

5.1.1

  • Lock dependencies to fix problems with cheerio's 1.0.0 release and update punycode to 2.3.1 to mitigate a vulnerability (#604)
  • Fix the name field on Minecraft servers:
    • running Velocity with multiple layers of color encoding (#595)
    • the top-level text of the description is a string composed of empty characters (#599)
  • Fix branding for alt:V Multiplayer (By @xCausxn #600)
  • Added Bun runtime support (#596)
  • Added a rules bytes return for valve protocol (By @blackwaterbread #597)

5.1.0

  • FOUNDRY - Added support (#585)
  • Grand Theft Auto V: AltVMP - Added support (By @xCausxn #588)
  • Fix ability to manual set state.connect (By @xCausxn #588)

5.0.1

  • Minetest - Added support for minetest utilizing official server list (By @xCausxn #573)
  • Soulmask - Added support (By @xCausxn #572)
  • Fix Minecraft's missing favicon from response (#575)
  • Grand Theft Auto V: Rage MP - Added support (By @xCausxn #576)
  • Fix duplicate game entry for The Forest (2014), add old id for backwards compatibility (By @xCausxn #579)
  • Fix Xonotic player's names being numbers and their names being in the "raw" field (#580)

5.0.0

  • Added a new stabilized field version in the query response (By @podrivo #532)
  • 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)
  • Assetto Corsa - Fixed how state.numplayers is set (By @podrivo #538)
  • TeamSpeak 2 - Fixed how state.name is set (By @podrivo #544)
  • Grand Theft Auto: San Andreas OpenMP - Fixed state.players returning an empty array (By @Focus04 #547)
  • Perf: Re-write of the core class.
  • Perf: Remove many if statements from GameSpy2.
  • Myth of Empires - Added support.
  • Fix: BeamMP maxplayers that was displaying player count (By @dgibbs64 #551)
  • Fix: BeamMP filter servers by address, not host (By @Rephot #558)
  • Palworld - Replace old and broken protocol with the new one (#560)
  • Nova-Life: Amboise - Added support.
  • Abiotic Factor - Added Support.

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).
  • 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

Breaking Changes

Package

  • Node.js 16.20 is now required (from 14).
  • 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.
    • Many game ids have changed, see the migrate ids 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.

Games

  • Almost all games ids have been changed to follow a standard, see CONTRIBUTING.md#naming.
  • 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

  • Replaced usage of deprecated substr with substring.
  • Replaced deprecated internal punycode with the punycode package.
  • Updated dependencies:
    • got from 12.1 to 13.
    • minimist from 1.2.6 to 1.2.8.
    • long from 5.2.0 to 5.2.3.
    • @types/node from 14.18.13 to 16.18.58.
    • 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
    • Minimum Supported Deno Version: 1.39.2.
    • deno run --allow-net bin/gamedig.js --type tf2 127.0.0.1
  • Added code examples.
  • New stable field: queryPort - this number indicates what was the port that the query was done on, 0 indicates none if not applicable.
  • Fixed numplayers not having a default value.
  • New options:
    • portCache (defaults to 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.
    • 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 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.
    • checkOldIDs (defaults to false). Query will check for older game type IDs. See migration 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

  • Removed the players::setNum method, the library will no longer add empty players as 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).
  • 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.
  • 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 Mod (By @Douile, #436).
  • Added a -1 query port offset for Rising World (#441).

4.3.0

  • Fix Post Scriptum not being on the valve protocol.
  • Added support for the Minecraft Better Compatibility Checker Mod.
  • Halo Online (ElDewrito) - Added support (by @Sphyrna-029)

4.2.0

  • Renamed Counter Strike: 2D to CS2D in games.txt (why? see this).
  • Updated CS2D protocol (by @ernestpasnik)
  • Capitalize Unturned name in games.txt.
  • Fix an edge-case of the Doom3 protocol that did not parse the correct field for max players.
  • Eco (2018) - Added support (requested by @dgibbs64)
  • Core Keeper (2022) - Added support (by @dgibbs64)
  • ARMA: Reforger (2022) - Added support (by @dgibbs64)
  • Action Half-Life - Added support (by @dgibbs64).
  • Action: Source (2019) - Added support (by @dgibbs64).
  • Base Defense (2017) - Added support (by @dgibbs64).
  • Blade Symphony (2014) - Added support (by @dgibbs64).
  • Brainbread - Added support (by @dgibbs64).
  • Deathmatch Classic (2001) - Added support (by @dgibbs64).
  • Double Action: Boogaloo (2014) - Added support (by @dgibbs64).
  • Dystopia (2005) - Added support (by @dgibbs64).
  • Empires Mod (2008) - Added support (by @dgibbs64).
  • Fistful of Frags (2014) - Added support (by @dgibbs64).
  • Half-Life: Opposing Force (1999) - Added support (by @dgibbs64).
  • Pirates, Vikings, and Knights II (2007) - Added support (by @dgibbs64).
  • Project Cars (2015) - Added support (by @dgibbs64).
  • Project Cars 2 (2017) - Added support (by @dgibbs64).
  • The Specialists - Added support (by @dgibbs64).
  • Vampire Slayer - Added support (by @dgibbs64).
  • Warfork (2018) - Added support (by @dgibbs64).
  • Wurm Unlimited (2015) - Added support (by @dgibbs64).
  • The Forest (2014) - Added support.
  • Operation: Harsh Doorstop (2023) - Added support.
  • Insurgency: Modern Infantry Combat (2007) - Added support.
  • Counter-Strike 2 (2023) - Added support.
  • The Front (2023) - Added support.
  • San Andreas OpenMP - Added support.
  • ARK: Survival Ascended (2023) - Added support (by @GuilhermeWerner).

4.1.0

  • Replace compressjs dependency by seek-bzip to solve some possible import issues.
  • Sons Of The Forest (2023) - Added support
  • Red Dead Redemption 2 - RedM (2018) - Added support
  • Creativerse (2017) - Added support
  • The Isle (2015) - Added support

4.0.7

  • Updated some dependencies to solve vulnerabilities
  • Fixed an issue regarding GameSpy 1 not correctly checking and parsing for numbers.
  • Risk of Rain 2 (2019) - Added support
  • Survive the Nights (2017) - Added support
  • V Rising (2022) - Added support
  • Day of Dragons (2019) - Added support
  • Onset (2019) - Added support
  • Don't Starve Together (2016) - Added support
  • Chivalry: Medieval Warfare (2012) - Added support
  • Avorion (2020) - Added support
  • Black Mesa (2020) - Added support
  • Ballistic Overkill (2017) - Added support
  • Codename CURE (2017) - Added support
  • Colony Survival (2017) - Added support
  • Rising World (2014) - Added support
  • BrainBread 2 (2016) - Added support

4.0.6

  • Fixed ping returned by minecraft queries
  • Added ipFamily option to query only ipv4 or only ipv6 dns records

4.0.5

  • Fixed filtering out fake "Max Players" player on CSGO
  • Removed moment dependency

4.0.4

  • Updated dependencies

4.0.3

  • Fixed nodejs version requirement in package.json (node 14 has been required since gamedig 4)
  • Ground Breach (2018) - Added support
  • Minecraft (All Versions) - Fixed character encoding for strings returned by servers using Geyser
  • Barotrauma (2019) - Added support

4.0.2

  • Counter-Strike 1.5 - Fixed support

4.0.1

  • Rust - Fixed maxplayers >255
  • dayZ - Fixed tag info not parsing when queryRules wasn't set

4.0.0

Breaking Changes

  • NodeJS 14 is now required

Other changes

  • Dependencies are updated
  • Node 14 is now required due to new requirement in got dependency

3.0.9

  • Fixes player info parsing issues on bf1942-based mods (Thanks cetteup)
  • Adds Project Zomboid support (Thanks xhip)
  • Adds Post Scriptum support (Thanks arkuar)
  • Adds some more DayZ info to state.raw (Thanks podrivo)
  • Updates to README regarding DayZ (Thanks podrivo)
  • Improvements to DayZ mod parsing from additional more recent reverse engineering (probably still buggy)
  • Fixes ping always being 0 for minecraft servers
  • Adds README documentation about teamspeakQueryPort

3.0.8

  • Fixes player array corruption on some protocols which only report player counts without names (Thanks to a-sync)
  • Fixes minecraft protocol not using player list from bedrock protocol in some cases

3.0.7

  • Fixes corrupted dayzMods when packet overflow is present

3.0.6

  • raw.tags for valve servers is now an array rather than a string
  • The special mod list for dayz servers is now parsed into raw.dayzMods is requestRules is set to true
  • DayZ queue length, day and night acceleration are now parsed into raw as well

3.0.5

  • Add support for listenUdpPort to specify a fixed bind port.
  • Improved udp bind failure detection.

3.0.4

  • Add support for Discord widget

3.0.3

  • Greatly improve gamespy1 protocol, with additional error handling and xserverquery support.

3.0.2

  • Fix player name extraction for Unreal Tournament (1999) and possibly other gamespy1 games.

3.0.1

  • Clarified that nodejs 12 is now required for gamedig 3
  • Fixed misc player fields not going into raw subobject in assettocorsa, fivem, and gamespy2

3.0.0

Major Changes:

  • NodeJS 12 is now required
  • The name field is now guaranteed to exist on all player objects. If a player's name is unknown, the name will be an empty string.
  • All non-name player fields have been moved into a raw sub-field. This means that, like the raw subobject of the parent response, all non-name fields are now considered to be unstable and may be changed during minor releases of GameDig.
  • "Rules" are no longer queried for valve protocol games by default. Many games do not respond to this query anyways (meaning we have to wait for timeout), and its contents is often not even used since it only exists in the raw subfield. If you depend on rules, you may pass the requestRules: true option to re-enable them.
  • The raw.steamappid and raw.gameid fields for valve games have been consolidated into raw.appId.

2.0.28

  • Added Valheim (2021)

2.0.27

  • Reduced chance of protocol collisions between gamespy3 and minecraftbedrock

2.0.26

  • Added support for the native minecraft bedrock protocol, since some bedrock servers apparently do not respond to the gamespy3 protocol.

2.0.25

  • Support challenges in A2S_INFO (upcoming change to valve protocol)

2.0.24

  • Add Savage 2: A Tortured Soul (2008)

2.0.23

  • Fix Conan Exiles and other games which don't respond to the valve player query
  • Add givenPortOnly query option for users that require extreme optimization

2.0.22

  • Updated dependencies

2.0.21

  • Added Assetto Corsa (2014)
  • Fixed password flag for Squad
  • Added Mordhau (2019)
  • Fixed player count being incorrect in minecraftvanilla protocol in some cases
  • Updated dependencies
  • Replaced deprecated Request http library with Got

2.0.20

  • Fixed minecraft protocol never throwing exceptions

2.0.19

  • Added Days of War (2017)
  • Added The Forrest (2014)
  • Added Just Cause 3 Multiplayer (2017)
  • Added Project Reality: Battlefield 2 (2005)
  • Added Quake Live (2010)
  • Added Contagion (2011)
  • Added Empyrion: Galactic Survival (2015)
  • Added PixARK (2018)

2.0.16, 2.0.17, 2.0.18

  • Various improvements to killing floor / unreal2 protocol

2.0.15

  • Added Hell Let Loose
  • Added Rising Storm 2: Vietnam
  • Added Squad
  • Fixed DNS lookup not working in some situations when dns.lookup unexpectedly returns a string
  • Improved minecraft protocol for non-vanilla server implementations (bedrock, waterfall, bungeecord)
  • Updated dependencies

2.0.14

  • Node 8 compatibility fixes

2.0.13

  • Improved logging

2.0.12

  • Servers are now limited to 10000 players to prevent OOM
  • Improvements to Starmade (2012)
  • Added Atlas (2018)

2.0.11

  • Added Acra Sim Racing
  • Added Mafia 2: Online

2.0.10

  • Added rFactor

2.0.9

  • Added Vice City: Multiplayer

2.0.8

  • Improve out-of-order packet handling for gamespy1 protocol
  • Work-around for buggy duplicate player reporting from bf1942 servers
  • Report team names rather than IDs when possible for gamespy1 protocol

2.0.7

  • Prevent tcp socket errors from dumping straight to console

2.0.6

  • Added support for host domains requiring Punycode encoding (special characters)

2.0.5

  • Added support for Counter-Strike: 2D

2.0.4

  • Added details about new 2.0 reponse fields to the README.

2.0.3

  • Added support for Insurgency: Sandstorm

2.0.2

  • Added support for Starsiege 2009 (starsiege)

2.0.1

  • Updated readme games list for 2.0
  • Fixed csgo default port

2.0.0

Breaking API changes
  • Node 8 is now required
  • Removed the port_query option. You can now pass either the server's game port or query port in the port option, and GameDig will automatically discover the proper port to query. Passing the query port is more likely be successful in unusual cases, as otherwise it must be automatically derived from the game port.
  • Removed callback parameter from Gamedig.query. Only promises are now supported. If you would like to continue using callbacks, you can use node's util.callbackify function to convert the method to callback format.
  • Removed query field from response object, as it was poorly documented and unstable.
  • Removed notes field from options / response object. Data can be passed through a standard javascript context if needed.
Minor Changes
  • Rewrote core to use promises extensively for better error-handling. Async chains have been dramatically simplified by using async/await across the codebase, eliminating callback chains and the 'async' dependency.
  • Replaced --output pretty cli parameter with --pretty.
  • You can now query from CLI using shorthand syntax: gamedig --type <gameid> <ip>[:<port>]
  • UDP socket is only opened if needed by a query.
  • Automatic query port detection -- If provided with a non-standard port, gamedig will attempt to discover if it is a game port or query port by querying twice: once to the port provided, and once to the port including the game's query port offset (if available).
  • Added new connect field to the response object. This will typically include the game's ip:port (the port will reflect the server's game port, even if you passed in a query port in your request). For some games, this may be a server ID or connection url if an IP:Port is not appropriate.
  • Added new ping field (in milliseconds) to the response object. As icmp packets are often blocked by NATs, and node has poor support for raw sockets, this time is derived from the rtt of one of the UDP requests, or the time required to open a TCP socket during the query.
  • Improved debug logging across all parts of GameDig
  • Removed global Gamedig.debug. debug is now an option on each query.
Protocol Changes
  • Added support for games using older versions of battlefield protocol.
  • Simplified detection of BC2 when using battlefield protocol.
  • Fixed buildandshoot not reading player list
  • Standardized all doom3 games into a single protocol, which can discover protocol discrepancies automatically.
  • Standardized all gamespy2 games into a single protocol, which can discover protocol discrepancies automatically.
  • Standardized all gamespy3 games into a single protocol, which can discover protocol discrepancies automatically.
  • Improved valve protocol challenge key retry process

1.0.0

  • First official release
  • Node.js 6 is now required