mirror of
https://github.com/tribufu/node-gamedig
synced 2026-05-18 09:35:50 +00:00
fix(gta5f): wrap query of players in a catch (#674)
* feat: wrap query of players in a catch * docs: add note about how to make players query get through * docs: update CHANGELOG.md * docs: add comment regarding adding requestPlayers and requestPlayersRequired eventually
This commit is contained in:
parent
c68db8f98b
commit
467606f6a6
4 changed files with 10 additions and 4 deletions
|
|
@ -20,7 +20,8 @@ export default class fivem extends quake2 {
|
|||
if ('version' in state.raw.info) state.version = state.raw.info.version
|
||||
}
|
||||
|
||||
{
|
||||
try {
|
||||
// TODO: #674, eventually add `requestPlayers` and `requestPlayersRequired`.
|
||||
const json = await this.request({
|
||||
url: 'http://' + this.options.address + ':' + this.options.port + '/players.json',
|
||||
responseType: 'json'
|
||||
|
|
@ -29,6 +30,6 @@ export default class fivem extends quake2 {
|
|||
for (const player of json) {
|
||||
state.players.push({ name: player.name, ping: player.ping })
|
||||
}
|
||||
}
|
||||
} catch (_) {}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue