From 0f98fd84dd3303b68d14aef6314d66c9dee5d8fe Mon Sep 17 00:00:00 2001 From: "elly1989@rocketmail.com" Date: Wed, 12 Sep 2012 00:44:13 +0000 Subject: [PATCH] Replaces the voting system. It should fix a pretty serious server-crashing exploit and simplify the code a fair bit. Removed all the voting-related adminverbs. It's all built into ooc vote verb. Admins can now make custom votes for literally anything. If a vote draws it will pick one of the winners at random. git-svn-id: http://tgstation13.googlecode.com/svn/trunk@4677 316c924e-a436-60f5-8080-3fe189b3f50e --- code/controllers/configuration.dm | 4 +- code/controllers/master_controller.dm | 2 + code/controllers/voting.dm | 233 +++++++++++++++++ code/datums/vote.dm | 353 -------------------------- code/global.dm | 1 - code/modules/admin/admin.dm | 131 ---------- code/modules/admin/admin_verbs.dm | 15 -- code/modules/client/client defines.dm | 2 - code/world.dm | 1 - config/config.txt | 8 +- tgstation.dme | 2 +- 11 files changed, 242 insertions(+), 510 deletions(-) create mode 100644 code/controllers/voting.dm delete mode 100644 code/datums/vote.dm diff --git a/code/controllers/configuration.dm b/code/controllers/configuration.dm index 4baa576d777..6e3d1e3e52d 100644 --- a/code/controllers/configuration.dm +++ b/code/controllers/configuration.dm @@ -21,8 +21,8 @@ var/allow_admin_jump = 1 // allows admin jumping var/allow_admin_spawning = 1 // allows admin item spawning var/allow_admin_rev = 1 // allows admin revives - var/vote_delay = 600 // minimum time between voting sessions (seconds, 10 minute default) - var/vote_period = 60 // length of voting period (seconds, default 1 minute) + var/vote_delay = 6000 // minimum time between voting sessions (deciseconds, 10 minute default) + var/vote_period = 600 // length of voting period (deciseconds, default 1 minute) var/vote_no_default = 0 // vote does not default to nochange/norestart (tbi) var/vote_no_dead = 0 // dead people can't vote (tbi) // var/enable_authentication = 0 // goon authentication diff --git a/code/controllers/master_controller.dm b/code/controllers/master_controller.dm index a681dbaa83c..0d5628b517e 100644 --- a/code/controllers/master_controller.dm +++ b/code/controllers/master_controller.dm @@ -107,6 +107,8 @@ datum/controller/game_controller/proc/process() var/start_time = world.timeofday controller_iteration++ + vote.process() + //AIR timer = world.timeofday last_thing_processed = air_master.type diff --git a/code/controllers/voting.dm b/code/controllers/voting.dm new file mode 100644 index 00000000000..cc870de1c3c --- /dev/null +++ b/code/controllers/voting.dm @@ -0,0 +1,233 @@ +var/datum/controller/vote/vote = new() + +datum/controller/vote + var/initiator = null + var/started_timeofday = null + var/time_remaining = 0 + var/mode = null + var/question = null + var/list/choices = list() + var/list/voted = list() + var/list/voting = list() + + New() + if(vote != src) + if(istype(vote)) + del(vote) + vote = src + + proc/process() //called by master_controller + if(mode) + time_remaining = started_timeofday + config.vote_period + if(world.timeofday < started_timeofday) + time_remaining -= 864000 + time_remaining = round((time_remaining - world.timeofday)/10) + + var/i=1 + if(time_remaining < 0) + result() + while(i<=voting.len) + var/client/C = voting[i] + if(C) + C << browse(null,"window=vote;can_close=0") + i++ + reset() + else + while(i<=voting.len) + var/client/C = voting[i] + if(C) + C << browse(vote.interface(C),"window=vote;can_close=0") + i++ + else + voting.Cut(i,i+1) + + proc/reset() + initiator = null + time_remaining = 0 + mode = null + question = null + choices.Cut() + voted.Cut() + voting.Cut() + + proc/get_result() + //get the highest number of votes + var/greatest_votes = 0 + for(var/option in choices) + var/votes = choices[option] + if(votes > greatest_votes) + greatest_votes = votes + //get all options with that many votes and return them in a list + . = list() + if(greatest_votes) + for(var/option in choices) + if(choices[option] == greatest_votes) + . += option + return . + + proc/announce_result() + var/list/winners = get_result() + var/text + if(winners.len > 0) + if(winners.len > 1) + text = "Vote Tied Between:\n" + for(var/option in winners) + text += "\t[option]\n" + . = pick(winners) + text += "Vote Result: [.]" + else + text += "Vote Result: Inconclusive - No Votes!" + log_vote(text) + world << "[text]" + return . + + proc/result() + . = announce_result() + var/restart = 0 + if(.) + switch(mode) + if("restart") + if(. == "Restart Round") + restart = 1 + if("gamemode") + if(master_mode != .) + world.save_mode(.) + if(ticker && ticker.mode) + restart = 1 + else + master_mode = . + + if(restart) + world << "World restarting due to vote..." + feedback_set_details("end_error","restart vote") + if(blackbox) blackbox.save_all_data_to_sql() + sleep(50) + log_game("Rebooting due to restart vote") + world.Reboot() + + return . + + proc/submit_vote(var/vote) + if(mode) + if(config.vote_no_dead && usr.stat == DEAD && !usr.client.holder) + return 0 + if(!(usr.ckey in voted)) + if(vote && 1<=vote && vote<=choices.len) + voted += usr.ckey + choices[choices[vote]]++ //check this + return vote + return 0 + + proc/initiate_vote(var/vote_type, var/initiator_key) + if(!mode) + if(started_timeofday != null) + var/next_allowed_timeofday = (started_timeofday + config.vote_delay) + if(world.timeofday < started_timeofday) + next_allowed_timeofday -= 864000 + if(next_allowed_timeofday > world.timeofday) + return 0 + + reset() + switch(vote_type) + if("restart") choices.Add("Restart Round","Continue Playing") + if("gamemode") choices.Add(config.votable_modes) + if("custom") + question = html_encode(input(usr,"What is the vote for?") as text|null) + if(!question) return 0 + for(var/i=1,i<=10,i++) + var/option = capitalize(html_encode(input(usr,"Please enter an option or hit cancel to finish") as text|null)) + if(!option || mode || !usr.client) break + choices.Add(option) + else return 0 + mode = vote_type + initiator = initiator_key + started_timeofday = world.timeofday + var/text = "[capitalize(mode)] vote started by [initiator]." + log_vote(text) + world << "[text]\nType vote to place your votes.\nYou have [config.vote_period/10] seconds to vote." + time_remaining = round(config.vote_period/10) + return 1 + return 0 + + proc/interface(var/client/C) + if(!C) return + var/admin = 0 + if(C.holder) + admin = 1 + voting |= C + + . = "Voting Panel" + if(mode) + if(question) . += "

Vote: '[question]'

" + else . += "

Vote: [capitalize(mode)]

" + . += "Time Left: [time_remaining] s

" + if(admin) + . += "(Cancel Vote) " + else + . += "

Start a vote:



" + . += "Close" + return . + + + Topic(href,href_list[],hsrc) + if(!usr || !usr.client) return //not necessary but meh...just in-case somebody does something stupid + switch(href_list["vote"]) + if("close") + voting -= usr.ckey + usr << browse(null, "window=vote") + return + if("cancel") + if(usr.client.holder) + reset() + if("toggle_restart") + if(usr.client.holder) + config.allow_vote_restart = !config.allow_vote_restart + if("toggle_gamemode") + if(usr.client.holder) + config.allow_vote_mode = !config.allow_vote_mode + if("restart") + if(config.allow_vote_restart || usr.client.holder) + initiate_vote("restart",usr.key) + if("gamemode") + if(config.allow_vote_mode || usr.client.holder) + initiate_vote("gamemode",usr.key) + if("custom") + if(usr.client.holder) + initiate_vote("custom",usr.key) + else + submit_vote(round(text2num(href_list["vote"]))) + usr.vote() + + +/mob/verb/vote() + set category = "OOC" + set name = "Vote" + + if(vote) + src << browse(vote.interface(client),"window=vote;can_close=0") \ No newline at end of file diff --git a/code/datums/vote.dm b/code/datums/vote.dm deleted file mode 100644 index 2ed3e5f651b..00000000000 --- a/code/datums/vote.dm +++ /dev/null @@ -1,353 +0,0 @@ -/datum/vote - var/voting = 0 // true if currently voting - var/nextvotetime = 0 // time at which next vote can be started - var/votetime = 60 // time at which voting will end - var/mode = 0 // 0 = restart vote, 1 = mode vote - // modes which can be voted for - var/winner = null // the vote winner - -/datum/vote/New() - - nextvotetime = world.timeofday // + 10*config.vote_delay - - -/datum/vote/proc/canvote()//marker1 - var/excess = world.timeofday - vote.nextvotetime - - if(excess < -10000) // handle clock-wrapping problems - very long delay (>20 hrs) if wrapped - vote.nextvotetime = world.timeofday - return 1 - return (excess >= 0) - -/datum/vote/proc/nextwait() - return timetext( round( (nextvotetime - world.timeofday)/10) ) - -/datum/vote/proc/endwait() - return timetext( round( (votetime - world.timeofday)/10) ) - -/datum/vote/proc/timetext(var/interval) - var/minutes = round(interval / 60) - var/seconds = round(interval % 60) - - var/tmin = "[minutes>0?num2text(minutes)+"min":null]" - var/tsec = "[seconds>0?num2text(seconds)+"sec":null]" - - if(tmin && tsec) // hack to skip inter-space if either field is blank - return "[tmin] [tsec]" - else - if(!tmin && !tsec) // return '0sec' if 0 time left - return "0sec" - return "[tmin][tsec]" - -/datum/vote/proc/getvotes() - var/list/L = list() - for(var/mob/M in player_list) - if(M.client && M.client.inactivity < 1200) // clients inactive for 2 minutes don't count - L[M.client.vote] += 1 - - return L - - -/datum/vote/proc/endvote() - - if(!voting) // means that voting was aborted by an admin - return - - world << "\red ***Voting has closed." - - log_vote("Voting closed, result was [winner]") - voting = 0 - nextvotetime = world.timeofday + 10*config.vote_delay - - for(var/mob/M in player_list) // clear vote window from all clients - if(M.client) - M << browse(null, "window=vote") - M.client.showvote = 0 - - calcwin() - - if(mode) - if(!ticker) - if(!going) - world << "The game will start soon." - going = 1 - var/wintext = capitalize(winner) - if(winner=="default") - world << "Result is \red No change." - return - - // otherwise change mode - - - world << "Result is change to \red [wintext]" - world.save_mode(winner) - - if(ticker && ticker.mode) - world <<"\red World will reboot in 10 seconds" - - feedback_set_details("end_error","mode vote - [winner]") - - if(blackbox) - blackbox.save_all_data_to_sql() - - sleep(100) - log_game("Rebooting due to mode vote") - world.Reboot() - else - master_mode = winner - - else - - if(winner=="default") - world << "Result is \red No restart." - return - - world << "Result is \red Restart round." - - world <<"\red World will reboot in 5 seconds" - - feedback_set_details("end_error","restart vote") - - if(blackbox) - blackbox.save_all_data_to_sql() - - sleep(50) - log_game("Rebooting due to restart vote") - world.Reboot() - return - - -/datum/vote/proc/calcwin() - - var/list/votes = getvotes() - - if(vote.mode) - var/best = -1 - - for(var/v in votes) - if(v=="none") - continue - if(best < votes[v]) - best = votes[v] - - - var/list/winners = list() - - for(var/v in votes) - if(votes[v] == best) - winners += v - - var/ret = "" - - - for(var/w in winners) - if(lentext(ret) > 0) - ret += "/" - if(w=="default") - winners = list("default") - ret = "No change" - break - else - ret += capitalize(w) - - - - if(winners.len != 1) - ret = "Tie: " + ret - - - if(winners.len == 0) - vote.winner = "default" - ret = "No change" - else - vote.winner = pick(winners) - - return ret - else - - if(votes["default"] < votes["restart"]) - - vote.winner = "restart" - return "Restart" - else - vote.winner = "default" - return "No restart" - - -/mob/verb/vote() - set category = "OOC" - set name = "Vote" - usr.client.showvote = 1 - - - var/text = "Voting" - - var/footer = "
Close" - - - if(config.vote_no_dead && usr.stat == 2) - text += "Voting while dead has been disallowed." - text += footer - usr << browse(text, "window=vote") - usr.client.showvote = 0 - usr.client.vote = "none" - return - - if(vote.voting) - // vote in progress, do the current - - text += "Vote to [vote.mode?"change mode":"restart round"] in progress.
" - text += "[vote.endwait()] until voting is closed.
" - - var/list/votes = vote.getvotes() - - if(vote.mode) // true if changing mode - - text += "Current game mode is: [master_mode].
Select the mode to change to:" - - text +="

Current winner: [vote.calcwin()]
" - - text += footer - - usr << browse(text, "window=vote") - - else // voting to restart - - text += "Restart the world?

" - - text +="

Current winner: [vote.calcwin()]
" - - text += footer - - usr << browse(text, "window=vote") - - - else //no vote in progress - - if(shuttlecoming == 1) - usr << "\blue Cannot start Vote - Shuttle has been called." - return - - if(!config.allow_vote_restart && !config.allow_vote_mode) - text += "

Player voting is disabled." - - usr << browse(text, "window=vote") - usr.client.showvote = 0 - return - - if(!vote.canvote()) // not time to vote yet - if(config.allow_vote_restart) text+="Voting to restart is enabled.
" - if(config.allow_vote_mode) text+="Voting to change mode is enabled.
" - - text+="

Next vote can begin in [vote.nextwait()]." - text+=footer - - usr << browse(text, "window=vote") - - else // voting can begin - if(config.allow_vote_restart) - text += "Begin restart vote.
" - if(config.allow_vote_mode) - text += "Begin change mode vote.
" - - text += footer - usr << browse(text, "window=vote") - - spawn(20) - if(usr.client && usr.client.showvote) - usr.vote() - else - usr << browse(null, "window=vote") - - return - - -/datum/vote/Topic(href, href_list) - ..() - //world << "[usr] has activated the vote Topic" - - if(href_list["voter"]) - world << "[usr.ckey] has attempted to bypass the voting system." //ckey is easy key - return - - if(href_list["vclose"]) - - if(usr) - usr << browse(null, "window=vote") - usr.client.showvote = 0 - return - - if(href_list["vmode"]) - if(vote.voting) - return - - if(!vote.canvote() ) // double check even though this shouldn't happen - return - - vote.mode = text2num(href_list["vmode"])-1 // hack to yield 0=restart, 1=changemode - if(!ticker && vote.mode == 1) - if(going) - world << "The game start has been delayed." - going = 0 - vote.voting = 1 // now voting - vote.votetime = world.timeofday + config.vote_period*10 // when the vote will end - - spawn(config.vote_period*10) - vote.endvote() - - world << "\red*** A vote to [vote.mode?"change game mode":"restart"] has been initiated by [usr.key]." - world << "\red You have [vote.timetext(config.vote_period)] to vote." - - log_vote("Voting to [vote.mode ? "change mode" : "restart round"] started by [usr.name]/[usr.key]") - - for(var/mob/CM in player_list) - if(CM.client) - if( config.vote_no_default || (config.vote_no_dead && CM.stat == 2) ) - CM.client.vote = "none" - else - CM.client.vote = "default" - - if(usr) usr.vote() - return - - - return - - if(href_list["vote"] && vote.voting) - if(usr) - usr.client.vote = href_list["vote"] - - //world << "Setting client [usr.key]'s vote to: [href_list["vote"]]." - - usr.vote() - return diff --git a/code/global.dm b/code/global.dm index e3158da50f6..0794cd3df25 100644 --- a/code/global.dm +++ b/code/global.dm @@ -111,7 +111,6 @@ var/list/alldirs = list(NORTH, SOUTH, EAST, WEST, NORTHEAST, NORTHWEST, SOUTHEAS var/datum/station_state/start_state = null var/datum/configuration/config = null -var/datum/vote/vote = null var/datum/sun/sun = null var/list/combatlog = list() diff --git a/code/modules/admin/admin.dm b/code/modules/admin/admin.dm index d9bffe848c3..eea1d2893d0 100644 --- a/code/modules/admin/admin.dm +++ b/code/modules/admin/admin.dm @@ -1437,14 +1437,6 @@ var/global/BSACooldown = 0 return create_mob(usr) else alert("You are not a high enough administrator! Sorry!!!!") - if (href_list["vmode"]) - vmode() - - if (href_list["votekill"]) - votekill() - - if (href_list["voteres"]) - voteres() if (href_list["prom_demot"]) if ((src.rank in list("Trial Admin", "Badmin", "Game Admin", "Game Master" ))) @@ -2973,135 +2965,12 @@ var/global/BSACooldown = 0 usr << browse(dat, "window=secrets") return -/obj/admins/proc/Voting() - - var/dat - var/lvl = 0 - switch(src.rank) - if("Moderator") - lvl = 1 - if("Temporary Admin") - lvl = 2 - if("Admin Candidate") - lvl = 3 - if("Trial Admin") - lvl = 4 - if("Badmin") - lvl = 5 - if("Game Admin") - lvl = 6 - if("Game Master") - lvl = 7 - - - dat += "

Voting

\n" - - if(lvl > 0) -// if(lvl >= 2 ) - dat += {" -Abort Vote
-Start Vote
-Toggle Voting
-"} - -// if(lvl >= 3 ) -// if(lvl >= 5) -// if(lvl == 6 ) - - usr << browse(dat, "window=admin2;size=210x160") - return - /////////////////////////////////////////////////////////////////////////////////////////////////admins2.dm merge //i.e. buttons/verbs -/obj/admins/proc/vmode() - set category = "Server" - set name = "Start Vote" - set desc="Starts vote" - if (!usr.client.holder) - return - var/confirm = alert("What vote would you like to start?", "Vote", "Restart", "Change Game Mode", "Cancel") - if(confirm == "Cancel") - return - if(confirm == "Restart") - vote.mode = 0 - // hack to yield 0=restart, 1=changemode - if(confirm == "Change Game Mode") - vote.mode = 1 - if(!ticker) - if(going) - world << "The game start has been delayed." - going = 0 - vote.voting = 1 - // now voting - vote.votetime = world.timeofday + config.vote_period*10 - // when the vote will end - spawn(config.vote_period*10) - vote.endvote() - world << "\red*** A vote to [vote.mode?"change game mode":"restart"] has been initiated by Admin [usr.key]." - world << "\red You have [vote.timetext(config.vote_period)] to vote." - - log_admin("Voting to [vote.mode?"change mode":"restart round"] forced by admin [key_name(usr)]") - - for(var/mob/CM in player_list) - if(config.vote_no_default || (config.vote_no_dead && CM.stat == 2)) - CM.client.vote = "none" - else - CM.client.vote = "default" - - for(var/mob/CM in player_list) - if(config.vote_no_default || (config.vote_no_dead && CM.stat == 2)) - CM.client.vote = "none" - else - CM.client.vote = "default" - feedback_add_details("admin_verb","SV") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! - -/obj/admins/proc/votekill() - set category = "Server" - set name = "Abort Vote" - set desc="Aborts a vote" - if(vote.voting == 0) - alert("No votes in progress") - return - world << "\red *** Voting aborted by [usr.client.stealth ? "Admin Candidate" : usr.key]." - - log_admin("Voting aborted by [key_name(usr)]") - - vote.voting = 0 - vote.nextvotetime = world.timeofday + 10*config.vote_delay - - for(var/mob/M in player_list) - // clear vote window from all clients - M << browse(null, "window=vote") - M.client.showvote = 0 - feedback_add_details("admin_verb","AV") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! - -/obj/admins/proc/voteres() - set category = "Server" - set name = "Toggle Voting" - set desc="Toggles Votes" - var/confirm = alert("What vote would you like to toggle?", "Vote", "Restart [config.allow_vote_restart ? "Off" : "On"]", "Change Game Mode [config.allow_vote_mode ? "Off" : "On"]", "Cancel") - if(confirm == "Cancel") - return - if(confirm == "Restart [config.allow_vote_restart ? "Off" : "On"]") - config.allow_vote_restart = !config.allow_vote_restart - world << "Player restart voting toggled to [config.allow_vote_restart ? "On" : "Off"]." - log_admin("Restart voting toggled to [config.allow_vote_restart ? "On" : "Off"] by [key_name(usr)].") - - if(config.allow_vote_restart) - vote.nextvotetime = world.timeofday - if(confirm == "Change Game Mode [config.allow_vote_mode ? "Off" : "On"]") - config.allow_vote_mode = !config.allow_vote_mode - world << "Player mode voting toggled to [config.allow_vote_mode ? "On" : "Off"]." - log_admin("Mode voting toggled to [config.allow_vote_mode ? "On" : "Off"] by [key_name(usr)].") - - if(config.allow_vote_mode) - vote.nextvotetime = world.timeofday - feedback_add_details("admin_verb","TV") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! - /obj/admins/proc/restart() set category = "Server" set name = "Restart" diff --git a/code/modules/admin/admin_verbs.dm b/code/modules/admin/admin_verbs.dm index c0b12646301..43f6f8f4ad6 100644 --- a/code/modules/admin/admin_verbs.dm +++ b/code/modules/admin/admin_verbs.dm @@ -117,9 +117,6 @@ verbs += /obj/admins/proc/toggleguests //Toggle guests entering verbs += /obj/admins/proc/toggleooc //toggle ooc verbs += /obj/admins/proc/toggleoocdead //toggle ooc for dead/unc - verbs += /obj/admins/proc/voteres //toggle votes - verbs += /obj/admins/proc/vmode - verbs += /obj/admins/proc/votekill verbs += /obj/admins/proc/show_player_panel verbs += /client/proc/deadchat //toggles deadchat //verbs += /client/proc/cmd_admin_mute --was never used (according to stats trackind) - use show player panel --erro @@ -136,7 +133,6 @@ verbs += /client/proc/unban_panel verbs += /client/proc/jobbans verbs += /client/proc/unjobban_panel - verbs += /client/proc/voting verbs += /client/proc/hide_verbs verbs += /client/proc/general_report verbs += /client/proc/air_report @@ -290,8 +286,6 @@ /client/proc/clear_admin_verbs() deadchat = 0 - verbs -= /obj/admins/proc/vmode - verbs -= /obj/admins/proc/votekill verbs -= /obj/admins/proc/announce verbs -= /obj/admins/proc/startnow verbs -= /obj/admins/proc/toggleAI //Toggle the AI @@ -299,7 +293,6 @@ verbs -= /obj/admins/proc/toggleguests //Toggle guests entering verbs -= /obj/admins/proc/toggleooc //toggle ooc verbs -= /obj/admins/proc/toggleoocdead //toggle ooc for dead/unc - verbs -= /obj/admins/proc/voteres //toggle votes verbs -= /obj/admins/proc/delay //game start delay verbs -= /obj/admins/proc/immreboot //immediate reboot verbs -= /obj/admins/proc/restart //restart @@ -383,7 +376,6 @@ verbs -= /client/proc/unban_panel verbs -= /client/proc/jobbans verbs -= /client/proc/unjobban_panel - verbs -= /client/proc/voting verbs -= /client/proc/hide_verbs verbs -= /client/proc/general_report verbs -= /client/proc/air_report @@ -546,13 +538,6 @@ feedback_add_details("admin_verb","S") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! return -/client/proc/voting() - set name = "Voting" - set category = "Admin" - if (holder) - holder.Voting() - feedback_add_details("admin_verb","VO") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! - /client/proc/colorooc() set category = "Fun" set name = "OOC Text Color" diff --git a/code/modules/client/client defines.dm b/code/modules/client/client defines.dm index e53d7536956..4380369973f 100644 --- a/code/modules/client/client defines.dm +++ b/code/modules/client/client defines.dm @@ -36,8 +36,6 @@ var/team = null var/be_alien = 0 //Check if that guy wants to be an alien var/be_pai = 1 //Consider client when searching for players to recruit as a pAI - var/vote = null - var/showvote = null var/activeslot = 1 //Default active slot! var/STFU_ghosts //80+ people rounds are fun to admin when text flies faster than airport security var/STFU_radio //80+ people rounds are fun to admin when text flies faster than airport security diff --git a/code/world.dm b/code/world.dm index ff132ad5871..387ffdd5e36 100644 --- a/code/world.dm +++ b/code/world.dm @@ -28,7 +28,6 @@ makepowernets() sun = new /datum/sun() - vote = new /datum/vote() radio_controller = new /datum/controller/radio() data_core = new /obj/effect/datacore() paiController = new /datum/paiController() diff --git a/config/config.txt b/config/config.txt index a8ac86f3533..b9800322487 100644 --- a/config/config.txt +++ b/config/config.txt @@ -86,11 +86,11 @@ ALLOW_METADATA ## allow players to initate a mode-change start #ALLOW_VOTE_MODE -## min delay (seconds) between voting sessions (default 10 minutes) -VOTE_DELAY 600 +## min delay (deciseconds) between voting sessions (default 10 minutes) +VOTE_DELAY 6000 -## time period (seconds) which voting session will last (default 1 minute) -VOTE_PERIOD 60 +## time period (deciseconds) which voting session will last (default 1 minute) +VOTE_PERIOD 600 ## prevents dead players from voting or starting votes # NO_DEAD_VOTE diff --git a/tgstation.dme b/tgstation.dme index a8b972874bb..a90afdde8af 100644 --- a/tgstation.dme +++ b/tgstation.dme @@ -51,6 +51,7 @@ #include "code\controllers\master_controller.dm" #include "code\controllers\shuttle_controller.dm" #include "code\controllers\verbs.dm" +#include "code\controllers\voting.dm" #include "code\datums\ai_laws.dm" #include "code\datums\computerfiles.dm" #include "code\datums\datacore.dm" @@ -64,7 +65,6 @@ #include "code\datums\spell.dm" #include "code\datums\sun.dm" #include "code\datums\supplypacks.dm" -#include "code\datums\vote.dm" #include "code\datums\diseases\alien_embryo.dm" #include "code\datums\diseases\appendicitis.dm" #include "code\datums\diseases\beesease.dm"