Merge branch 'master' of https://github.com/ParadiseSS13/Paradise into space_ruins

All hail glorious leader tigercat
This commit is contained in:
Crazylemon64
2016-07-08 00:16:28 -07:00
928 changed files with 8857 additions and 8457 deletions
@@ -171,7 +171,7 @@
main.restartProcess(src.name)
/datum/controller/process/proc/kill()
if (!killed)
if(!killed)
var/msg = "[name] process was killed at tick #[ticks]."
log_debug(msg)
message_admins(msg)
@@ -186,22 +186,22 @@
// Do not call this directly - use SHECK or SCHECK_EVERY
/datum/controller/process/proc/sleepCheck(var/tickId = 0)
calls_since_last_scheck = 0
if (killed)
if(killed)
// The kill proc is the only place where killed is set.
// The kill proc should have deleted this datum, and all sleeping procs that are
// owned by it.
CRASH("A killed process is still running somehow...")
if (hung)
if(hung)
// This will only really help if the doWork proc ends up in an infinite loop.
handleHung()
CRASH("Process [name] hung and was restarted.")
if (main.getCurrentTickElapsedTime() > main.timeAllowance)
if(main.getCurrentTickElapsedTime() > main.timeAllowance)
sleep(world.tick_lag)
cpu_defer_count++
last_slept = 0
else
if (TimeOfTick > last_slept + sleep_interval)
if(TimeOfTick > last_slept + sleep_interval)
// If we haven't slept in sleep_interval deciseconds, sleep to allow other work to proceed.
sleep(0)
last_slept = TimeOfTick
@@ -213,14 +213,14 @@
var/elapsedTime = getElapsedTime()
if (hung)
if(hung)
handleHung()
return
else if (elapsedTime > hang_restart_time)
else if(elapsedTime > hang_restart_time)
hung()
else if (elapsedTime > hang_alert_time)
else if(elapsedTime > hang_alert_time)
setStatus(PROCESS_STATUS_PROBABLY_HUNG)
else if (elapsedTime > hang_warning_time)
else if(elapsedTime > hang_warning_time)
setStatus(PROCESS_STATUS_MAYBE_HUNG)
@@ -66,7 +66,7 @@ var/global/datum/controller/processScheduler/processScheduler
* this treatment.
*/
/datum/controller/processScheduler/proc/deferSetupFor(var/processPath)
if (!(processPath in deferredSetupList))
if(!(processPath in deferredSetupList))
deferredSetupList += processPath
/datum/controller/processScheduler/proc/setup()
@@ -77,11 +77,11 @@ var/global/datum/controller/processScheduler/processScheduler
var/process
// Add all the processes we can find, except for the ticker
for (process in subtypesof(/datum/controller/process))
if (!(process in deferredSetupList))
for(process in subtypesof(/datum/controller/process))
if(!(process in deferredSetupList))
addProcess(new process(src))
for (process in deferredSetupList)
for(process in deferredSetupList)
addProcess(new process(src))
/datum/controller/processScheduler/proc/start()
@@ -114,7 +114,7 @@ var/global/datum/controller/processScheduler/processScheduler
for(var/datum/controller/process/p in running)
p.update()
if (isnull(p)) // Process was killed
if(isnull(p)) // Process was killed
continue
var/status = p.getStatus()
@@ -132,11 +132,11 @@ var/global/datum/controller/processScheduler/processScheduler
/datum/controller/processScheduler/proc/queueProcesses()
for(var/datum/controller/process/p in processes)
// Don't double-queue, don't queue running processes
if (p.disabled || p.running || p.queued || !p.idle)
if(p.disabled || p.running || p.queued || !p.idle)
continue
// If the process should be running by now, go ahead and queue it
if (world.time >= last_queued[p] + p.schedule_interval)
if(world.time >= last_queued[p] + p.schedule_interval)
setQueuedProcessState(p)
/datum/controller/processScheduler/proc/runQueuedProcesses()
@@ -217,34 +217,34 @@ var/global/datum/controller/processScheduler/processScheduler
recordEnd(process)
/datum/controller/processScheduler/proc/setIdleProcessState(var/datum/controller/process/process)
if (process in running)
if(process in running)
running -= process
if (process in queued)
if(process in queued)
queued -= process
if (!(process in idle))
if(!(process in idle))
idle += process
/datum/controller/processScheduler/proc/setQueuedProcessState(var/datum/controller/process/process)
if (process in running)
if(process in running)
running -= process
if (process in idle)
if(process in idle)
idle -= process
if (!(process in queued))
if(!(process in queued))
queued += process
// The other state transitions are handled internally by the process.
process.queued()
/datum/controller/processScheduler/proc/setRunningProcessState(var/datum/controller/process/process)
if (process in queued)
if(process in queued)
queued -= process
if (process in idle)
if(process in idle)
idle -= process
if (!(process in running))
if(!(process in running))
running += process
/datum/controller/processScheduler/proc/recordStart(var/datum/controller/process/process, var/time = null)
if (isnull(time))
if(isnull(time))
time = TimeOfGame
last_queued[process] = world.time
last_start[process] = time
@@ -253,7 +253,7 @@ var/global/datum/controller/processScheduler/processScheduler
last_start[process] = time
/datum/controller/processScheduler/proc/recordEnd(var/datum/controller/process/process, var/time = null)
if (isnull(time))
if(isnull(time))
time = TimeOfGame
var/lastRunTime = time - last_start[process]
@@ -273,7 +273,7 @@ var/global/datum/controller/processScheduler/processScheduler
highest_run_time[process] = time
var/list/lastTwenty = last_twenty_run_times[process]
if (lastTwenty.len == 20)
if(lastTwenty.len == 20)
lastTwenty.Cut(1, 2)
lastTwenty.len++
lastTwenty[lastTwenty.len] = time
@@ -304,7 +304,7 @@ var/global/datum/controller/processScheduler/processScheduler
/datum/controller/processScheduler/proc/getStatusData()
var/list/data = new
for (var/datum/controller/process/p in processes)
for(var/datum/controller/process/p in processes)
data.len++
data[data.len] = p.getContextData()
@@ -314,14 +314,14 @@ var/global/datum/controller/processScheduler/processScheduler
return processes.len
/datum/controller/processScheduler/proc/hasProcess(var/processName as text)
if (nameToProcessMap[processName])
if(nameToProcessMap[processName])
return 1
/datum/controller/processScheduler/proc/killProcess(var/processName as text)
restartProcess(processName)
/datum/controller/processScheduler/proc/restartProcess(var/processName as text)
if (hasProcess(processName))
if(hasProcess(processName))
var/datum/controller/process/oldInstance = nameToProcessMap[processName]
var/datum/controller/process/newInstance = new oldInstance.type(src)
newInstance._copyStateFrom(oldInstance)
@@ -329,24 +329,24 @@ var/global/datum/controller/processScheduler/processScheduler
oldInstance.kill()
/datum/controller/processScheduler/proc/enableProcess(var/processName as text)
if (hasProcess(processName))
if(hasProcess(processName))
var/datum/controller/process/process = nameToProcessMap[processName]
process.enable()
/datum/controller/processScheduler/proc/disableProcess(var/processName as text)
if (hasProcess(processName))
if(hasProcess(processName))
var/datum/controller/process/process = nameToProcessMap[processName]
process.disable()
/datum/controller/processScheduler/proc/getCurrentTickElapsedTime()
if (world.time > currentTick)
if(world.time > currentTick)
updateCurrentTickData()
return 0
else
return TimeOfTick
/datum/controller/processScheduler/proc/updateCurrentTickData()
if (world.time > currentTick)
if(world.time > currentTick)
// New tick!
currentTick = world.time
updateTimeAllowance()
+12 -12
View File
@@ -153,7 +153,7 @@ var/list/DEPT_FREQS = list(AI_FREQ, COMM_FREQ, ENG_FREQ, MED_FREQ, SEC_FREQ, SCI
/proc/frequency_span_class(var/frequency)
// Antags!
if (frequency in ANTAG_FREQS)
if(frequency in ANTAG_FREQS)
return "syndradio"
// centcomm channels (deathsquid and ert)
if(frequency in CENT_FREQS)
@@ -167,7 +167,7 @@ var/list/DEPT_FREQS = list(AI_FREQ, COMM_FREQ, ENG_FREQ, MED_FREQ, SEC_FREQ, SCI
// department radio formatting (poorly optimized, ugh)
if(frequency == SEC_FREQ)
return "secradio"
if (frequency == ENG_FREQ)
if(frequency == ENG_FREQ)
return "engradio"
if(frequency == SCI_FREQ)
return "sciradio"
@@ -265,17 +265,17 @@ var/global/datum/controller/radio/radio_controller
if(!start_point)
qdel(signal)
return 0
if (filter)
if(filter)
send_to_filter(source, signal, filter, start_point, range)
send_to_filter(source, signal, RADIO_DEFAULT, start_point, range)
else
//Broadcast the signal to everyone!
for (var/next_filter in devices)
for(var/next_filter in devices)
send_to_filter(source, signal, next_filter, start_point, range)
//Sends a signal to all machines belonging to a given filter. Should be called by post_signal()
/datum/radio_frequency/proc/send_to_filter(obj/source, datum/signal/signal, var/filter, var/turf/start_point = null, var/range = null)
if (range && !start_point)
if(range && !start_point)
return
for(var/obj/device in devices[filter])
@@ -291,11 +291,11 @@ var/global/datum/controller/radio/radio_controller
device.receive_signal(signal, TRANSMISSION_RADIO, frequency)
/datum/radio_frequency/proc/add_listener(obj/device as obj, var/filter as text|null)
if (!filter)
if(!filter)
filter = RADIO_DEFAULT
//log_admin("add_listener(device=[device],filter=[filter]) frequency=[frequency]")
var/list/obj/devices_line = devices[filter]
if (!devices_line)
if(!devices_line)
devices_line = new
devices[filter] = devices_line
devices_line+=device
@@ -305,12 +305,12 @@ var/global/datum/controller/radio/radio_controller
//log_admin("DEBUG: devices(filter_str).len=[l]")
/datum/radio_frequency/proc/remove_listener(obj/device)
for (var/devices_filter in devices)
for(var/devices_filter in devices)
var/list/devices_line = devices[devices_filter]
devices_line-=device
while (null in devices_line)
while(null in devices_line)
devices_line -= null
if (devices_line.len==0)
if(devices_line.len==0)
devices -= devices_filter
qdel(devices_line)
@@ -335,11 +335,11 @@ var/global/datum/controller/radio/radio_controller
frequency = model.frequency
/datum/signal/proc/debug_print()
if (source)
if(source)
. = "signal = {source = '[source]' ([source:x],[source:y],[source:z])\n"
else
. = "signal = {source = '[source]' ()\n"
for (var/i in data)
for(var/i in data)
. += "data\[\"[i]\"\] = \"[data[i]]\"\n"
if(islist(data[i]))
var/list/L = data[i]
+80 -80
View File
@@ -182,18 +182,18 @@
/datum/configuration/New()
var/list/L = subtypesof(/datum/game_mode)
for (var/T in L)
for(var/T in L)
// I wish I didn't have to instance the game modes in order to look up
// their information, but it is the only way (at least that I know of).
var/datum/game_mode/M = new T()
if (M.config_tag)
if(M.config_tag)
if(!(M.config_tag in modes)) // ensure each mode is added only once
diary << "Adding game mode [M.name] ([M.config_tag]) to configuration."
src.modes += M.config_tag
src.mode_names[M.config_tag] = M.name
src.probabilities[M.config_tag] = M.probability
if (M.votable)
if(M.votable)
src.votable_modes += M.config_tag
qdel(M)
src.votable_modes += "secret"
@@ -205,188 +205,188 @@
if(!t) continue
t = trim(t)
if (length(t) == 0)
if(length(t) == 0)
continue
else if (copytext(t, 1, 2) == "#")
else if(copytext(t, 1, 2) == "#")
continue
var/pos = findtext(t, " ")
var/name = null
var/value = null
if (pos)
if(pos)
name = lowertext(copytext(t, 1, pos))
value = copytext(t, pos + 1)
else
name = lowertext(t)
if (!name)
if(!name)
continue
if(type == "config")
switch (name)
if ("resource_urls")
switch(name)
if("resource_urls")
config.resource_urls = splittext(value, " ")
if ("admin_legacy_system")
if("admin_legacy_system")
config.admin_legacy_system = 1
if ("ban_legacy_system")
if("ban_legacy_system")
config.ban_legacy_system = 1
if ("use_age_restriction_for_jobs")
if("use_age_restriction_for_jobs")
config.use_age_restriction_for_jobs = 1
if ("use_age_restriction_for_antags")
if("use_age_restriction_for_antags")
config.use_age_restriction_for_antags = 1
if ("jobs_have_minimal_access")
if("jobs_have_minimal_access")
config.jobs_have_minimal_access = 1
if ("log_ooc")
if("log_ooc")
config.log_ooc = 1
if ("log_access")
if("log_access")
config.log_access = 1
if ("log_say")
if("log_say")
config.log_say = 1
if ("log_admin")
if("log_admin")
config.log_admin = 1
if ("log_debug")
if("log_debug")
config.log_debug = text2num(value)
if ("log_game")
if("log_game")
config.log_game = 1
if ("log_vote")
if("log_vote")
config.log_vote = 1
if ("log_whisper")
if("log_whisper")
config.log_whisper = 1
if ("log_attack")
if("log_attack")
config.log_attack = 1
if ("log_emote")
if("log_emote")
config.log_emote = 1
if ("log_adminchat")
if("log_adminchat")
config.log_adminchat = 1
if ("log_adminwarn")
if("log_adminwarn")
config.log_adminwarn = 1
if ("log_pda")
if("log_pda")
config.log_pda = 1
if ("log_world_output")
if("log_world_output")
config.log_world_output = 1
if ("log_hrefs")
if("log_hrefs")
config.log_hrefs = 1
if ("log_runtime")
if("log_runtime")
config.log_runtime = 1
if ("mentors")
if("mentors")
config.mods_are_mentors = 1
if("allow_admin_ooccolor")
config.allow_admin_ooccolor = 1
if ("allow_vote_restart")
if("allow_vote_restart")
config.allow_vote_restart = 1
if ("allow_vote_mode")
if("allow_vote_mode")
config.allow_vote_mode = 1
if("no_dead_vote")
config.vote_no_dead = 1
if ("default_no_vote")
if("default_no_vote")
config.vote_no_default = 1
if ("vote_delay")
if("vote_delay")
config.vote_delay = text2num(value)
if ("vote_period")
if("vote_period")
config.vote_period = text2num(value)
if ("allow_ai")
if("allow_ai")
config.allow_ai = 1
// if ("authentication")
// if("authentication")
// config.enable_authentication = 1
if ("norespawn")
if("norespawn")
config.respawn = 0
if ("servername")
if("servername")
config.server_name = value
if ("serversuffix")
if("serversuffix")
config.server_suffix = 1
if ("nudge_script_path")
if("nudge_script_path")
config.nudge_script_path = value
if ("hostedby")
if("hostedby")
config.hostedby = value
if ("server")
if("server")
config.server = value
if ("banappeals")
if("banappeals")
config.banappeals = value
if ("wikiurl")
if("wikiurl")
config.wikiurl = value
if ("forumurl")
if("forumurl")
config.forumurl = value
if ("rulesurl")
if("rulesurl")
config.rulesurl = value
if ("donationsurl")
if("donationsurl")
config.donationsurl = value
if ("repositoryurl")
if("repositoryurl")
config.repositoryurl = value
if ("guest_jobban")
if("guest_jobban")
config.guest_jobban = 1
if ("guest_ban")
if("guest_ban")
guests_allowed = 0
if ("usewhitelist")
if("usewhitelist")
config.usewhitelist = 1
if ("feature_object_spell_system")
if("feature_object_spell_system")
config.feature_object_spell_system = 1
if ("allow_metadata")
if("allow_metadata")
config.allow_Metadata = 1
if ("traitor_scaling")
if("traitor_scaling")
config.traitor_scaling = 1
if("protect_roles_from_antagonist")
config.protect_roles_from_antagonist = 1
if ("probability")
if("probability")
var/prob_pos = findtext(value, " ")
var/prob_name = null
var/prob_value = null
if (prob_pos)
if(prob_pos)
prob_name = lowertext(copytext(value, 1, prob_pos))
prob_value = copytext(value, prob_pos + 1)
if (prob_name in config.modes)
if(prob_name in config.modes)
config.probabilities[prob_name] = text2num(prob_value)
else
diary << "Unknown game mode probability configuration definition: [prob_name]."
@@ -615,11 +615,11 @@
config.reactionary_explosions = 1
if("bombcap")
var/BombCap = text2num(value)
if (!BombCap)
if(!BombCap)
continue
if (BombCap < 4)
if(BombCap < 4)
BombCap = 4
if (BombCap > 128)
if(BombCap > 128)
BombCap = 128
MAX_EX_DEVESTATION_RANGE = round(BombCap/4)
@@ -638,36 +638,36 @@
if(!t) continue
t = trim(t)
if (length(t) == 0)
if(length(t) == 0)
continue
else if (copytext(t, 1, 2) == "#")
else if(copytext(t, 1, 2) == "#")
continue
var/pos = findtext(t, " ")
var/name = null
var/value = null
if (pos)
if(pos)
name = lowertext(copytext(t, 1, pos))
value = copytext(t, pos + 1)
else
name = lowertext(t)
if (!name)
if(!name)
continue
switch (name)
switch(name)
if("sql_enabled")
config.sql_enabled = 1
if ("address")
if("address")
sqladdress = value
if ("port")
if("port")
sqlport = value
if ("feedback_database")
if("feedback_database")
sqlfdbkdb = value
if ("feedback_login")
if("feedback_login")
sqlfdbklogin = value
if ("feedback_password")
if("feedback_password")
sqlfdbkpass = value
if("feedback_tableprefix")
sqlfdbktableprefix = value
@@ -680,9 +680,9 @@
if(!t) continue
t = trim(t)
if (length(t) == 0)
if(length(t) == 0)
continue
else if (copytext(t, 1, 2) == "#")
else if(copytext(t, 1, 2) == "#")
continue
config.overflow_whitelist += t
@@ -690,25 +690,25 @@
/datum/configuration/proc/pick_mode(mode_name)
// I wish I didn't have to instance the game modes in order to look up
// their information, but it is the only way (at least that I know of).
for (var/T in subtypesof(/datum/game_mode))
for(var/T in subtypesof(/datum/game_mode))
var/datum/game_mode/M = new T()
if (M.config_tag && M.config_tag == mode_name)
if(M.config_tag && M.config_tag == mode_name)
return M
qdel(M)
return new /datum/game_mode/extended()
/datum/configuration/proc/get_runnable_modes()
var/list/datum/game_mode/runnable_modes = new
for (var/T in subtypesof(/datum/game_mode))
for(var/T in subtypesof(/datum/game_mode))
var/datum/game_mode/M = new T()
// to_chat(world, "DEBUG: [T], tag=[M.config_tag], prob=[probabilities[M.config_tag]]")
if (!(M.config_tag in modes))
if(!(M.config_tag in modes))
qdel(M)
continue
if (probabilities[M.config_tag]<=0)
if(probabilities[M.config_tag]<=0)
qdel(M)
continue
if (M.can_start())
if(M.can_start())
runnable_modes[M] = probabilities[M.config_tag]
// to_chat(world, "DEBUG: runnable_mode\[[runnable_modes.len]\] = [M.config_tag]")
return runnable_modes
+2 -2
View File
@@ -18,8 +18,8 @@ var/global/datum/controller/failsafe/failsafe
. = ..()
// There can be only one failsafe. Out with the old in with the new (that way we can restart the Failsafe by spawning a new one).
if (failsafe != src)
if (istype(failsafe))
if(failsafe != src)
if(istype(failsafe))
recover()
qdel(failsafe)
+1 -1
View File
@@ -28,7 +28,7 @@
if("Master")
debug_variables(master_controller)
feedback_add_details("admin_verb","DMC")
if ("failsafe")
if("failsafe")
debug_variables(failsafe)
feedback_add_details("admin_verb", "dfailsafe")
if("Ticker")
+1 -1
View File
@@ -200,7 +200,7 @@ datum/controller/vote
return 0
choices.Add(config.votable_modes)
if("crew_transfer")
if (check_rights(R_ADMIN|R_MOD))
if(check_rights(R_ADMIN|R_MOD))
if(ticker.current_state <= 2)
return 0
question = "End the shift?"