mirror of
https://github.com/tribufu/node-gamedig
synced 2026-05-18 09:35:50 +00:00
Swap from request to got
This commit is contained in:
parent
67563c0f1e
commit
487b17dd73
9 changed files with 215 additions and 340 deletions
|
|
@ -12,18 +12,18 @@ class FiveM extends Quake2 {
|
|||
await super.run(state);
|
||||
|
||||
{
|
||||
const raw = await this.request({
|
||||
uri: 'http://' + this.options.address + ':' + this.options.port + '/info.json'
|
||||
const json = await this.request({
|
||||
url: 'http://' + this.options.address + ':' + this.options.port + '/info.json',
|
||||
responseType: 'json'
|
||||
});
|
||||
const json = JSON.parse(raw);
|
||||
state.raw.info = json;
|
||||
}
|
||||
|
||||
{
|
||||
const raw = await this.request({
|
||||
uri: 'http://' + this.options.address + ':' + this.options.port + '/players.json'
|
||||
const json = await this.request({
|
||||
url: 'http://' + this.options.address + ':' + this.options.port + '/players.json',
|
||||
responseType: 'json'
|
||||
});
|
||||
const json = JSON.parse(raw);
|
||||
state.raw.players = json;
|
||||
state.players = [];
|
||||
for (const player of json) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue