From 5750c42e482aad108001c61b4988321a135c3757 Mon Sep 17 00:00:00 2001 From: Luis Martin Schick Date: Tue, 15 Sep 2020 10:46:35 +0200 Subject: [PATCH 1/5] Changed instant win condition to 50% of players instead of 50 players. --- plugins/skipmap/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/skipmap/index.js b/plugins/skipmap/index.js index 81769d36..2f387f9e 100644 --- a/plugins/skipmap/index.js +++ b/plugins/skipmap/index.js @@ -184,7 +184,7 @@ export default { playerVotes[info.steamID] = info.message; // If 50 people voted in favour, instantly win the vote - if (votePos >= 50) { + if (votePos > server.players.length / 2) { await server.rcon.broadcast( `The vote to skip the current map has passed. ${votePos} voted in favour, ${voteNeg} against.` ); From 76d478f9cad7d177b6f3a6604864c7c466927bbc Mon Sep 17 00:00:00 2001 From: Luis Martin Schick Date: Wed, 16 Sep 2020 10:27:42 +0200 Subject: [PATCH 2/5] Fixed minimumVotes bug --- plugins/skipmap/index.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/plugins/skipmap/index.js b/plugins/skipmap/index.js index 2f387f9e..9152b6bf 100644 --- a/plugins/skipmap/index.js +++ b/plugins/skipmap/index.js @@ -78,6 +78,7 @@ export default { (server.layerHistory[0].time + options.startTimer - Date.now()) / 1000 ); const minutes = Math.floor(seconds / 60); + console.log(minutes, seconds); await server.rcon.warn( info.steamID, @@ -115,6 +116,7 @@ export default { voteNeg = 0; playerVotes = {}; playerVotes[info.steamID] = '+'; + timeLastVote = new Date(); // As a vote happened, stop any further votes from happening until enough time has passed // Set reminders intervalReminderBroadcasts = setInterval(async () => { @@ -132,7 +134,7 @@ export default { voteActive = false; clearInterval(intervalReminderBroadcasts); // Check if enough people voted - if (voteNeg + votePos < options.minVoteCount) { + if (voteNeg + votePos < options.minimumVotes) { server.rcon.broadcast('Not enough people voted for the vote to go through.'); return; } @@ -146,8 +148,6 @@ export default { `Not enough people voted in favour of skipping the match. ${votePos} voted in favour, ${voteNeg} against.` ); } - // As a vote happened, stop any further votes from happening until enough time has passed - timeLastVote = new Date(); }, options.voteDuration); }); @@ -183,7 +183,7 @@ export default { playerVotes[info.steamID] = info.message; - // If 50 people voted in favour, instantly win the vote + // If 50% of people voted in favour, instantly win the vote if (votePos > server.players.length / 2) { await server.rcon.broadcast( `The vote to skip the current map has passed. ${votePos} voted in favour, ${voteNeg} against.` From cd619a3c95796c8ebd9e51d023f671b4ddf5e8d5 Mon Sep 17 00:00:00 2001 From: Luis Martin Schick Date: Wed, 16 Sep 2020 10:30:22 +0200 Subject: [PATCH 3/5] Removed debug code --- plugins/skipmap/index.js | 1 - 1 file changed, 1 deletion(-) diff --git a/plugins/skipmap/index.js b/plugins/skipmap/index.js index 9152b6bf..d26b7bce 100644 --- a/plugins/skipmap/index.js +++ b/plugins/skipmap/index.js @@ -78,7 +78,6 @@ export default { (server.layerHistory[0].time + options.startTimer - Date.now()) / 1000 ); const minutes = Math.floor(seconds / 60); - console.log(minutes, seconds); await server.rcon.warn( info.steamID, From 2a2461454f4954c650fff571964d90b85c54400b Mon Sep 17 00:00:00 2001 From: Thomas Smyth Date: Sun, 20 Sep 2020 20:46:13 +0100 Subject: [PATCH 4/5] Update skipmap docs --- README.md | 2 +- plugins/skipmap/index.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index f0440b9a..dd09bf7b 100644 --- a/README.md +++ b/README.md @@ -710,7 +710,7 @@ Grafana:
600000

minimumVotes

Description
-

The minimum required amount of votes for the vote to go through

+

The minimum percentage of people required to vote for the vote to go through.

Default
20

reminderInterval

diff --git a/plugins/skipmap/index.js b/plugins/skipmap/index.js index d26b7bce..b6ed4541 100644 --- a/plugins/skipmap/index.js +++ b/plugins/skipmap/index.js @@ -40,7 +40,7 @@ export default { minimumVotes: { required: false, - description: 'The minimum required amount of votes for the vote to go through', + description: 'The minimum percentage of people required to vote for the vote to go through.', default: 20 }, From bff3fc0c689ed4b4e90e0ddc82cbc2930f22561f Mon Sep 17 00:00:00 2001 From: Thomas Smyth Date: Sun, 20 Sep 2020 20:47:23 +0100 Subject: [PATCH 5/5] SquadJS v1.4.2 Release --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 20503b18..c004669f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "SquadJS", - "version": "1.4.1", + "version": "1.4.2", "repository": "https://github.com/Thomas-Smyth/SquadJS.git", "author": "Thomas Smyth ", "license": "BSL-1.0",