diff --git a/package.json b/package.json index 2056a71..b183459 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "SquadJS", - "version": "2.0.1", + "version": "2.0.2", "repository": "https://github.com/Thomas-Smyth/SquadJS.git", "author": "Thomas Smyth ", "license": "BSL-1.0", diff --git a/squad-server/layers/layers.js b/squad-server/layers/layers.js index 607b733..d4c76f4 100644 --- a/squad-server/layers/layers.js +++ b/squad-server/layers/layers.js @@ -13,22 +13,26 @@ class Layers { async pull(force = false) { if (this.pulled && !force) { - Logger.verbose('Layers', 1, 'Already pulled layers.'); + Logger.verbose('Layers', 2, 'Already pulled layers.'); return; } + if (force) Logger.verbose('Layers', 1, 'Forcing update to layer information...'); + + this.layers = []; Logger.verbose('Layers', 1, 'Pulling layers...'); const response = await axios.get( 'https://raw.githubusercontent.com/Squad-Wiki-Editorial/squad-wiki-pipeline-map-data/dev/completed_output/2.0/finished_2.0.json' ); - this.layers = []; for (const layer of response.data.Maps) { this.layers.push(new Layer(layer)); } Logger.verbose('Layers', 1, `Pulled ${this.layers.length} layers.`); + this.pulled = true; + return this.layers; } diff --git a/squad-server/plugins/chat-commands.js b/squad-server/plugins/chat-commands.js index 357bea4..9f0ca0f 100644 --- a/squad-server/plugins/chat-commands.js +++ b/squad-server/plugins/chat-commands.js @@ -38,7 +38,7 @@ export default class ChatCommands extends BasePlugin { async mount() { for (const command of this.options.commands) { - this.server.on(`CHAT_COMMAND:${command.command}`, async (data) => { + this.server.on(`CHAT_COMMAND:${command.command.toLowerCase()}`, async (data) => { if (command.ignoreChats.includes(data.chat)) return; if (command.type === 'broadcast') { diff --git a/squad-server/plugins/intervalled-broadcasts.js b/squad-server/plugins/intervalled-broadcasts.js index 71e5bf7..bb47f87 100644 --- a/squad-server/plugins/intervalled-broadcasts.js +++ b/squad-server/plugins/intervalled-broadcasts.js @@ -44,6 +44,6 @@ export default class IntervalledBroadcasts extends BasePlugin { async broadcast() { await this.server.rcon.broadcast(this.options.broadcasts[0]); - this.broadcasts.push(this.options.broadcasts.shift()); + this.options.broadcasts.push(this.options.broadcasts.shift()); } } diff --git a/squad-server/plugins/seeding-mode.js b/squad-server/plugins/seeding-mode.js index d4359c3..cde0ca1 100644 --- a/squad-server/plugins/seeding-mode.js +++ b/squad-server/plugins/seeding-mode.js @@ -63,7 +63,10 @@ export default class SeedingMode extends BasePlugin { } async broadcast() { - if (this.server.a2sPlayerCount !== 0 && this.server.a2sPlayerCount < this.options.liveThreshold) + if ( + this.server.a2sPlayerCount !== 0 && + this.server.a2sPlayerCount < this.options.seedingThreshold + ) await this.server.rcon.broadcast(this.options.seedingMessage); else if ( this.server.a2sPlayerCount !== 0 &&