Merge remote-tracking branch 'upstream/dev' into 150705-SecretAdminDatums

Conflicts:
	code/modules/admin/topic.dm
This commit is contained in:
PsiOmegaDelta
2015-08-20 14:16:35 +02:00
755 changed files with 20873 additions and 19061 deletions

View File

@@ -28,6 +28,10 @@ var/list/delayed_garbage = list()
delayed_garbage.Cut()
delayed_garbage = null
#ifdef GC_FINDREF
world/loop_checks = 0
#endif
/datum/controller/process/garbage_collector/doWork()
if(!garbage_collect)
return
@@ -37,6 +41,31 @@ var/list/delayed_garbage = list()
var/checkRemain = max_checks_multiplier * schedule_interval
var/maxDels = max_forcedel_multiplier * schedule_interval
#ifdef GC_FINDREF
var/list/searching = list()
for(var/refID in destroyed) // Reference search - before all deletions and for all at once
var/GCd_at_time = destroyed[refID]
if(GCd_at_time > time_to_kill)
break
var/atom/A = locate(refID)
if(A && A.gcDestroyed == GCd_at_time)
searching += A
if(searching.len >= checkRemain)
break
for(var/atom/A in searching)
testing("GC: Searching references for [A] | [A.type]")
if(A.loc != null)
testing("GC: [A] | [A.type] is located in [A.loc] instead of null")
if(A.contents.len)
testing("GC: [A] | [A.type] has contents: [list2text(A.contents)]")
if(searching.len)
for(var/atom/D in world)
LookForRefs(D, searching)
for(var/datum/D)
LookForRefs(D, searching)
#endif
while(destroyed.len && --checkRemain >= 0)
if(dels >= maxDels)
#ifdef GC_DEBUG
@@ -50,7 +79,7 @@ var/list/delayed_garbage = list()
testing("GC: [refID] not old enough, breaking at [world.time] for [GCd_at_time - time_to_kill] deciseconds until [GCd_at_time + collection_timeout]")
#endif
break // Everything else is newer, skip them
var/atom/A = locate(refID)
var/datum/A = locate(refID)
#ifdef GC_DEBUG
testing("GC: [refID] old enough to test: GCd_at_time: [GCd_at_time] time_to_kill: [time_to_kill] current: [world.time]")
#endif
@@ -67,6 +96,32 @@ var/list/delayed_garbage = list()
#endif
destroyed.Cut(1, 2)
#ifdef GC_FINDREF
/datum/controller/process/garbage_collector/proc/LookForRefs(var/datum/D, var/list/targ)
. = 0
for(var/V in D.vars)
if(V == "contents")
continue
if(istype(D.vars[V], /atom))
var/atom/A = D.vars[V]
if(A in targ)
testing("GC: [A] | [A.type] referenced by [D] | [D.type], var [V]")
. += 1
else if(islist(D.vars[V]))
. += LookForListRefs(D.vars[V], targ, D, V)
/datum/controller/process/garbage_collector/proc/LookForListRefs(var/list/L, var/list/targ, var/datum/D, var/V)
. = 0
for(var/F in L)
if(istype(F, /atom))
var/atom/A = F
if(A in targ)
testing("GC: [A] | [A.type] referenced by [D] | [D.type], list [V]")
. += 1
if(islist(F))
. += LookForListRefs(F, targ, D, "[F] in list [V]")
#endif
/datum/controller/process/garbage_collector/proc/AddTrash(datum/A)
if(!istype(A) || !isnull(A.gcDestroyed))
return
@@ -80,6 +135,10 @@ var/list/delayed_garbage = list()
/datum/controller/process/garbage_collector/getStatName()
return ..()+"([garbage_collector.destroyed.len]/[garbage_collector.dels]/[garbage_collector.hard_dels])"
// Tests if an atom has been deleted.
/proc/deleted(atom/A)
return !A || !isnull(A.gcDestroyed)
// Should be treated as a replacement for the 'del' keyword.
// Datums passed to this will be given a chance to clean up references to allow the GC to collect them.
/proc/qdel(var/datum/A)
@@ -199,3 +258,7 @@ var/list/delayed_garbage = list()
#ifdef GC_DEBUG
#undef GC_DEBUG
#endif
#ifdef GC_FINDREF
#undef GC_FINDREF
#endif

View File

@@ -97,20 +97,21 @@ On the map:
1455 for AI access
*/
var/const/BOT_FREQ = 1447
var/const/COMM_FREQ = 1353
var/const/SYND_FREQ = 1213
var/const/ERT_FREQ = 1345
var/const/AI_FREQ = 1343
var/const/DTH_FREQ = 1341
var/const/AI_FREQ = 1447
var/const/SYND_FREQ = 1213
// department channels
var/const/PUB_FREQ = 1459
var/const/SEC_FREQ = 1359
var/const/ENG_FREQ = 1357
var/const/SCI_FREQ = 1351
var/const/MED_FREQ = 1355
var/const/SUP_FREQ = 1347
var/const/SCI_FREQ = 1351
var/const/SRV_FREQ = 1349
var/const/SUP_FREQ = 1347
var/list/radiochannels = list(
"Common" = PUB_FREQ,

View File

@@ -62,8 +62,13 @@ var/list/gamemode_cache = list()
var/respawn = 1
var/guest_jobban = 1
var/usewhitelist = 0
var/mods_are_mentors = 0
var/kick_inactive = 0 //force disconnect for inactive players after this many minutes, if non-0
var/show_mods = 0
var/show_mentors = 0
var/mods_can_tempban = 0
var/mods_can_job_tempban = 0
var/mod_tempban_max = 1440
var/mod_job_tempban_max = 1440
var/load_jobs_from_txt = 0
var/ToRban = 0
var/automute_on = 0 //enables automuting/spam prevention
@@ -116,6 +121,8 @@ var/list/gamemode_cache = list()
var/organ_health_multiplier = 1
var/organ_regeneration_multiplier = 1
var/organs_decay
var/default_brain_health = 400
//Paincrit knocks someone down once they hit 60 shock_stage, so by default make it so that close to 100 additional damage needs to be dealt,
//so that it's similar to HALLOSS. Lowered it a bit since hitting paincrit takes much longer to wear off than a halloss stun.
@@ -318,9 +325,6 @@ var/list/gamemode_cache = list()
if ("log_runtime")
config.log_runtime = 1
if ("mentors")
config.mods_are_mentors = 1
if ("generate_asteroid")
config.generate_asteroid = 1
@@ -472,6 +476,24 @@ var/list/gamemode_cache = list()
if("kick_inactive")
config.kick_inactive = text2num(value)
if("show_mods")
config.show_mods = 1
if("show_mentors")
config.show_mentors = 1
if("mods_can_tempban")
config.mods_can_tempban = 1
if("mods_can_job_tempban")
config.mods_can_job_tempban = 1
if("mod_tempban_max")
config.mod_tempban_max = text2num(value)
if("mod_job_tempban_max")
config.mod_job_tempban_max = text2num(value)
if("load_jobs_from_txt")
load_jobs_from_txt = 1
@@ -689,6 +711,12 @@ var/list/gamemode_cache = list()
config.organ_regeneration_multiplier = value / 100
if("organ_damage_spillover_multiplier")
config.organ_damage_spillover_multiplier = value / 100
if("organs_can_decay")
config.organs_decay = 1
if("default_brain_health")
config.default_brain_health = text2num(value)
if(!config.default_brain_health || config.default_brain_health < 1)
config.default_brain_health = initial(config.default_brain_health)
if("bones_can_break")
config.bones_can_break = value
if("limbs_can_break")

View File

@@ -49,6 +49,11 @@ datum/controller/game_controller/proc/setup_objects()
for(var/atom/movable/object in world)
object.initialize()
admin_notice("<span class='danger'>Initializing areas</span>", R_DEBUG)
sleep(-1)
for(var/area/area in all_areas)
area.initialize()
admin_notice("<span class='danger'>Initializing pipe networks</span>", R_DEBUG)
sleep(-1)
for(var/obj/machinery/atmospherics/machine in machines)

View File

@@ -203,7 +203,7 @@ var/global/datum/shuttle_controller/shuttle_controller
//Skipjack.
var/datum/shuttle/multi_shuttle/VS = new/datum/shuttle/multi_shuttle()
VS.origin = locate(/area/shuttle/skipjack/station)
VS.origin = locate(/area/skipjack_station/start)
VS.destinations = list(
"Fore Starboard Solars" = locate(/area/skipjack_station/northeast_solars),
@@ -213,7 +213,7 @@ var/global/datum/shuttle_controller/shuttle_controller
"Mining Station" = locate(/area/skipjack_station/mining)
)
VS.announcer = "NSV Icarus"
VS.announcer = "NDV Icarus"
VS.arrival_message = "Attention, Exodus, we just tracked a small target bypassing our defensive perimeter. Can't fire on it without hitting the station - you've got incoming visitors, like it or not."
VS.departure_message = "Your guests are pulling away, Exodus - moving too fast for us to draw a bead on them. Looks like they're heading out of the system at a rapid clip."
VS.interim = locate(/area/skipjack_station/transit)
@@ -244,7 +244,7 @@ var/global/datum/shuttle_controller/shuttle_controller
"Arrivals dock" = "nuke_shuttle_dock_airlock",
)
MS.announcer = "NSV Icarus"
MS.announcer = "NDV Icarus"
MS.arrival_message = "Attention, Exodus, you have a large signature approaching the station - looks unarmed to surface scans. We're too far out to intercept - brace for visitors."
MS.departure_message = "Your visitors are on their way out of the system, Exodus, burning delta-v like it's nothing. Good riddance."
MS.interim = locate(/area/syndicate_station/transit)

View File

@@ -188,9 +188,9 @@ datum/controller/vote
if(mode)
if(config.vote_no_dead && usr.stat == DEAD && !usr.client.holder)
return 0
if(current_votes[ckey])
choices[choices[current_votes[ckey]]]--
if(vote && 1<=vote && vote<=choices.len)
if(vote && vote >= 1 && vote <= choices.len)
if(current_votes[ckey])
choices[choices[current_votes[ckey]]]--
voted += usr.ckey
choices[choices[vote]]++ //check this
current_votes[ckey] = vote
@@ -381,7 +381,9 @@ datum/controller/vote
if(usr.client.holder)
initiate_vote("custom",usr.key)
else
submit_vote(usr.ckey, round(text2num(href_list["vote"])))
var/t = round(text2num(href_list["vote"]))
if(t) // It starts from 1, so there's no problem
submit_vote(usr.ckey, t)
usr.vote()