Merge remote-tracking branch 'ParadiseSS13/master' into maze-generator

This commit is contained in:
AffectedArc07
2021-02-15 10:20:52 +00:00
640 changed files with 36365 additions and 151321 deletions
+5 -5
View File
@@ -166,11 +166,6 @@
var/default_laws = 0 //Controls what laws the AI spawns with.
var/list/station_levels = list(1) // Defines which Z-levels the station exists on.
var/list/admin_levels= list(2) // Defines which Z-levels which are for admin functionality, for example including such areas as Central Command and the Syndicate Shuttle
var/list/contact_levels = list(1, 5) // Defines which Z-levels which, for example, a Code Red announcement may affect
var/list/player_levels = list(1, 3, 4, 5, 6, 7) // Defines all Z-levels a character can typically reach
var/const/minutes_to_ticks = 60 * 10
// Event settings
var/expected_round_length = 60 * 2 * minutes_to_ticks // 2 hours
@@ -277,6 +272,9 @@
/// Max amount of CIDs that one ckey can have attached to them before they trip a warning
var/max_client_cid_history = 3
/// Enable auto profiler of rounds
var/auto_profile = FALSE
/datum/configuration/New()
for(var/T in subtypesof(/datum/game_mode))
var/datum/game_mode/M = T
@@ -770,6 +768,8 @@
centcom_ban_db_url = value
if("max_client_cid_history")
max_client_cid_history = text2num(value)
if("enable_auto_profiler")
auto_profile = TRUE
else
log_config("Unknown setting in configuration: '[name]'")
+2 -6
View File
@@ -280,12 +280,8 @@ SUBSYSTEM_DEF(air)
if(blockchanges && T.excited_group)
T.excited_group.garbage_collect()
else
for(var/direction in GLOB.cardinal)
if(!(T.atmos_adjacent_turfs & direction))
continue
var/turf/simulated/S = get_step(T, direction)
if(istype(S))
add_to_active(S)
for(var/turf/simulated/S in T.atmos_adjacent_turfs)
add_to_active(S)
/datum/controller/subsystem/air/proc/setup_allturfs(var/list/turfs_to_init = block(locate(1, 1, 1), locate(world.maxx, world.maxy, world.maxz)))
var/list/active_turfs = src.active_turfs
+1 -1
View File
@@ -180,7 +180,7 @@ SUBSYSTEM_DEF(dbcore)
"UPDATE [format_table_name("round")] SET start_datetime=NOW(), commit_hash=:hash WHERE id=:round_id",
list("hash" = GLOB.revision_info.commit_hash, "round_id" = GLOB.round_id)
)
query_round_start.Execute()
query_round_start.Execute(async = FALSE) // This happens during a time of intense server lag, so should be non-async
qdel(query_round_start)
/**
+1
View File
@@ -2,6 +2,7 @@ SUBSYSTEM_DEF(events)
name = "Events"
init_order = INIT_ORDER_EVENTS
runlevels = RUNLEVEL_GAME
flags = SS_KEEP_TIMING
offline_implications = "Random events will no longer happen. No immediate action is needed."
// Report events at the end of the rouund
var/report_at_round_end = 0
+1 -1
View File
@@ -7,7 +7,7 @@ SUBSYSTEM_DEF(mobs)
var/list/currentrun = list()
var/static/list/clients_by_zlevel[][]
var/static/list/dead_players_by_zlevel[][] = list(list()) // Needs to support zlevel 1 here, MaxZChanged only happens when z2 is created and new_players can login before that.
var/static/list/dead_players_by_zlevel[][] = list(list()) // Needs to support zlevel 1 here, MaxZChanged only happens when CC is created and new_players can login before that.
var/static/list/cubemonkeys = list()
/datum/controller/subsystem/mobs/stat_entry()
+50
View File
@@ -0,0 +1,50 @@
SUBSYSTEM_DEF(profiler)
name = "Profiler"
init_order = INIT_ORDER_PROFILER
runlevels = RUNLEVELS_DEFAULT | RUNLEVEL_LOBBY
wait = 5 MINUTES
flags = SS_NO_TICK_CHECK
/// Time it took to fetch profile data (ms)
var/fetch_cost = 0
/// Time it took to write the file (ms)
var/write_cost = 0
/datum/controller/subsystem/profiler/stat_entry()
..("F:[round(fetch_cost, 1)]ms | W:[round(write_cost, 1)]ms")
/datum/controller/subsystem/profiler/Initialize()
if(!config.auto_profile)
StopProfiling() //Stop the early start profiler if we dont want it on in the config
flags |= SS_NO_FIRE
return ..()
/datum/controller/subsystem/profiler/fire()
DumpFile()
/datum/controller/subsystem/profiler/Shutdown()
if(config.auto_profile)
DumpFile()
return ..()
// These procs may seem useless, but they exist like this so we can proc call them on and off
// You cant proc-call onto /world
/datum/controller/subsystem/profiler/proc/StartProfiling()
world.Profile(PROFILE_START)
/datum/controller/subsystem/profiler/proc/StopProfiling()
world.Profile(PROFILE_STOP)
// Write the file while also cost tracking
/datum/controller/subsystem/profiler/proc/DumpFile()
var/timer = TICK_USAGE_REAL
var/current_profile_data = world.Profile(PROFILE_REFRESH, format = "json")
fetch_cost = MC_AVERAGE(fetch_cost, TICK_DELTA_TO_MS(TICK_USAGE_REAL - timer))
CHECK_TICK
if(!length(current_profile_data)) //Would be nice to have explicit proc to check this
stack_trace("Warning, profiling stopped manually before dump.")
var/json_file = file("[GLOB.log_directory]/profile.json")
if(fexists(json_file))
fdel(json_file)
timer = TICK_USAGE_REAL
WRITE_FILE(json_file, current_profile_data)
write_cost = MC_AVERAGE(write_cost, TICK_DELTA_TO_MS(TICK_USAGE_REAL - timer))
+18
View File
@@ -0,0 +1,18 @@
PROCESSING_SUBSYSTEM_DEF(radiation)
name = "Radiation"
flags = SS_NO_INIT | SS_BACKGROUND
wait = 1 SECONDS
offline_implications = "Radiation will no longer function; power generation may not happen. A restart may or may not be required, depending on the situation."
var/list/warned_atoms = list()
/datum/controller/subsystem/processing/radiation/proc/warn(datum/component/radioactive/contamination)
if(!contamination || QDELETED(contamination))
return
var/ref = contamination.parent.UID()
if(warned_atoms[ref])
return
warned_atoms[ref] = TRUE
var/atom/master = contamination.parent
SSblackbox.record_feedback("tally", "contaminated", 1, master.type)
var/msg = "has become contaminated with enough radiation to contaminate other objects. || Source: [contamination.source] || Strength: [contamination.strength]"
master.investigate_log(msg, "radiation")
+37 -16
View File
@@ -172,6 +172,9 @@ SUBSYSTEM_DEF(tickets)
if(!other_ticket_system_staff_check())
return
var/datum/ticket/T = allTickets[ticketId]
if(T.ticket_converted)
to_chat(usr, "<span class='warning'>This ticket has already been converted!</span>")
return
convert_ticket(T)
/datum/controller/subsystem/tickets/proc/other_ticket_system_staff_check()
@@ -183,6 +186,7 @@ SUBSYSTEM_DEF(tickets)
/datum/controller/subsystem/tickets/proc/convert_ticket(datum/ticket/T)
T.ticketState = TICKET_CLOSED
T.ticket_converted = TRUE
var/client/C = usr.client
var/client/owner = get_client_by_ckey(T.client_ckey)
to_chat_safe(owner, list("<span class='[span_class]'>[key_name_hidden(C)] has converted your ticket to a [other_ticket_name] ticket.</span>",\
@@ -282,7 +286,7 @@ SUBSYSTEM_DEF(tickets)
/datum/controller/subsystem/tickets/proc/assignStaffToTicket(client/C, N)
var/datum/ticket/T = allTickets[N]
if(T.staffAssigned != null && T.staffAssigned != C && alert("Ticket is already assigned to [T.staffAssigned.ckey]. Are you sure you want to take it?","Take ticket","No","Yes") != "Yes")
if(T.staffAssigned != null && T.staffAssigned != C && alert("Ticket is already assigned to [T.staffAssigned.ckey]. Are you sure you want to take it?", "Take ticket", "Yes", "No") != "Yes")
return FALSE
T.assignStaff(C)
return TRUE
@@ -290,21 +294,36 @@ SUBSYSTEM_DEF(tickets)
//Single staff ticket
/datum/ticket
var/ticketNum // Ticket number
/// ckey of the client who opened the ticket
/// Ticket number.
var/ticketNum
/// ckey of the client who opened the ticket.
var/client_ckey
var/timeOpened // Time the ticket was opened
var/title //The initial message with links
var/raw_title // The title without URLs added
var/list/content // content of the staff help
var/lastStaffResponse // Last staff member who responded
var/lastResponseTime // When the staff last responded
var/locationSent // Location the player was when they send the ticket
var/mobControlled // Mob they were controlling
var/ticketState // State of the ticket, open, closed, resolved etc
var/timeUntilStale // When the ticket goes stale
var/ticketCooldown // Cooldown before allowing the user to open another ticket.
var/client/staffAssigned // Staff member who has assigned themselves to this ticket
/// Time the ticket was opened.
var/timeOpened
/// The initial message with links.
var/title
/// The title without URLs added.
var/raw_title
/// Content of the staff help.
var/list/content
/// Last staff member who responded.
var/lastStaffResponse
/// When the staff last responded.
var/lastResponseTime
/// The location the player was when they sent the ticket.
var/locationSent
/// The mob the player was controlling when they sent the ticket.
var/mobControlled
/// State of the ticket, open, closed, resolved etc.
var/ticketState
/// Has the ticket been converted to another type? (Mhelp to Ahelp, etc.)
var/ticket_converted = FALSE
/// When the ticket goes stale.
var/timeUntilStale
/// Cooldown before allowing the user to open another ticket.
var/ticketCooldown
/// Staff member who has assigned themselves to this ticket.
var/client/staffAssigned
/datum/ticket/New(tit, raw_tit, cont, num)
title = tit
@@ -328,6 +347,8 @@ SUBSYSTEM_DEF(tickets)
//Return the ticket state as a colour coded text string.
/datum/ticket/proc/state2text()
if(ticket_converted)
return "<font color='yellow'>CONVERTED</font>"
switch(ticketState)
if(TICKET_OPEN)
return "<font color='green'>OPEN</font>"
@@ -430,7 +451,7 @@ UI STUFF
dat += "<h2>Ticket #[T.ticketNum]</h2>"
dat += "<h3>[T.client_ckey] / [T.mobControlled] opened this [ticket_name] at [T.timeOpened] at location [T.locationSent]</h3>"
dat += "<h4>Ticket Status: <font color='red'>[status]</font>"
dat += "<h4>Ticket Status: [status]"
dat += "<table style='width:950px; border: 3px solid;'>"
dat += "<tr><td>[T.title]</td></tr>"