mirror of
https://github.com/tribufu/node-gamedig
synced 2026-05-18 09:35:50 +00:00
feat: backport 4.3.0 changes into master (#432)
* chore: backport all 4.3.0 changes * docs: remove changelog line that does not apply
This commit is contained in:
parent
d37c5b7f2b
commit
89515cb677
6 changed files with 48 additions and 3 deletions
21
protocols/eldewrito.js
Normal file
21
protocols/eldewrito.js
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
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
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue