squad-js-map-vote/README.MD

356 lines
9.0 KiB
Plaintext
Raw Normal View History

2022-09-06 07:23:04 -05:00
## MapVote
The `MapVote` plugin for squad js based on the original version https://github.com/maskedmonkyman/squad-js-map-vote
### Commands
#### User Commands
- `!vote help` - sends possbile commands to a player in the from of a warning
- `!vote choices` - sends choices to player in the from of a warning
- `!vote results` - sends player the results in a warning
#### Admin Commands
- `!vote start` - Starts a vote with 6 layers, random modes
- `!vote cancel` - Cancels current round of voting
2022-09-28 15:42:53 -05:00
- `!vote cancelauto` - Cancel scheduled automatic start of vote
2022-10-25 12:51:05 -05:00
- `!vote end` - Gently ends the current vote and announces the winner layer
- `!vote restart` - Restarts voting with 6 random maps and modes
- `!vote broadcast` - Broadcasts current voting results - happens every 7m automatically
2023-03-01 06:18:42 -06:00
- `!vote endmatch` - Ends the current match
##### Vote by modes
- `!vote start *_raas` - Starts a vote with 6 layers, all RAAS
- `!vote start *_aas` - Starts a vote with 6 layers, all AAS
- `!vote start *_inv` - Starts a vote with 6 layers, all INV
2023-03-14 20:24:33 -05:00
##### Vote by faction
- `!vote start f:rus` - Starts a vote with 6 layers, all with RUS faction
- `!vote start f:aus` - Starts a vote with 6 layers, all with AUS faction
- `!vote start f:mea f:caf f:usa` - Starts a vote with 3 layers, 1 with MEA faction, 1 with CAF faction and 1 with USA faction
##### Vote by map
- `!vote start yeh gor lash gor albas` - Starts a vote with X maps, random modes
##### Vote by map + mode, mixed
- `!vote start yeh_raas gor_raas lash_inv gor albas_inv` - Starts a vote with X maps, X modes
2022-09-06 07:23:04 -05:00
### Options
#### commandPrefix
###### Description
The command name to use in chat.
###### Default
```
!vote
```
2023-02-28 16:54:37 -06:00
#### entryFormat
###### Description
The format of an entry in the voting list.
###### Default
```json
2023-02-28 16:57:08 -06:00
"{map_name} {gamemode} {map_version} {factions} {main_assets}"
2023-02-28 16:54:37 -06:00
```
2023-01-25 17:21:34 -06:00
#### entriesAmount
###### Description
Amount of entries generated for automatic votes.
###### Default
```json
6
```
2022-10-20 16:59:28 -05:00
#### 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
```
2022-09-06 07:23:04 -05:00
#### minPlayersForVote
###### Description
The number of players needed on the server for a vote to start.
###### Default
2022-10-20 16:59:28 -05:00
```json
40
2022-09-06 07:23:04 -05:00
```
#### voteWaitTimeFromMatchStart
###### Description
The time in mins from the start of a round to the start of a new map vote.
###### Default
2022-10-20 16:59:28 -05:00
```json
15
2022-09-06 07:23:04 -05:00
```
#### voteBroadcastInterval
###### Description
The broadcast interval for vote notification in mins.
###### Default
2022-10-20 16:59:28 -05:00
```json
2022-09-06 07:23:04 -05:00
7
```
#### automaticSeedingMode
###### Description
2022-09-08 04:52:50 -05:00
Instantly change to a seeding layer if server has less than 5 players and set next layer to a seeding layer if server has less than 20 players.
2022-09-06 07:23:04 -05:00
###### Default
```json
true
```
#### numberRecentMapsToExlude
###### Description
The random layer list will not include the X recent maps
###### Default
2022-10-20 16:59:28 -05:00
```json
4
```
2022-09-06 07:23:04 -05:00
#### gamemodeWhitelist
###### Description
The random layer list will be generated with only selected gamemodes.
###### Default
```json
[ "AAS", "RAAS", "INVASION" ]
```
2022-09-21 09:46:11 -05:00
#### layerFilteringMode
###### Description
Select Whitelist mode or Blacklist mode.
###### Default
```json
"blacklist"
```
#### layerLevelWhitelist
###### Description
The random layer list will include ONLY the whitelisted layers or levels. (acceptable formats: Gorodok/Gorodok_RAAS/Gorodok_AAS_v1).
###### Default
```
[]
```
2022-09-06 07:23:04 -05:00
#### layerLevelBlacklist
###### Description
2022-09-21 09:46:11 -05:00
The random layer list will NOT include the blacklisted layers or levels. (acceptable formats: Gorodok/Gorodok_RAAS/Gorodok_AAS_v1).
2022-09-06 07:23:04 -05:00
###### Default
```
[]
```
#### applyBlacklistToWhitelist
###### Description
If set to true the blacklisted layers will be filtered out also in whitelist mode.
###### Default
```json
true
```
2022-11-18 13:30:14 -06:00
#### factionsBlacklist
###### Description
factions to exclude in map vote. ( ex: ['CAF'] )
###### Default
```json
[]
```
2023-03-31 19:57:07 -05:00
#### minGamemodeEntries
###### Description
2023-03-31 19:57:07 -05:00
Minimum amount layers in the vote list per gamemode.
###### Default
```json
2023-03-31 19:57:07 -05:00
{
"raas": 2,
"aas": 2,
"invasion": 0
}
```
2022-09-15 18:07:54 -05:00
#### hideVotesCount
###### Description
Hides the number of votes a layer received in broadcast message.
###### Default
```json
false
```
#### showRerollOption
###### Description
vote option to restart the vote with random entries.
###### Default
```json
false
```
2023-01-25 17:21:34 -06:00
#### showRerollOptionInCustomVotes
###### Description
Enables/disables the reroll option only in custom votes. showRerollOption must be set to true.
###### Default
```json
false
```
2022-09-16 15:41:55 -05:00
#### voteBroadcastMessage
###### Description
Message that is sent as broadcast to announce a vote.
###### Default
2022-09-16 16:36:48 -05:00
```json
"✯ MAPVOTE ✯\nVote for the next map by writing in chat the corresponding number!"
```
#### voteWinnerBroadcastMessage
###### Description
Message that is sent as broadcast to announce the winning layer.
###### Default
```json
"✯ MAPVOTE ✯\nThe winning layer is\n\n"
2022-09-16 15:41:55 -05:00
```
#### showWinnerBroadcastMessage
###### Description
Enables the broadcast at the end of the voting.
###### Default
```json
true
```
#### allowedSameMapEntries
###### Description
2022-10-03 18:06:56 -05:00
Allowed max NUMBER of times a map could appear in the vote list.
###### Default
```json
1
```
2022-09-16 16:36:48 -05:00
#### logToDiscord
###### Description
Enables/disables vote logging to Discord.
###### Default
```json
false
```
#### channelID
###### Description
2022-09-17 18:28:37 -05:00
The ID of the channel to log votes to.
2022-09-16 16:36:48 -05:00
###### Default
```json
"112233445566778899"
2022-09-16 15:41:55 -05:00
```
2022-11-21 08:15:11 -06:00
#### persistentDataFile
###### Description
Path to file in which to store important data that should be restored after a restart.
###### Important
Make sure the persistent data file is not inside the plugin folder.
###### Default
```json
""
```
2022-09-20 16:21:05 -05:00
#### timezone
###### Description
Timezone relative to UTC time. 0 for UTC, 2 for CEST (UTC+2), -1 (UTC-1)
###### Default
```json
0
```
2022-09-17 18:28:37 -05:00
#### timeFrames
###### Description
Array of timeframes that allows to override options based on local time. See example configuration
###### Default
```json
[]
```
2023-03-17 19:48:06 -05:00
#### minimumVotesToAcceptResult
###### Description
Minimum votes per map to accept result.
Can be used to prevent situation when insignificant number of players decide what map should be next, but most still wants to play map according to rotation.
###### Default
```json
1
```
#### seedingGameMode
###### Description
Gamemode used in seeding mode.
###### Default
```json
"Seed"
```
#### instantSeedingModePlayerCount
###### Description
Required player count to trigger an instant layer change to a seeding layer.
###### Default
```json
5
```
#### nextLayerSeedingModePlayerCount
###### Description
Required player count to change the next layer to a seeding layer.
###### Default
```json
20
```
2023-04-19 16:03:22 -05:00
#### developersAreAdmins
###### Description
Developers of this plugin are allowed to run admin commands in anychat.
###### Default
```json
true
```
2022-09-18 07:19:22 -05:00
###### Timeframe format
```javascript
{
2022-09-18 07:22:11 -05:00
name: "friendly name", // a friendly name visible in the logs
start: "12:00", // timeframe start time <hour>:<minutes>
end: "18:00", // timeframe end time <hour>:<minutes>
overrides: { // options to override
automaticVoteStart: false,
layerLevelBlacklist: [ "Anvil", "Chora" ]
2022-09-18 07:19:22 -05:00
}
2022-09-18 07:23:04 -05:00
}
2022-09-18 07:19:22 -05:00
```
2022-09-06 07:23:04 -05:00
### Example configuration
```json
2022-09-06 07:23:48 -05:00
{
2022-09-06 07:13:23 -05:00
"plugin": "MapVote",
"enabled": true,
2022-09-16 18:36:04 -05:00
"discordClient": "discord",
"entriesAmount": 6,
2023-02-28 16:57:08 -06:00
"entryFormat": "{map_name} {gamemode} {map_version} {factions} {main_assets}",
"automaticVoteStart": true,
2022-10-20 16:59:28 -05:00
"votingDuration": 0,
2022-09-06 07:13:23 -05:00
"minPlayersForVote": 30,
"voteWaitTimeFromMatchStart": 10,
"voteBroadcastInterval": 7,
"numberRecentMapsToExlude": 4,
"automaticSeedingMode": true,
"gamemodeWhitelist": [ "AAS", "RAAS", "Invasion" ],
2022-09-15 18:07:54 -05:00
"layerLevelBlacklist": [ "BlackCoast_Seed" ],
"layerLevelWhitelist": [ "Yeho", "Gorodok", "Mutaha", "Narva", "Tallil" ],
2022-10-20 16:59:28 -05:00
"applyBlacklistToWhitelist": true,
2022-11-18 13:30:14 -06:00
"factionsBlacklist": [ "CAF", "INS" ],
2022-09-15 18:07:54 -05:00
"hideVotesCount": false,
2023-01-25 17:21:34 -06:00
"showRerollOption": true,
"showRerollOptionInCustomVotes": false,
"voteBroadcastMessage": "✯ MAPVOTE ✯\nVote for the next map by writing in chat the corresponding number!",
"voteWinnerBroadcastMessage": "✯ MAPVOTE ✯\nThe winning layer is\n\n",
"showWinnerBroadcastMessage": true,
"allowedSameMapEntries": 1,
2022-09-16 18:36:04 -05:00
"logToDiscord": true,
"channelID": "112233445566778899",
2022-11-21 08:15:11 -06:00
"persistentDataFile": "",
2022-09-20 16:21:05 -05:00
"timezone": 2,
"minimumVotesToAcceptResult": 1,
2023-03-17 19:48:06 -05:00
"instantSeedingModePlayerCount": 5,
"nextLayerSeedingModePlayerCount": 20,
"seedingGameMode": "Seed",
2023-04-19 16:03:22 -05:00
"developersAreAdmins": true,
2023-03-31 19:57:07 -05:00
"minGamemodeEntries": {
"raas": 2,
"aas": 2,
"invasion": 0
},
2022-09-17 17:41:09 -05:00
"timeFrames": [
{
2022-09-17 18:28:37 -05:00
"name": "follow layer rotation list",
"start": "12:00",
"end": "18:00",
"overrides": {
"automaticVoteStart": false
}
},
{
"start": "22:00",
"end": "02:00",
"overrides": {
"voteBroadcastMessage": "Late night games? Vote your favourite map!"
}
}
]
2022-09-17 18:32:41 -05:00
}
2022-09-06 07:23:04 -05:00
```