From 56a4a9452f49069d5057bed87493f30cb3c83e08 Mon Sep 17 00:00:00 2001 From: Skillet Date: Fri, 21 Apr 2023 18:35:47 -0400 Subject: [PATCH] fix rcon return --- mapvote.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/mapvote.js b/mapvote.js index dfb0fd0..fd01812 100644 --- a/mapvote.js +++ b/mapvote.js @@ -1117,8 +1117,13 @@ layer 'http://hub.afocommunity.com/api/layers.json', [0, 1959152751] ); - const rconLayers = (await this.server.rcon.execute('ListLayers'))?.split('\n') || []; - rconLayers.shift(); + const rconRaw = (await this.server.rcon.execute('ListLayers'))?.split('\n') || []; + rconRaw.shift(); + + const rconLayers = []; + for (const raw of rconRaw){ + rconLayers.push(raw.split(' ')[0]); + } for (const layer of response.data.Maps) { this.verbose(1, 'pulled layer: ', layer.rawName);