This commit is contained in:
Skillet 2023-04-17 23:25:23 -04:00
parent 3f43fe7967
commit 86176a2106

View File

@ -1116,15 +1116,17 @@ export default class MapVote extends DiscordBasePlugin {
'http://hub.afocommunity.com/api/layers.json', [0, 1959152751] 'http://hub.afocommunity.com/api/layers.json', [0, 1959152751]
); );
const rconLayers = (await this.server.rcon.execute('ListLayers'))?.split('\n') || [];
rconLayers.shift();
for (const layer of response.data.Maps) { for (const layer of response.data.Maps) {
if (!Layers.layers.find((e) => e.layerid === layer.rawName)){ if (!Layers.layers.find((e) => e.layerid === layer.rawName)){
if(rconLayers.find((e) => e.layer === layer.rawName)) {
const hellolayer = new Layer(layer); const hellolayer = new Layer(layer);
Layers._layers.set(hellolayer.layerid, hellolayer); Layers._layers.set(hellolayer.layerid, hellolayer);
} }
} }
}
const rconLayers = (await this.server.rcon.execute('ListLayers'))?.split('\n') || [];
rconLayers.shift();
// this.verbose(1, 'RCON Layers', rconLayers.length, this.mapLayer(rconLayers[ 0 ])) // this.verbose(1, 'RCON Layers', rconLayers.length, this.mapLayer(rconLayers[ 0 ]))
for (const layer of rconLayers) { for (const layer of rconLayers) {