mirror of
https://github.com/AsgardEternal/squad-js-map-vote.git
synced 2025-01-23 20:43:52 -06:00
added voting duration option
This commit is contained in:
parent
9c753932aa
commit
5b09c79881
24
README.MD
24
README.MD
@ -35,25 +35,39 @@ The command name to use in chat.
|
|||||||
```
|
```
|
||||||
!vote
|
!vote
|
||||||
```
|
```
|
||||||
|
#### automaticVoteStart
|
||||||
|
###### Description
|
||||||
|
A map vote will automatically start after a new match if set to true.
|
||||||
|
###### Default
|
||||||
|
```json
|
||||||
|
true
|
||||||
|
```
|
||||||
|
#### votingDuration
|
||||||
|
###### Description
|
||||||
|
How long the voting will be active (in minutes). Set to 0 for unlimited time.
|
||||||
|
###### Default
|
||||||
|
```json
|
||||||
|
0
|
||||||
|
```
|
||||||
#### minPlayersForVote
|
#### minPlayersForVote
|
||||||
###### Description
|
###### Description
|
||||||
The number of players needed on the server for a vote to start.
|
The number of players needed on the server for a vote to start.
|
||||||
###### Default
|
###### Default
|
||||||
```
|
```json
|
||||||
40
|
40
|
||||||
```
|
```
|
||||||
#### voteWaitTimeFromMatchStart
|
#### voteWaitTimeFromMatchStart
|
||||||
###### Description
|
###### Description
|
||||||
The time in mins from the start of a round to the start of a new map vote.
|
The time in mins from the start of a round to the start of a new map vote.
|
||||||
###### Default
|
###### Default
|
||||||
```
|
```json
|
||||||
15
|
15
|
||||||
```
|
```
|
||||||
#### voteBroadcastInterval
|
#### voteBroadcastInterval
|
||||||
###### Description
|
###### Description
|
||||||
The broadcast interval for vote notification in mins.
|
The broadcast interval for vote notification in mins.
|
||||||
###### Default
|
###### Default
|
||||||
```
|
```json
|
||||||
7
|
7
|
||||||
```
|
```
|
||||||
#### automaticSeedingMode
|
#### automaticSeedingMode
|
||||||
@ -67,7 +81,7 @@ true
|
|||||||
###### Description
|
###### Description
|
||||||
The random layer list will not include the X recent maps
|
The random layer list will not include the X recent maps
|
||||||
###### Default
|
###### Default
|
||||||
```
|
```json
|
||||||
4
|
4
|
||||||
```
|
```
|
||||||
#### gamemodeWhitelist
|
#### gamemodeWhitelist
|
||||||
@ -180,6 +194,7 @@ Array of timeframes that allows to override options based on local time. See exa
|
|||||||
"enabled": true,
|
"enabled": true,
|
||||||
"discordClient": "discord",
|
"discordClient": "discord",
|
||||||
"automaticVoteStart": true,
|
"automaticVoteStart": true,
|
||||||
|
"votingDuration": 0,
|
||||||
"minPlayersForVote": 30,
|
"minPlayersForVote": 30,
|
||||||
"voteWaitTimeFromMatchStart": 10,
|
"voteWaitTimeFromMatchStart": 10,
|
||||||
"voteBroadcastInterval": 7,
|
"voteBroadcastInterval": 7,
|
||||||
@ -188,6 +203,7 @@ Array of timeframes that allows to override options based on local time. See exa
|
|||||||
"gamemodeWhitelist": [ "AAS", "RAAS", "Invasion" ],
|
"gamemodeWhitelist": [ "AAS", "RAAS", "Invasion" ],
|
||||||
"layerLevelBlacklist": [ "BlackCoast_Seed" ],
|
"layerLevelBlacklist": [ "BlackCoast_Seed" ],
|
||||||
"layerLevelWhitelist": [ "Yeho", "Gorodok", "Mutaha", "Narva", "Tallil" ],
|
"layerLevelWhitelist": [ "Yeho", "Gorodok", "Mutaha", "Narva", "Tallil" ],
|
||||||
|
"applyBlacklistToWhitelist": true,
|
||||||
"hideVotesCount": false,
|
"hideVotesCount": false,
|
||||||
"showRerollOption": false,
|
"showRerollOption": false,
|
||||||
"voteBroadcastMessage": "✯ MAPVOTE ✯ Vote for the next map by writing in chat the corresponding number!",
|
"voteBroadcastMessage": "✯ MAPVOTE ✯ Vote for the next map by writing in chat the corresponding number!",
|
||||||
|
13
mapvote.js
13
mapvote.js
@ -31,6 +31,11 @@ export default class MapVote extends DiscordBasePlugin {
|
|||||||
description: "a map vote will automatically start after a new match if set to true",
|
description: "a map vote will automatically start after a new match if set to true",
|
||||||
default: true
|
default: true
|
||||||
},
|
},
|
||||||
|
votingDuration: {
|
||||||
|
required: false,
|
||||||
|
description: "How long the voting will be active (in minutes). Set to 0 for unlimited time.",
|
||||||
|
default: 0
|
||||||
|
},
|
||||||
minPlayersForVote:
|
minPlayersForVote:
|
||||||
{
|
{
|
||||||
required: false,
|
required: false,
|
||||||
@ -559,13 +564,11 @@ export default class MapVote extends DiscordBasePlugin {
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
if (playerCount < minPlayers && !force) {
|
if (playerCount < minPlayers && !force) {
|
||||||
if (this.onConnectBound == false) {
|
this.autovotestart = setTimeout(() => { this.beginVoting(force, steamid, cmdLayers) }, 60 * 1000)
|
||||||
setTimeout(() => { this.beginVoting(force, null, cmdLayers) }, 60 * 1000)
|
|
||||||
this.onConnectBound = true;
|
|
||||||
}
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
this.onConnectBound = false;
|
|
||||||
|
if (this.options.votingDuration > 0) setTimeout(this.endVoting, this.options.votingDuration * 60 * 1000)
|
||||||
|
|
||||||
// these need to be reset after reenabling voting
|
// these need to be reset after reenabling voting
|
||||||
this.trackedVotes = {};
|
this.trackedVotes = {};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user