This commit is contained in:
Putnam
2020-02-03 03:17:23 -08:00
1273 changed files with 65894 additions and 22204 deletions

View File

@@ -171,7 +171,8 @@
key_name = copytext(str_val, 1, key_pos)
if(lowercase)
key_name = lowertext(key_name)
key_value = copytext(str_val, key_pos + 1)
if(key_pos)
key_value = copytext(str_val, key_pos + length(str_val[key_pos]))
var/new_key
var/new_value
var/continue_check_value

View File

@@ -109,13 +109,13 @@
if(!L)
continue
var/firstchar = copytext(L, 1, 2)
var/firstchar = L[1]
if(firstchar == "#")
continue
var/lockthis = firstchar == "@"
if(lockthis)
L = copytext(L, 2)
L = copytext(L, length(firstchar) + 1)
var/pos = findtext(L, " ")
var/entry = null
@@ -123,7 +123,7 @@
if(pos)
entry = lowertext(copytext(L, 1, pos))
value = copytext(L, pos + 1)
value = copytext(L, pos + length(L[pos]))
else
entry = lowertext(L)
@@ -193,6 +193,13 @@
stat("[name]:", statclick)
/datum/controller/configuration/proc/Get(entry_type)
var/datum/config_entry/E = GetEntryDatum(entry_type)
if((E.protection & CONFIG_ENTRY_HIDDEN) && IsAdminAdvancedProcCall() && GLOB.LastAdminCalledProc == "Get" && GLOB.LastAdminCalledTargetRef == "[REF(src)]")
log_admin_private("Config access of [entry_type] attempted by [key_name(usr)]")
return
return E.config_entry_value
/datum/controller/configuration/proc/GetEntryDatum(entry_type)
var/datum/config_entry/E = entry_type
var/entry_is_abstract = initial(E.abstract_type) == entry_type
if(entry_is_abstract)
@@ -200,10 +207,7 @@
E = entries_by_type[entry_type]
if(!E)
CRASH("Missing config entry for [entry_type]!")
if((E.protection & CONFIG_ENTRY_HIDDEN) && IsAdminAdvancedProcCall() && GLOB.LastAdminCalledProc == "Get" && GLOB.LastAdminCalledTargetRef == "[REF(src)]")
log_admin_private("Config access of [entry_type] attempted by [key_name(usr)]")
return
return E.config_entry_value
return E
/datum/controller/configuration/proc/Set(entry_type, new_val)
var/datum/config_entry/E = entry_type
@@ -265,7 +269,7 @@
t = trim(t)
if(length(t) == 0)
continue
else if(copytext(t, 1, 2) == "#")
else if(t[1] == "#")
continue
var/pos = findtext(t, " ")
@@ -274,7 +278,7 @@
if(pos)
command = lowertext(copytext(t, 1, pos))
data = copytext(t, pos + 1)
data = copytext(t, pos + length(t[pos]))
else
command = lowertext(t)

View File

@@ -249,6 +249,18 @@
/datum/config_entry/number/movedelay/walk_delay
/datum/config_entry/number/movedelay/sprint_speed_increase
config_entry_value = 1
/datum/config_entry/number/movedelay/sprint_buffer_max
config_entry_value = 42
/datum/config_entry/number/movedelay/sprint_stamina_cost
config_entry_value = 0.7
/datum/config_entry/number/movedelay/sprint_buffer_regen_per_ds
config_entry_value = 0.3
/////////////////////////////////////////////////Outdated move delay
/datum/config_entry/number/outdated_movedelay
deprecated_by = /datum/config_entry/keyed_list/multiplicative_movespeed
@@ -408,3 +420,5 @@
/datum/config_entry/number/dropped_modes
config_entry_value = 3
/datum/config_entry/flag/suicide_allowed

View File

@@ -239,7 +239,6 @@ SUBSYSTEM_DEF(air)
if (MC_TICK_CHECK)
return
/datum/controller/subsystem/air/proc/remove_from_active(turf/open/T)
active_turfs -= T
SSair_turfs.currentrun -= T
@@ -257,7 +256,7 @@ SUBSYSTEM_DEF(air)
#ifdef VISUALIZE_ACTIVE_TURFS
T.add_atom_colour("#00ff00", TEMPORARY_COLOUR_PRIORITY)
#endif
T.excited = 1
T.excited = TRUE
active_turfs |= T
SSair_turfs.currentrun |= T
if(blockchanges && T.excited_group)

View File

@@ -11,7 +11,6 @@ SUBSYSTEM_DEF(air_turfs)
/datum/controller/subsystem/air_turfs/fire(resumed = 0)
var/fire_count = times_fired
//cache for sanic speed
if (!resumed)
src.currentrun = SSair.active_turfs.Copy()
//cache for sanic speed (lists are references anyways)

View File

@@ -31,10 +31,9 @@ SUBSYSTEM_DEF(fail2topic)
return ..()
/datum/controller/subsystem/fail2topic/fire()
while (rate_limiting.len)
var/ip = rate_limiting[1]
for(var/i in 1 to length(rate_limiting))
var/ip = rate_limiting[i]
var/last_attempt = rate_limiting[ip]
if (world.time - last_attempt > rate_limit)
rate_limiting -= ip
fail_counts -= ip

View File

@@ -114,6 +114,6 @@ SUBSYSTEM_DEF(input)
/datum/controller/subsystem/input/fire()
var/list/clients = GLOB.clients // Let's sing the list cache song
for(var/i in 1 to clients.len)
for(var/i in 1 to length(clients))
var/client/C = clients[i]
C.keyLoop()

View File

@@ -37,6 +37,8 @@ SUBSYSTEM_DEF(mapping)
var/datum/space_level/empty_space
var/num_of_res_levels = 1
var/stat_map_name = "Loading..."
//dlete dis once #39770 is resolved
/datum/controller/subsystem/mapping/proc/HACK_LoadMapConfig()
if(!config)
@@ -45,6 +47,7 @@ SUBSYSTEM_DEF(mapping)
#else
config = load_map_config(error_if_missing = FALSE)
#endif
stat_map_name = config.map_name
/datum/controller/subsystem/mapping/Initialize(timeofday)
HACK_LoadMapConfig()
@@ -330,7 +333,10 @@ GLOBAL_LIST_EMPTY(the_station_areas)
return
next_map_config = VM
return TRUE
. = TRUE
stat_map_name = "[config.map_name] (Next: [next_map_config.map_name])"
/datum/controller/subsystem/mapping/proc/preloadTemplates(path = "_maps/templates/") //see master controller setup
var/list/filelist = flist(path)

View File

@@ -26,7 +26,7 @@ SUBSYSTEM_DEF(nightshift)
/datum/controller/subsystem/nightshift/proc/check_nightshift()
var/emergency = GLOB.security_level >= SEC_LEVEL_RED
var/announcing = TRUE
var/time = STATION_TIME(FALSE)
var/time = STATION_TIME(FALSE, world.time)
var/night_time = (time < nightshift_end_time) || (time > nightshift_start_time)
if(high_security_mode != emergency)
high_security_mode = emergency

View File

@@ -39,34 +39,34 @@ SUBSYSTEM_DEF(pai)
switch(option)
if("name")
t = input("Enter a name for your pAI", "pAI Name", candidate.name) as text
t = reject_bad_name(stripped_input(usr, "Enter a name for your pAI", "pAI Name", candidate.name, MAX_NAME_LEN), TRUE)
if(t)
candidate.name = copytext(sanitize(t),1,MAX_NAME_LEN)
candidate.name = t
if("desc")
t = input("Enter a description for your pAI", "pAI Description", candidate.description) as message
t = stripped_multiline_input(usr, "Enter a description for your pAI", "pAI Description", candidate.description, MAX_MESSAGE_LEN)
if(t)
candidate.description = copytext(sanitize(t),1,MAX_MESSAGE_LEN)
candidate.description = t
if("role")
t = input("Enter a role for your pAI", "pAI Role", candidate.role) as text
t = stripped_input(usr, "Enter a role for your pAI", "pAI Role", candidate.role, MAX_MESSAGE_LEN)
if(t)
candidate.role = copytext(sanitize(t),1,MAX_MESSAGE_LEN)
candidate.role = t
if("ooc")
t = input("Enter any OOC comments", "pAI OOC Comments", candidate.comments) as message
t = stripped_multiline_input(usr, "Enter any OOC comments", "pAI OOC Comments", candidate.comments, MAX_MESSAGE_LEN)
if(t)
candidate.comments = copytext(sanitize(t),1,MAX_MESSAGE_LEN)
candidate.comments = t
if("save")
candidate.savefile_save(usr)
if("load")
candidate.savefile_load(usr)
//In case people have saved unsanitized stuff.
if(candidate.name)
candidate.name = copytext(sanitize(candidate.name),1,MAX_NAME_LEN)
candidate.name = copytext_char(sanitize(candidate.name),1,MAX_NAME_LEN)
if(candidate.description)
candidate.description = copytext(sanitize(candidate.description),1,MAX_MESSAGE_LEN)
candidate.description = copytext_char(sanitize(candidate.description),1,MAX_MESSAGE_LEN)
if(candidate.role)
candidate.role = copytext(sanitize(candidate.role),1,MAX_MESSAGE_LEN)
candidate.role = copytext_char(sanitize(candidate.role),1,MAX_MESSAGE_LEN)
if(candidate.comments)
candidate.comments = copytext(sanitize(candidate.comments),1,MAX_MESSAGE_LEN)
candidate.comments = copytext_char(sanitize(candidate.comments),1,MAX_MESSAGE_LEN)
if("submit")
if(isobserver(usr))

View File

@@ -46,6 +46,6 @@ PROCESSING_SUBSYSTEM_DEF(networks)
var/hex = md5(string)
if(!hex)
return //errored
. = "[copytext(hex, 1, 9)]" //16 ^ 8 possibilities I think.
. = "[copytext_char(hex, 1, 9)]" //16 ^ 8 possibilities I think.
if(interfaces_by_id[.])
return resolve_collisions? make_address("[num2text(rand(HID_RESTRICTED_END, 999999999), 12)]"):null

View File

@@ -30,6 +30,7 @@ SUBSYSTEM_DEF(shuttle)
var/list/hostileEnvironments = list() //Things blocking escape shuttle from leaving
var/list/tradeBlockade = list() //Things blocking cargo from leaving.
var/supplyBlocked = FALSE
var/emergency_shuttle_stat_text
//supply shuttle stuff
var/obj/docking_port/mobile/supply/supply
@@ -118,6 +119,9 @@ SUBSYSTEM_DEF(shuttle)
points += point_gain
//Cargo stuff end
var/esETA = emergency?.getModeStr()
emergency_shuttle_stat_text = "[esETA? "[esETA] [emergency.getTimerStr()]" : ""]"
if(!SSmapping.clearing_reserved_turfs)
while(transit_requesters.len)
var/requester = popleft(transit_requesters)

View File

@@ -11,7 +11,7 @@ SUBSYSTEM_DEF(tgui)
var/basehtml // The HTML base used for all UIs.
/datum/controller/subsystem/tgui/PreInit()
basehtml = file2text('tgui/tgui.html')
basehtml = file2text('tgui-next/packages/tgui/public/tgui-main.html')
/datum/controller/subsystem/tgui/Shutdown()
close_all_uis()

View File

@@ -55,6 +55,7 @@ SUBSYSTEM_DEF(throwing)
var/dist_y
var/dx
var/dy
var/force = MOVE_FORCE_DEFAULT
var/pure_diagonal
var/diagonal_error
var/datum/callback/callback

View File

@@ -1,6 +1,6 @@
SUBSYSTEM_DEF(time_track)
name = "Time Tracking"
wait = 600
wait = 1 SECONDS
flags = SS_NO_INIT|SS_NO_TICK_CHECK
runlevels = RUNLEVEL_LOBBY | RUNLEVELS_DEFAULT
@@ -16,23 +16,33 @@ SUBSYSTEM_DEF(time_track)
var/last_tick_byond_time = 0
var/last_tick_tickcount = 0
var/last_measurement = 0
var/measurement_delay = 60
var/stat_time_text
var/time_dilation_text
/datum/controller/subsystem/time_track/fire()
stat_time_text = "Server Time: [time2text(world.timeofday, "YYYY-MM-DD hh:mm:ss")]\n\nRound Time: [WORLDTIME2TEXT("hh:mm:ss")]\n\nStation Time: [STATION_TIME_TIMESTAMP("hh:mm:ss", world.time)]\n\n[time_dilation_text]"
var/current_realtime = REALTIMEOFDAY
var/current_byondtime = world.time
var/current_tickcount = world.time/world.tick_lag
if(++last_measurement == measurement_delay)
last_measurement = 0
var/current_realtime = REALTIMEOFDAY
var/current_byondtime = world.time
var/current_tickcount = world.time/world.tick_lag
if (!first_run)
var/tick_drift = max(0, (((current_realtime - last_tick_realtime) - (current_byondtime - last_tick_byond_time)) / world.tick_lag))
if (!first_run)
var/tick_drift = max(0, (((current_realtime - last_tick_realtime) - (current_byondtime - last_tick_byond_time)) / world.tick_lag))
time_dilation_current = tick_drift / (current_tickcount - last_tick_tickcount) * 100
time_dilation_current = tick_drift / (current_tickcount - last_tick_tickcount) * 100
time_dilation_avg_fast = MC_AVERAGE_FAST(time_dilation_avg_fast, time_dilation_current)
time_dilation_avg = MC_AVERAGE(time_dilation_avg, time_dilation_avg_fast)
time_dilation_avg_slow = MC_AVERAGE_SLOW(time_dilation_avg_slow, time_dilation_avg)
else
first_run = FALSE
last_tick_realtime = current_realtime
last_tick_byond_time = current_byondtime
last_tick_tickcount = current_tickcount
SSblackbox.record_feedback("associative", "time_dilation_current", 1, list("[SQLtime()]" = list("current" = "[time_dilation_current]", "avg_fast" = "[time_dilation_avg_fast]", "avg" = "[time_dilation_avg]", "avg_slow" = "[time_dilation_avg_slow]")))
time_dilation_avg_fast = MC_AVERAGE_FAST(time_dilation_avg_fast, time_dilation_current)
time_dilation_avg = MC_AVERAGE(time_dilation_avg, time_dilation_avg_fast)
time_dilation_avg_slow = MC_AVERAGE_SLOW(time_dilation_avg_slow, time_dilation_avg)
else
first_run = FALSE
last_tick_realtime = current_realtime
last_tick_byond_time = current_byondtime
last_tick_tickcount = current_tickcount
SSblackbox.record_feedback("associative", "time_dilation_current", 1, list("[SQLtime()]" = list("current" = "[time_dilation_current]", "avg_fast" = "[time_dilation_avg_fast]", "avg" = "[time_dilation_avg]", "avg_slow" = "[time_dilation_avg_slow]")))
time_dilation_text = "Time Dilation: [round(time_dilation_current,1)]% AVG:([round(time_dilation_avg_fast,1)]%, [round(time_dilation_avg,1)]%, [round(time_dilation_avg_slow,1)]%)"