Compare commits

...

6 Commits

Author SHA1 Message Date
CosminPerRam 2b58e0d233 feat: bump version to 5.0.0 2024-05-11 19:36:07 +03:00
CosminPerRam 00d2f17991 docs: revert and add back the a tags in games_list and simplify nadeo name 2024-05-11 19:16:21 +03:00
CosminPerRam d124f4d454 docs: remove a tags from GAMES_LIST 2024-05-11 19:13:30 +03:00
CosminPerRam 9aa8914418 docs: add minecraft game id performance note
Added as a side effect of #370
2024-05-11 19:10:05 +03:00
CosminPerRam a4886eaff4 docs: add a note regarding the attemptTimeout option
Added as a side effect of #370
2024-05-11 19:05:26 +03:00
CosminPerRam 9bd3caab7b feat(protocol/minecraft): reduce repeated code on promise.push 2024-05-11 18:47:38 +03:00
7 changed files with 27 additions and 27 deletions

View File

@ -1,6 +1,9 @@
## To Be Released...
## 5.0.0-beta.3
## 5.X.Y
In progress?
## 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)

View File

@ -399,18 +399,18 @@ Games with Additional Notes
To receive a full player list response from CS:GO servers, the server must
have set the cvar: host_players_show 2
### Discord
### <a name="discord"></a> Discord
You must set the `guildId` request field to the server's guild ID. Do not provide an IP.
The Guild ID can be found in server widget settings (Server ID) or by enabling developer mode in client settings and right-clicking the server's icon.
In order to retrieve information from discord server's they must have the `Enable server widget` option enabled.
### Mumble
### <a name="mumble"></a> Mumble
For full query results from Mumble, you must be running the
[GTmurmur plugin](http://www.gametracker.com/downloads/gtmurmurplugin.php).
If you do not wish to run the plugin, or do not require details such as channel and user lists,
you can use the 'mumbleping' server type instead, which uses a less accurate but more reliable solution
### Nadeo (ShootMania / TrackMania / etc)
### <a name="nadeo"></a> Nadeo (ShootMania / TrackMania / etc)
The server must have xmlrpc enabled, and you must pass the xmlrpc port to GameDig, not the connection port.
You must have a user account on the server with access level User or higher.
Pass the login into to GameDig with the additional options: login, password
@ -429,11 +429,11 @@ For teamspeak 3 queries to work correctly, the following permissions must be ava
In the extremely unusual case that your server host responds to queries on a non-default port (the default is 10011),
you can specify their host query port using the teamspeakQueryPort option.
### Terraria
### <a name="terraria"></a>Terraria
Requires tshock server mod, and a REST user token, which can be passed to GameDig with the
additional option: `token`
### Valheim
### <a name="valheim"></a>Valheim
Valheim servers will only respond to queries if they are started in public mode (`-public 1`).
### <a name="dayz"></a>DayZ
@ -442,13 +442,15 @@ DayZ stores some of it's servers information inside the `tags` attribute. Make s
### <a name="thefront"></a>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.
### <a name="conanexiles">Conan Exiles
### <a name="conanexiles"></a>Conan Exiles
Conan Exiles never responds to player query.
### <a name="minecraft">Minecraft
Many Minecraft servers do not respond with players data.
### <a name="minecraft"></a>Minecraft
Many Minecraft servers do not respond with players data.
Beware that using this entry is quite slow as it attempts 3 protocols at a time (`minecraftvanilla`, `minecraftbedrock` and `gamespy3`) and waits for all the queries to finish.
If you know your use case, it's better to use a single protocol or make your own logic for attempting multiple ones.
### <a name='farmingsimulator'>Farming Simulator
### <a name='farmingsimulator'></a>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.

View File

@ -50,7 +50,7 @@ Confused on how this works, or you want to see more? Checkout the [examples](/ex
| **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. This timeout is not commonly hit, as the socketTimeout typically fires first. |
| **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. |

View File

@ -2570,7 +2570,7 @@ export const games = {
protocol: 'nadeo'
},
extra: {
doc_notes: 'nadeo-shootmania--trackmania--etc'
doc_notes: 'nadeo'
}
},
sin: {
@ -2936,7 +2936,7 @@ export const games = {
protocol: 'nadeo'
},
extra: {
doc_notes: 'nadeo-shootmania--trackmania--etc'
doc_notes: 'nadeo'
}
},
trackmaniaforever: {
@ -2948,7 +2948,7 @@ export const games = {
protocol: 'nadeo'
},
extra: {
doc_notes: 'nadeo-shootmania--trackmania--etc'
doc_notes: 'nadeo'
}
},
tremulous: {

4
package-lock.json generated
View File

@ -1,12 +1,12 @@
{
"name": "gamedig",
"version": "5.0.0-beta.0",
"version": "5.0.0",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "gamedig",
"version": "5.0.0-beta.0",
"version": "5.0.0",
"license": "MIT",
"dependencies": {
"cheerio": "^1.0.0-rc.12",

View File

@ -32,7 +32,7 @@
"require": "./dist/index.cjs"
},
"author": "GameDig Contributors",
"version": "5.0.0-beta.2",
"version": "5.0.0",
"repository": {
"type": "git",
"url": "https://github.com/gamedig/node-gamedig.git"

View File

@ -24,9 +24,7 @@ export default class minecraft extends Core {
const vanillaResolver = new minecraftvanilla()
vanillaResolver.options = this.options
vanillaResolver.udpSocket = this.udpSocket
promises.push((async () => {
try { return await vanillaResolver.runOnceSafe() } catch (e) {}
})())
promises.push(vanillaResolver)
const gamespyResolver = new Gamespy3()
gamespyResolver.options = {
@ -34,18 +32,15 @@ export default class minecraft extends Core {
encoding: 'utf8'
}
gamespyResolver.udpSocket = this.udpSocket
promises.push((async () => {
try { return await gamespyResolver.runOnceSafe() } catch (e) {}
})())
promises.push(gamespyResolver)
const bedrockResolver = new minecraftbedrock()
bedrockResolver.options = this.options
bedrockResolver.udpSocket = this.udpSocket
promises.push((async () => {
try { return await bedrockResolver.runOnceSafe() } catch (e) {}
})())
promises.push(bedrockResolver)
const [vanillaState, gamespyState, bedrockState] = await Promise.all(promises)
const ranPromises = promises.map(p => p.runOnceSafe().catch(_ => undefined))
const [vanillaState, gamespyState, bedrockState] = await Promise.all(ranPromises)
state.raw.vanilla = vanillaState
state.raw.gamespy = gamespyState