From 4522f5122ff38cef3aabb0f8b9c4908e09a9d3d1 Mon Sep 17 00:00:00 2001 From: Fantino Davide Date: Fri, 29 Dec 2023 18:04:53 +0100 Subject: [PATCH] refactor: removed A2S labels, and replaced with "server". legacy support for updateA2SInformation() --- squad-server/index.js | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/squad-server/index.js b/squad-server/index.js index fb83489..77a9a26 100644 --- a/squad-server/index.js +++ b/squad-server/index.js @@ -477,23 +477,20 @@ export default class SquadServer extends EventEmitter { ); } - async updateA2SInformation() { + updateA2SInformation() { + return this.updateServerInformation(); + } + + async updateServerInformation() { if (this.updateA2SInformationTimeout) clearTimeout(this.updateA2SInformationTimeout); - Logger.verbose('SquadServer', 1, `Updating A2S information...`); + Logger.verbose('SquadServer', 1, `Updating server information...`); try { - // const data = await Gamedig.query({ - // type: 'squad', - // host: this.options.host, - // port: this.options.queryPort - // }); - const rawData = await this.rcon.execute(`ShowServerInfo`); - Logger.verbose('SquadServer', 3, `A2S raw data`, rawData); + Logger.verbose('SquadServer', 3, `Server information raw data`, rawData); const data = JSON.parse(rawData); - Logger.verbose('SquadServer', 2, `A2S data`, JSON.data); - // Logger.verbose("SquadServer", 1, `A2S data`, JSON.stringify(data, null, 2)) + Logger.verbose('SquadServer', 2, `Server information data`, JSON.data); const info = { raw: data,