Merge remote-tracking branch 'refs/remotes/origin/master' into custom_roundstart_items

# Conflicts:
#	code/controllers/configuration.dm
#	code/game/objects/items.dm
This commit is contained in:
kevinz000
2017-05-21 18:17:42 -07:00
571 changed files with 74297 additions and 79090 deletions
+1
View File
@@ -2,6 +2,7 @@ SUBSYSTEM_DEF(acid)
name = "Acid"
priority = 40
flags = SS_NO_INIT|SS_BACKGROUND
runlevels = RUNLEVEL_GAME | RUNLEVEL_POSTGAME
var/list/currentrun = list()
var/list/processing = list()
+2 -1
View File
@@ -12,6 +12,7 @@ SUBSYSTEM_DEF(air)
priority = 20
wait = 5
flags = SS_BACKGROUND
runlevels = RUNLEVEL_GAME | RUNLEVEL_POSTGAME
var/cost_turfs = 0
var/cost_groups = 0
@@ -299,7 +300,7 @@ SUBSYSTEM_DEF(air)
var/timer = world.timeofday
warning("There are [starting_ats] active turfs at roundstart, this is a mapping error caused by a difference of the air between the adjacent turfs. You can see its coordinates using \"Mapping -> Show roundstart AT list\" verb (debug verbs required)")
for(var/turf/T in active_turfs)
GLOB.active_turfs_startlist += text("[T.x], [T.y], [T.z]\n")
GLOB.active_turfs_startlist += T
//now lets clear out these active turfs
var/list/turfs_to_check = active_turfs.Copy()
+1 -1
View File
@@ -150,7 +150,7 @@ SUBSYSTEM_DEF(atoms)
/datum/controller/subsystem/atoms/Shutdown()
var/initlog = InitLog()
if(initlog)
log_world(initlog)
text2file("[GLOB.log_directory]/initialize.log", initlog)
#undef BAD_INIT_QDEL_BEFORE
#undef BAD_INIT_DIDNT_INIT
+1
View File
@@ -1,6 +1,7 @@
SUBSYSTEM_DEF(augury)
name = "Augury"
flags = SS_NO_INIT
runlevels = RUNLEVEL_GAME | RUNLEVEL_POSTGAME
var/list/watchers = list()
var/list/doombringers = list()
+3 -3
View File
@@ -2,7 +2,7 @@ SUBSYSTEM_DEF(blackbox)
name = "Blackbox"
wait = 6000
flags = SS_NO_TICK_CHECK
var/list/msg_common = list()
var/list/msg_science = list()
var/list/msg_command = list()
@@ -91,7 +91,7 @@ SUBSYSTEM_DEF(blackbox)
if (sqlrowlist != "")
sqlrowlist += ", " //a comma (,) at the start of the first row to insert will trigger a SQL error
sqlrowlist += "(null, Now(), [GLOB.round_id], \"[sanitizeSQL(FV.get_variable())]\", [FV.get_value()], \"[sanitizeSQL(FV.get_details())]\")"
sqlrowlist += list(list("time" = "Now()", "round_id" = GLOB.round_id, "var_name" = "'[sanitizeSQL(FV.get_variable())]'", "var_value" = FV.get_value(), "details" = "'[sanitizeSQL(FV.get_details())]'"))
if (sqlrowlist == "")
return
@@ -243,4 +243,4 @@ SUBSYSTEM_DEF(blackbox)
return details
/datum/feedback_variable/proc/get_parsed()
return list(variable,value,details)
return list(variable,value,details)
+74 -2
View File
@@ -77,15 +77,87 @@ SUBSYSTEM_DEF(dbcore)
return FALSE
return _dm_db_is_connected(_db_con)
/datum/controller/subsystem/dbcore/proc/Quote(str)
/datum/controller/subsystem/dbcore/proc/Quote(str)
return _dm_db_quote(_db_con, str)
/datum/controller/subsystem/dbcore/proc/ErrorMsg()
/datum/controller/subsystem/dbcore/proc/ErrorMsg()
if(!config.sql_enabled)
return "Database disabled by configuration"
return _dm_db_error_msg(_db_con)
/datum/controller/subsystem/dbcore/proc/NewQuery(sql_query, cursor_handler = Default_Cursor)
if(IsAdminAdvancedProcCall())
log_admin_private("ERROR: Advanced admin proc call led to sql query: [sql_query]. Query has been blocked")
message_admins("ERROR: Advanced admin proc call led to sql query. Query has been blocked")
return FALSE
return new /datum/DBQuery(sql_query, src, cursor_handler)
/*
Takes a list of rows (each row being an associated list of column => value) and inserts them via a single mass query.
Rows missing columns present in other rows will resolve to SQL NULL
You are expected to do your own escaping of the data, and expected to provide your own quotes for strings.
The duplicate_key arg can be true to automatically generate this part of the query
or set to a string that is appended to the end of the query
Ignore_errors instructes mysql to continue inserting rows if some of them have errors.
the erroneous row(s) aren't inserted and there isn't really any way to know why or why errored
Delayed insert mode was removed in mysql 7 and only works with MyISAM type tables,
It was included because it is still supported in mariadb.
It does not work with duplicate_key and the mysql server ignores it in those cases
*/
/datum/controller/subsystem/dbcore/proc/MassInsert(table, list/rows, duplicate_key = FALSE, ignore_errors = FALSE, delayed = FALSE, warn = FALSE)
if (!table || !rows || !istype(rows))
return
var/list/columns = list()
var/list/sorted_rows = list()
for (var/list/row in rows)
var/list/sorted_row = list()
sorted_row.len = columns.len
for (var/column in row)
var/idx = columns[column]
if (!idx)
idx = columns.len + 1
columns[column] = idx
sorted_row.len = columns.len
sorted_row[idx] = row[column]
sorted_rows[++sorted_rows.len] = sorted_row
if (duplicate_key == TRUE)
var/list/column_list = list()
for (var/column in columns)
column_list += "[column] = VALUES([column])"
duplicate_key = "ON DUPLICATE KEY UPDATE [column_list.Join(", ")]\n"
else if (duplicate_key == FALSE)
duplicate_key = null
if (ignore_errors)
ignore_errors = " IGNORE"
else
ignore_errors = null
if (delayed)
delayed = " DELAYED"
else
delayed = null
var/list/sqlrowlist = list()
var/len = columns.len
for (var/list/row in sorted_rows)
if (length(row) != len)
row.len = len
for (var/value in row)
if (value == null)
value = "NULL"
sqlrowlist += "([row.Join(", ")])"
sqlrowlist = " [sqlrowlist.Join(",\n ")]"
var/datum/DBQuery/Query = NewQuery("INSERT[delayed][ignore_errors] INTO [table]\n([columns.Join(", ")])\nVALUES\n[sqlrowlist]\n[duplicate_key]")
if (warn)
return Query.warn_execute()
else
return Query.Execute()
/datum/DBQuery
var/sql // The sql query being executed.
+1
View File
@@ -1,6 +1,7 @@
SUBSYSTEM_DEF(disease)
name = "Disease"
flags = SS_KEEP_TIMING|SS_NO_INIT
runlevels = RUNLEVEL_GAME | RUNLEVEL_POSTGAME
var/list/currentrun = list()
var/list/processing = list()
+1
View File
@@ -1,6 +1,7 @@
SUBSYSTEM_DEF(events)
name = "Events"
init_order = INIT_ORDER_EVENTS
runlevels = RUNLEVEL_GAME
var/list/control = list() //list of all datum/round_event_control. Used for selecting events based on weight and occurrences.
var/list/running = list() //list of all existing /datum/round_event
+27
View File
@@ -0,0 +1,27 @@
SUBSYSTEM_DEF(fields)
name = "Fields"
wait = 2
priority = 40
flags = SS_KEEP_TIMING
var/list/datum/proximity_monitor/advanced/running = list()
var/list/datum/proximity_monitor/advanced/currentrun = list()
/datum/controller/subsystem/fields/fire(resumed = 0)
if(!resumed)
src.currentrun = running.Copy()
var/list/currentrun = src.currentrun
while(currentrun.len)
var/datum/proximity_monitor/advanced/F = currentrun[currentrun.len]
currentrun.len--
if(!F.requires_processing)
continue
F.process()
if(MC_TICK_CHECK)
return
/datum/controller/subsystem/fields/proc/register_new_field(datum/proximity_monitor/advanced/F)
running += F
/datum/controller/subsystem/fields/proc/unregister_field(datum/proximity_monitor/advanced/F)
running -= F
@@ -2,6 +2,7 @@ SUBSYSTEM_DEF(fire_burning)
name = "Fire Burning"
priority = 40
flags = SS_NO_INIT|SS_BACKGROUND
runlevels = RUNLEVEL_GAME | RUNLEVEL_POSTGAME
var/list/currentrun = list()
var/list/processing = list()
+3 -2
View File
@@ -2,7 +2,8 @@ SUBSYSTEM_DEF(garbage)
name = "Garbage"
priority = 15
wait = 5
flags = SS_FIRE_IN_LOBBY|SS_POST_FIRE_TIMING|SS_BACKGROUND|SS_NO_INIT
flags = SS_POST_FIRE_TIMING|SS_BACKGROUND|SS_NO_INIT
runlevels = RUNLEVELS_DEFAULT | RUNLEVEL_LOBBY
var/collection_timeout = 3000// deciseconds to wait to let running procs finish before we just say fuck it and force del() the object
var/delslasttick = 0 // number of del()'s we've done this tick
@@ -60,7 +61,7 @@ SUBSYSTEM_DEF(garbage)
for(var/path in sleptDestroy)
dellog += "Path : [path] \n"
dellog += "Sleeps : [sleptDestroy[path]] \n"
log_world(dellog.Join())
text2file("[GLOB.log_directory]/qdel.log", dellog.Join())
/datum/controller/subsystem/garbage/fire()
HandleToBeQueued()
+1
View File
@@ -2,6 +2,7 @@ SUBSYSTEM_DEF(inbounds)
name = "Inbounds"
priority = 40
flags = SS_NO_INIT
runlevels = RUNLEVEL_GAME
var/list/processing = list()
var/list/currentrun = list()
+4 -14
View File
@@ -287,8 +287,6 @@ SUBSYSTEM_DEF(job)
if(PopcapReached())
RejectPlayer(player)
var/datum/job/validjob
// Loop through all jobs
for(var/datum/job/job in shuffledoccupations) // SHUFFLE ME BABY
if(!job)
@@ -315,19 +313,11 @@ SUBSYSTEM_DEF(job)
// If the job isn't filled
if((job.current_positions < job.spawn_positions) || job.spawn_positions == -1)
Debug("DO pass, Player: [player], Level:[level], Job:[job.title]")
AssignRole(player, job.title)
unassigned -= player
break
validjob = job
//Is the Job empty? Stop Looking Then!
if (!job.current_positions)
break
//Assign us the last job we found
if (validjob)
Debug("DO pass, Player: [player], Level:[level], Job:[validjob.title]")
AssignRole(player, validjob.title)
unassigned -= player
break
// Hand out random jobs to the people who didn't get any in the last check
// Also makes sure that they got their preference correct
+18
View File
@@ -0,0 +1,18 @@
SUBSYSTEM_DEF(language)
name = "Language"
init_order = INIT_ORDER_LANGUAGE
flags = SS_NO_FIRE
/datum/controller/subsystem/language/Initialize(timeofday)
for(var/L in subtypesof(/datum/language))
var/datum/language/language = L
if(!initial(language.key))
continue
GLOB.all_languages += language
var/datum/language/instance = new language
GLOB.language_datum_instances[language] = instance
return ..()
+1
View File
@@ -2,6 +2,7 @@ SUBSYSTEM_DEF(mobs)
name = "Mobs"
priority = 100
flags = SS_KEEP_TIMING|SS_NO_INIT
runlevels = RUNLEVEL_GAME | RUNLEVEL_POSTGAME
var/list/currentrun = list()
+1
View File
@@ -7,6 +7,7 @@ SUBSYSTEM_DEF(npcpool)
name = "NPC Pool"
flags = SS_POST_FIRE_TIMING|SS_NO_INIT|SS_BACKGROUND
priority = 20
runlevels = RUNLEVEL_GAME | RUNLEVEL_POSTGAME
var/list/canBeUsed = list()
var/list/needsDelegate = list()
+2 -1
View File
@@ -1,8 +1,9 @@
SUBSYSTEM_DEF(parallax)
name = "Parallax"
wait = 2
flags = SS_POST_FIRE_TIMING | SS_FIRE_IN_LOBBY | SS_BACKGROUND | SS_NO_INIT
flags = SS_POST_FIRE_TIMING | SS_BACKGROUND | SS_NO_INIT
priority = 65
runlevels = RUNLEVEL_LOBBY | RUNLEVELS_DEFAULT
var/list/currentrun
/datum/controller/subsystem/parallax/fire(resumed = 0)
@@ -1,9 +1,10 @@
PROCESSING_SUBSYSTEM_DEF(overlays)
name = "Overlay"
flags = SS_TICKER|SS_FIRE_IN_LOBBY
flags = SS_TICKER
wait = 1
priority = 500
init_order = INIT_ORDER_OVERLAY
runlevels = RUNLEVELS_DEFAULT | RUNLEVEL_SETUP
stat_tag = "Ov"
currentrun = null
+2 -1
View File
@@ -3,8 +3,9 @@
SUBSYSTEM_DEF(server_maint)
name = "Server Tasks"
wait = 6
flags = SS_POST_FIRE_TIMING|SS_FIRE_IN_LOBBY
flags = SS_POST_FIRE_TIMING
priority = 10
runlevels = RUNLEVEL_LOBBY | RUNLEVELS_DEFAULT
var/list/currentrun
/datum/controller/subsystem/server_maint/Initialize(timeofday)
+12 -1
View File
@@ -5,6 +5,7 @@ SUBSYSTEM_DEF(shuttle)
wait = 10
init_order = INIT_ORDER_SHUTTLE
flags = SS_KEEP_TIMING|SS_NO_TICK_CHECK
runlevels = RUNLEVEL_SETUP | RUNLEVEL_GAME
var/list/mobile = list()
var/list/stationary = list()
@@ -48,7 +49,7 @@ SUBSYSTEM_DEF(shuttle)
var/auto_call = 72000 //time before in deciseconds in which the shuttle is auto called. Default is 2 hours.
/datum/controller/subsystem/shuttle/Initialize(timeofday)
if(!emergency)
if(!arrivals)
WARNING("No /obj/docking_port/mobile/arrivals placed on the map!")
if(!emergency)
WARNING("No /obj/docking_port/mobile/emergency placed on the map!")
@@ -513,3 +514,13 @@ SUBSYSTEM_DEF(shuttle)
centcom_message = SSshuttle.centcom_message
ordernum = SSshuttle.ordernum
points = SSshuttle.points
/datum/controller/subsystem/shuttle/proc/is_in_shuttle_bounds(atom/A)
var/area/current = get_area(A)
if(istype(current, /area/shuttle) && !istype(current,/area/shuttle/transit))
return TRUE
for(var/obj/docking_port/mobile/M in mobile)
if(M.is_in_shuttle_bounds(A))
return TRUE
+1
View File
@@ -3,6 +3,7 @@ SUBSYSTEM_DEF(spacedrift)
priority = 30
wait = 5
flags = SS_NO_INIT|SS_KEEP_TIMING
runlevels = RUNLEVEL_GAME | RUNLEVEL_POSTGAME
var/list/currentrun = list()
var/list/processing = list()
+2 -1
View File
@@ -1,8 +1,9 @@
SUBSYSTEM_DEF(tgui)
name = "tgui"
wait = 9
flags = SS_NO_INIT|SS_FIRE_IN_LOBBY
flags = SS_NO_INIT
priority = 110
runlevels = RUNLEVEL_LOBBY | RUNLEVELS_DEFAULT
var/list/currentrun = list()
var/list/open_uis = list() // A list of open UIs, grouped by src_object and ui_key.
+1
View File
@@ -6,6 +6,7 @@ SUBSYSTEM_DEF(throwing)
priority = 25
wait = 1
flags = SS_NO_INIT|SS_KEEP_TIMING|SS_TICKER
runlevels = RUNLEVEL_GAME | RUNLEVEL_POSTGAME
var/list/currentrun
var/list/processing = list()
+25 -4
View File
@@ -5,7 +5,8 @@ SUBSYSTEM_DEF(ticker)
init_order = INIT_ORDER_TICKER
priority = 200
flags = SS_FIRE_IN_LOBBY|SS_KEEP_TIMING
flags = SS_KEEP_TIMING
runlevels = RUNLEVEL_LOBBY | RUNLEVEL_SETUP | RUNLEVEL_GAME
var/current_state = GAME_STATE_STARTUP //state of current round (used by process()) Use the defines GAME_STATE_* !
var/force_ending = 0 //Round was ended by admin intervention
@@ -109,6 +110,7 @@ SUBSYSTEM_DEF(ticker)
if(timeLeft <= 0)
current_state = GAME_STATE_SETTING_UP
Master.SetRunLevel(RUNLEVEL_SETUP)
if(start_immediately)
fire()
@@ -116,6 +118,7 @@ SUBSYSTEM_DEF(ticker)
if(!setup())
//setup failed
current_state = GAME_STATE_STARTUP
Master.SetRunLevel(RUNLEVEL_LOBBY)
if(GAME_STATE_PLAYING)
mode.process(wait * 0.1)
@@ -128,6 +131,7 @@ SUBSYSTEM_DEF(ticker)
current_state = GAME_STATE_FINISHED
toggle_ooc(1) // Turn it on
declare_completion(force_ending)
Master.SetRunLevel(RUNLEVEL_POSTGAME)
/datum/controller/subsystem/ticker/proc/setup()
to_chat(world, "<span class='boldannounce'>Starting game...</span>")
@@ -204,8 +208,6 @@ SUBSYSTEM_DEF(ticker)
transfer_characters() //transfer keys to the new mobs
Master.RoundStart() //let the party begin...
for(var/I in round_start_events)
var/datum/callback/cb = I
cb.InvokeAsync()
@@ -218,6 +220,7 @@ SUBSYSTEM_DEF(ticker)
world << sound('sound/AI/welcome.ogg')
current_state = GAME_STATE_PLAYING
Master.SetRunLevel(RUNLEVEL_GAME)
if(SSevents.holidays)
to_chat(world, "<font color='blue'>and...</font>")
@@ -281,7 +284,7 @@ SUBSYSTEM_DEF(ticker)
//Now animate the cinematic
switch(station_missed)
if(NUKE_NEAR_MISS) //nuke was nearby but (mostly) missed
if( mode && !override )
if(mode && !override )
override = mode.name
switch( override )
if("nuclear emergency") //Nuke wasn't on station when it blew up
@@ -291,6 +294,17 @@ SUBSYSTEM_DEF(ticker)
station_explosion_detonation(bomb)
flick("station_intact_fade_red",cinematic)
cinematic.icon_state = "summary_nukefail"
if("cult")
cinematic.icon_state = null
flick("intro_cult",cinematic)
sleep(25)
world << sound('sound/magic/enter_blood.ogg')
sleep(28)
world << sound('sound/machines/terminal_off.ogg')
sleep(20)
flick("station_corrupted",cinematic)
world << sound('sound/effects/ghost.ogg')
actually_blew_up = FALSE
if("gang war") //Gang Domination (just show the override screen)
cinematic.icon_state = "intro_malf_still"
flick("intro_malf",cinematic)
@@ -339,6 +353,13 @@ SUBSYSTEM_DEF(ticker)
world << sound('sound/effects/explosionfar.ogg')
station_explosion_detonation(bomb) //TODO: no idea what this case could be
cinematic.icon_state = "summary_selfdes"
if("cult") //Station nuked (nuke,explosion,summary)
flick("intro_nuke",cinematic)
sleep(35)
flick("station_explode_fade_red",cinematic)
world << sound('sound/effects/explosionfar.ogg')
station_explosion_detonation(bomb) //TODO: no idea what this case could be
cinematic.icon_state = "summary_cult"
if("no_core") //Nuke failed to detonate as it had no core
flick("intro_nuke",cinematic)
sleep(35)
+2 -1
View File
@@ -1,7 +1,8 @@
SUBSYSTEM_DEF(time_track)
name = "Time Tracking"
wait = 600
flags = SS_NO_INIT|SS_FIRE_IN_LOBBY|SS_NO_TICK_CHECK
flags = SS_NO_INIT|SS_NO_TICK_CHECK
runlevels = RUNLEVEL_LOBBY | RUNLEVELS_DEFAULT
var/time_dilation_current = 0
+1 -1
View File
@@ -6,7 +6,7 @@ SUBSYSTEM_DEF(timer)
wait = 1 //SS_TICKER subsystem, so wait is in ticks
init_order = INIT_ORDER_TIMER
flags = SS_FIRE_IN_LOBBY|SS_TICKER|SS_NO_INIT
flags = SS_TICKER|SS_NO_INIT
var/list/datum/timedevent/processing = list()
var/list/hashes = list()
+3 -1
View File
@@ -2,7 +2,9 @@ SUBSYSTEM_DEF(vote)
name = "Vote"
wait = 10
flags = SS_FIRE_IN_LOBBY|SS_KEEP_TIMING|SS_NO_INIT
flags = SS_KEEP_TIMING|SS_NO_INIT
runlevels = RUNLEVEL_LOBBY | RUNLEVELS_DEFAULT
var/initiator = null
var/started_time = null
+1
View File
@@ -3,6 +3,7 @@ SUBSYSTEM_DEF(weather)
name = "Weather"
flags = SS_BACKGROUND
wait = 10
runlevels = RUNLEVEL_GAME
var/list/processing = list()
var/list/existing_weather = list()
var/list/eligible_zlevels = list(ZLEVEL_LAVALAND)