mirror of
https://github.com/a-sync/game-server-watcher.git
synced 2026-04-05 00:43:58 -04:00
fix: steam connect address port
* return extended info from steam api call
This commit is contained in:
@@ -146,14 +146,21 @@ export class GameServer {
|
|||||||
if (Array.isArray(data.response.servers)) {
|
if (Array.isArray(data.response.servers)) {
|
||||||
const matching = data.response.servers.find((s: any) => s.gameport === this.config.port);
|
const matching = data.response.servers.find((s: any) => s.gameport === this.config.port);
|
||||||
if (matching) {
|
if (matching) {
|
||||||
|
const queryAddr = matching.addr.split(':');
|
||||||
|
const queryHost = queryAddr[0];
|
||||||
|
const queryPort = queryAddr[1];
|
||||||
return {
|
return {
|
||||||
connect: matching.addr,
|
connect: `${queryHost}:${matching.gameport}`,
|
||||||
name: matching.name,
|
name: matching.name,
|
||||||
game: matching.gamedir,
|
game: matching.gamedir,
|
||||||
map: matching.map,
|
map: matching.map,
|
||||||
playersNum: matching.players,
|
playersNum: matching.players,
|
||||||
playersMax: matching.max_players,
|
playersMax: matching.max_players,
|
||||||
players: []
|
players: [],
|
||||||
|
password: matching.secure,
|
||||||
|
ping: 0,
|
||||||
|
version: matching.version,
|
||||||
|
queryPort
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user