From fca459b3364ebeb92fadadf7a466c565a099e08a Mon Sep 17 00:00:00 2001 From: Pedro Ivo Hudson Date: Wed, 17 Jan 2024 08:11:31 -0300 Subject: [PATCH] chore: Add address field in README (#481) * chore: add address field in README * fix table spacing * updates CHANGELOG * Update CHANGELOG.md --- CHANGELOG.md | 1 + README.md | 27 ++++++++++++++------------- 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 94b0ec07..58705592 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -34,6 +34,7 @@ * New option: `stripColors` (defaults to `true`) for protocols that strips colors: unreal2, savage2, quake3, nadeo, gamespy2, doom3, armagetron. * New option: `requestRulesRequired` (defaults to `false`) Valve games only. `requestRules` is always required to have a response or the query will timeout. * New option: `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. +* New option: `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 diff --git a/README.md b/README.md index ca2a5068..e8dcd11f 100644 --- a/README.md +++ b/README.md @@ -37,19 +37,20 @@ Confused on how this works, or you want to see more? Checkout the [examples](/ex ## Optional Fields -| Field | Type | Default | Description | -|:---------------------------|:--------|:----------|:-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| -| **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. | -| **maxAttempts** | number | 1 | Number of attempts to query server in case of failure. | -| **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. This timeout is not commonly hit, as the socketTimeout typically fires first. | -| **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. | -| **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](GAMES_LIST.md) may not provide a players response. | -| **stripColors** | boolean | true | Enables stripping colors for protocols: unreal2, savage2, quake3, nadeo, gamespy2, doom3, armagetron. | +| 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. | +| **maxAttempts** | number | 1 | Number of attempts to query server in case of failure. | +| **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. This timeout is not commonly hit, as the socketTimeout typically fires first. | +| **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. | +| **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](GAMES_LIST.md) may not provide a players response. | +| **stripColors** | boolean | true | Enables stripping colors for protocols: unreal2, savage2, quake3, nadeo, gamespy2, doom3, armagetron. | ## Query Response