Compare commits
8 Commits
e7bc452332
...
69429f9c86
Author | SHA1 | Date |
---|---|---|
Pedro Ivo Hudson | 69429f9c86 | |
Sebastian Schmidt | 47bd986fad | |
CosminPerRam | 6a174c6eb1 | |
Pedro Ivo Hudson | a4790bbfaa | |
Pedro Ivo Hudson | 242a1f4035 | |
Pedro Ivo Hudson | c9d8e00139 | |
Pedro Ivo Hudson | c317cfc760 | |
Pedro Ivo Hudson | cebefe3899 |
|
@ -462,5 +462,4 @@ EOS does not provide players data.
|
|||
|
||||
### <a name="palworld"></a>Palworld
|
||||
Palworld support can be unstable, the devs mention the api is currently experimental.
|
||||
To query palworld servers, the `RESTAPIEnabled` must be `True` in the configuration file, and you need to pass
|
||||
the `username` (currently always `admin`) and `password` (settings parameter) for it.
|
||||
To query Palworld servers, the `RESTAPIEnabled` setting must be `True` in the configuration file, and you need to pass the `username` (currently always `admin`) and the `adminpassword` (from the server config) as the `password` parameter.
|
||||
|
|
|
@ -16,7 +16,9 @@ Make sure to check if your game's ID is in the [id migration document](MIGRATE_I
|
|||
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
|
||||
Install using your favorite package manager: `npm install gamedig`, then use!
|
||||
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`!
|
||||
|
||||
```js
|
||||
import { GameDig } from 'gamedig';
|
||||
// Or if you're using CommonJS:
|
||||
|
@ -59,6 +61,7 @@ Confused on how this works, or you want to see more? Checkout the [examples](/ex
|
|||
| **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. |
|
||||
| **checkAlias** | boolean | false | Also checks for alternative game ids. |
|
||||
|
||||
## Query Response
|
||||
|
||||
|
|
|
@ -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', 'checkOldIDs'],
|
||||
boolean: ['pretty', 'debug', 'givenPortOnly', 'requestRules', 'requestRulesRequired', 'requestPlayersRequired', 'stripColors', 'portCache', 'noBreadthOrder', 'checkOldIDs', 'checkAlias'],
|
||||
string: ['guildId', 'listenUdpPort', 'ipFamily', 'token'],
|
||||
default: {
|
||||
stripColors: true,
|
||||
|
|
|
@ -13,6 +13,12 @@ export const lookup = (options) => {
|
|||
|
||||
let game = games[type]
|
||||
|
||||
if (options.checkAlias) {
|
||||
Object.keys(games).forEach((id) => {
|
||||
if (games[id]?.extra?.alias) game = games[id]
|
||||
})
|
||||
}
|
||||
|
||||
if (options.checkOldIDs) {
|
||||
Object.keys(games).forEach((id) => {
|
||||
if (games[id]?.extra?.old_id === type) {
|
||||
|
|
|
@ -21,12 +21,16 @@ sortedGamesIds.forEach(key => {
|
|||
})
|
||||
|
||||
let generated = ''
|
||||
generated += '| GameDig Type ID | Name | See Also\n'
|
||||
generated += '|---|---|---\n'
|
||||
generated += '| GameDig Type ID | Alias | Name | See Also\n'
|
||||
generated += '|---|---|---|---\n'
|
||||
|
||||
for (const id in sortedGames) {
|
||||
const game = sortedGames[id]
|
||||
generated += '| ' + id.padEnd(10, ' ') + ' | ' + game.name
|
||||
if (!game?.extra?.alias) {
|
||||
game.alias = ' '
|
||||
}
|
||||
generated += '| ' + id.padEnd(10, ' ') + ' | ' + game.alias + ' | ' + game.name
|
||||
|
||||
const notes = []
|
||||
if (game?.extra?.doc_notes) {
|
||||
notes.push('[Notes](#' + game.extra.doc_notes + ')')
|
||||
|
|
Loading…
Reference in New Issue