Stringified the vote #defines for easier config stuff

This commit is contained in:
Putnam
2020-10-18 14:49:43 -07:00
parent 44dc292101
commit 558d11bc73
4 changed files with 11 additions and 22 deletions

View File

@@ -1,9 +1,9 @@
#define PLURALITY_VOTING 0
#define APPROVAL_VOTING 1
#define SCHULZE_VOTING 2
#define SCORE_VOTING 3
#define MAJORITY_JUDGEMENT_VOTING 4
#define INSTANT_RUNOFF_VOTING 5
#define PLURALITY_VOTING "PLURALITY"
#define APPROVAL_VOTING "APPROVAL"
#define SCHULZE_VOTING "SCHULZE"
#define SCORE_VOTING "SCORE"
#define MAJORITY_JUDGEMENT_VOTING "MAJORITY_JUDGEMENT"
#define INSTANT_RUNOFF_VOTING "IRV"
#define SHOW_RESULTS (1<<0)
#define SHOW_VOTES (1<<1)
@@ -26,4 +26,4 @@ GLOBAL_LIST_INIT(display_vote_settings, list(\
"Ongoing Votes" = SHOW_VOTES,
"Winner" = SHOW_WINNER,
"Abstainers" = SHOW_ABSTENTION
))
))

View File

@@ -290,7 +290,7 @@
/datum/config_entry/flag/tgstyle_maprotation
/datum/config_entry/string/map_vote_type
config_entry_value = "SCORE"
config_entry_value = APPROVAL_VOTING
/datum/config_entry/number/maprotatechancedelta
config_entry_value = 0.75

View File

@@ -482,18 +482,7 @@ SUBSYSTEM_DEF(ticker)
INVOKE_ASYNC(SSmapping, /datum/controller/subsystem/mapping/.proc/maprotate)
else
var/vote_type = CONFIG_GET(string/map_vote_type)
switch(vote_type)
if("PLURALITY")
SSvote.initiate_vote("map","server", display = SHOW_RESULTS)
if("APPROVAL")
SSvote.initiate_vote("map","server", display = SHOW_RESULTS, votesystem = APPROVAL_VOTING)
if("IRV")
SSvote.initiate_vote("map","server", display = SHOW_RESULTS, votesystem = INSTANT_RUNOFF_VOTING)
if("SCORE")
SSvote.initiate_vote("map","server", display = SHOW_RESULTS, votesystem = MAJORITY_JUDGEMENT_VOTING)
else
SSvote.initiate_vote("map","server", display = SHOW_RESULTS)
// fallback
SSvote.initiate_vote("map","server", display = SHOW_RESULTS, votesystem = vote_type)
/datum/controller/subsystem/ticker/proc/HasRoundStarted()
return current_state >= GAME_STATE_PLAYING

View File

@@ -408,7 +408,7 @@ ALLOW_MAP_VOTING 1
## APPROVAL (can vote for as many as you want), I
## IRV (vote by ranked choice, winner determined by instant runoff algorithm)
## SCORE (give individual rankings of each choice, winner determined by majority judgement algorithm)
MAP_VOTE_TYPE SCORE
MAP_VOTE_TYPE APPROVAL
## Map rotate chance delta
## This is the chance of map rotation factored to the round length.
@@ -519,7 +519,7 @@ DEFAULT_VIEW 21x15
### NOTE FOR LINUX HOSTS: This requires manual setup of iptables. Beware that improper configuration of this can and will irreversibly fuck up a server, so please don't tinker with it if you don't know what you're doing.
## Enabled
#FAIL2TOPIC_ENABLED
## Minimum wait time in deciseconds between valid requests
## Minimum wait time in deciseconds between valid requests
FAIL2TOPIC_RATE_LIMIT 10
## Number of requests after breaching rate limit that triggers a ban
FAIL2TOPIC_MAX_FAILS 5