mirror of
https://github.com/gamedig/node-gamedig.git
synced 2024-11-16 08:48:32 +01:00
89515cb677
* chore: backport all 4.3.0 changes * docs: remove changelog line that does not apply
21 lines
526 B
JavaScript
21 lines
526 B
JavaScript
import Core from './core.js'
|
|
|
|
export default class eldewrito extends Core {
|
|
async run (state) {
|
|
const json = await this.request({
|
|
url: 'http://' + this.options.address + ':' + this.options.port,
|
|
responseType: 'json'
|
|
})
|
|
|
|
for (const one of json.players) {
|
|
state.players.push({ name: one.name, team: one.team })
|
|
}
|
|
|
|
state.name = json.name
|
|
state.map = json.map
|
|
state.maxplayers = json.maxPlayers
|
|
state.connect = this.options.address + ':' + json.port
|
|
|
|
state.raw = json
|
|
}
|
|
}
|