Compare commits

...

8 Commits

Author SHA1 Message Date
Pedro Ivo Hudson 69429f9c86
Merge a4790bbfaa into 47bd986fad 2024-04-15 19:17:29 +02:00
Sebastian Schmidt 47bd986fad
docs: Updated wordings around new Palworld mechanic (#561)
* Updated wordings around new Palworld mechanic

* Remove un-needed changelog entry

* Fixed wording

* wrapping
2024-04-15 11:00:37 +03:00
CosminPerRam 6a174c6eb1 docs: add note on readme for installing gamedig from the repository 2024-04-12 03:06:37 +03:00
Pedro Ivo Hudson a4790bbfaa fix alias reference in tools 2024-02-14 11:33:35 -03:00
Pedro Ivo Hudson 242a1f4035 adds checkAlias option 2024-02-14 11:31:58 -03:00
Pedro Ivo Hudson c9d8e00139 add alias as an extra field 2024-02-09 21:15:36 -03:00
Pedro Ivo Hudson c317cfc760 Merge branch 'master' into fat/add-game-type-alias 2024-02-09 21:09:50 -03:00
Pedro Ivo Hudson cebefe3899 feat: add game type alias 2024-01-18 08:00:08 -03:00
5 changed files with 19 additions and 7 deletions

View File

@ -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.

View File

@ -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

View File

@ -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,

View File

@ -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) {

View File

@ -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 + ')')