mirror of
https://github.com/gamedig/node-gamedig.git
synced 2024-11-13 07:21:11 +01:00
fix: Updated the eco protocol to include player names and fix problems encountered when using the eco web interface behind a proxy. (#526)
* Update eco protocol to include player names and fixed problems when using eco webinterface behind a proxy * changelog + readability * Typo * Typo
This commit is contained in:
parent
e4d59a9f89
commit
b2de68f551
2 changed files with 4 additions and 2 deletions
|
@ -2,6 +2,7 @@
|
|||
## To Be Released...
|
||||
## 5.0.0-beta.3
|
||||
* Euro Truck Simulator 2 (2012) - Added support (By @podrivo #523)
|
||||
* Eco - Added support for Eco servers that require connection from a domain (By @Vito0912)
|
||||
|
||||
## 5.0.0-beta.2
|
||||
* Fixed support for projects using `require`.
|
||||
|
|
|
@ -5,16 +5,17 @@ export default class eco extends Core {
|
|||
if (!this.options.port) this.options.port = 3001
|
||||
|
||||
const request = await this.request({
|
||||
url: `http://${this.options.address}:${this.options.port}/frontpage`,
|
||||
url: `http://${this.options.host}:${this.options.port}/frontpage`,
|
||||
responseType: 'json'
|
||||
})
|
||||
const serverInfo = request.Info
|
||||
|
||||
state.name = serverInfo.Description
|
||||
state.numplayers = serverInfo.OnlinePlayers;
|
||||
state.numplayers = serverInfo.OnlinePlayers
|
||||
state.maxplayers = serverInfo.TotalPlayers
|
||||
state.password = serverInfo.HasPassword
|
||||
state.gamePort = serverInfo.GamePort
|
||||
state.players = serverInfo.OnlinePlayersNames?.map(name => ({ name, raw: {} })) || []
|
||||
state.raw = serverInfo
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue