Skip to content

Commit

Permalink
Changes investigate logs to use a define (tgstation#27503)
Browse files Browse the repository at this point in the history
  • Loading branch information
lzimann authored and optimumtact committed May 23, 2017
1 parent 855224e commit 7d91e31
Show file tree
Hide file tree
Showing 40 changed files with 143 additions and 131 deletions.
18 changes: 18 additions & 0 deletions code/__DEFINES/logging.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
//Investigate logging defines
#define INVESTIGATE_ATMOS "atmos"
#define INVESTIGATE_BOTANY "botany"
#define INVESTIGATE_CARGO "cargo"
#define INVESTIGATE_EXPERIMENTOR "experimentor"
#define INVESTIGATE_GRAVITY "gravity"
#define INVESTIGATE_RECORDS "records"
#define INVESTIGATE_SINGULO "singulo"
#define INVESTIGATE_SUPERMATTER "supermatter"
#define INVESTIGATE_TELESCI "telesci"
#define INVESTIGATE_WIRES "wires"

//Individual logging defines
#define INDIVIDUAL_ATTACK_LOG "Attack log"
#define INDIVIDUAL_SAY_LOG "Say log"
#define INDIVIDUAL_EMOTE_LOG "Emote log"
#define INDIVIDUAL_OOC_LOG "OOC log"
#define INDIVIDUAL_SHOW_ALL_LOG "All logs"
7 changes: 0 additions & 7 deletions code/__DEFINES/mobs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -114,13 +114,6 @@
#define SNPC_MARTYR 3
#define SNPC_PSYCHO 4

//Individual logging defines
#define INDIVIDUAL_ATTACK_LOG "Attack log"
#define INDIVIDUAL_SAY_LOG "Say log"
#define INDIVIDUAL_EMOTE_LOG "Emote log"
#define INDIVIDUAL_OOC_LOG "OOC log"
#define INDIVIDUAL_SHOW_ALL_LOG "All logs"

#define TK_MAXRANGE 15

#define NO_SLIP_WHEN_WALKING 1
Expand Down
4 changes: 2 additions & 2 deletions code/game/machinery/computer/medical.dm
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@
src.temp = text("Are you sure you wish to delete all records?<br>\n\t<A href='?src=\ref[];temp=1;del_all2=1'>Yes</A><br>\n\t<A href='?src=\ref[];temp=1'>No</A><br>", src, src)

else if(href_list["del_all2"])
investigate_log("[usr.name] ([usr.key]) has deleted all medical records.", "records")
investigate_log("[usr.name] ([usr.key]) has deleted all medical records.", INVESTIGATE_RECORDS)
GLOB.data_core.medical.Cut()
src.temp = "All records deleted."

Expand Down Expand Up @@ -458,7 +458,7 @@
src.temp = text("Are you sure you wish to delete the record (Medical Portion Only)?<br>\n\t<A href='?src=\ref[];temp=1;del_r2=1'>Yes</A><br>\n\t<A href='?src=\ref[];temp=1'>No</A><br>", src, src)

else if(href_list["del_r2"])
investigate_log("[usr.name] ([usr.key]) has deleted the medical records for [active1.fields["name"]].", "records")
investigate_log("[usr.name] ([usr.key]) has deleted the medical records for [active1.fields["name"]].", INVESTIGATE_RECORDS)
if(active2)
qdel(active2)
active2 = null
Expand Down
8 changes: 4 additions & 4 deletions code/game/machinery/computer/security.dm
Original file line number Diff line number Diff line change
Expand Up @@ -452,7 +452,7 @@ What a mess.*/
temp += "<a href='?src=\ref[src];choice=Clear Screen'>No</a>"

if("Purge All Records")
investigate_log("[usr.name] ([usr.key]) has purged all the security records.", "records")
investigate_log("[usr.name] ([usr.key]) has purged all the security records.", INVESTIGATE_RECORDS)
for(var/datum/data/record/R in GLOB.data_core.security)
qdel(R)
GLOB.data_core.security.Cut()
Expand Down Expand Up @@ -696,18 +696,18 @@ What a mess.*/
active2.fields["criminal"] = "Parolled"
if("released")
active2.fields["criminal"] = "Discharged"
investigate_log("[active1.fields["name"]] has been set from [old_field] to [active2.fields["criminal"]] by [usr.name] ([usr.key]).", "records")
investigate_log("[active1.fields["name"]] has been set from [old_field] to [active2.fields["criminal"]] by [usr.name] ([usr.key]).", INVESTIGATE_RECORDS)
for(var/mob/living/carbon/human/H in GLOB.mob_list) //thanks for forcing me to do this, whoever wrote this shitty records system
H.sec_hud_set_security_status()
if("Delete Record (Security) Execute")
investigate_log("[usr.name] ([usr.key]) has deleted the security records for [active1.fields["name"]].", "records")
investigate_log("[usr.name] ([usr.key]) has deleted the security records for [active1.fields["name"]].", INVESTIGATE_RECORDS)
if(active2)
qdel(active2)
active2 = null

if("Delete Record (ALL) Execute")
if(active1)
investigate_log("[usr.name] ([usr.key]) has deleted all records for [active1.fields["name"]].", "records")
investigate_log("[usr.name] ([usr.key]) has deleted all records for [active1.fields["name"]].", INVESTIGATE_RECORDS)
for(var/datum/data/record/R in GLOB.data_core.medical)
if((R.fields["name"] == active1.fields["name"] || R.fields["id"] == active1.fields["id"]))
qdel(R)
Expand Down
2 changes: 1 addition & 1 deletion code/game/machinery/launch_pad.dm
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@
else
log_msg += "nothing"
log_msg += " [sending ? "to" : "from"] [target_x], [target_y], [z] ([A ? A.name : "null area"])"
investigate_log(log_msg.Join(), "telesci")
investigate_log(log_msg.Join(), INVESTIGATE_TELESCI)
updateDialog()

//Starts in the briefcase. Don't spawn this directly, or it will runtime when closing.
Expand Down
2 changes: 1 addition & 1 deletion code/game/objects/items/weapons/storage/backpack.dm
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
var/safety = alert(user, "Doing this will have extremely dire consequences for the station and its crew. Be sure you know what you're doing.", "Put in [name]?", "Proceed", "Abort")
if(safety == "Abort" || !in_range(src, user) || !src || !W || user.incapacitated())
return
investigate_log("has become a singularity. Caused by [user.key]","singulo")
investigate_log("has become a singularity. Caused by [user.key]", INVESTIGATE_SINGULO)
to_chat(user, "<span class='danger'>The Bluespace interfaces of the two devices catastrophically malfunction!</span>")
qdel(W)
var/obj/singularity/singulo = new /obj/singularity (get_turf(src))
Expand Down
2 changes: 1 addition & 1 deletion code/modules/admin/admin_investigate.dm
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
F << "<small>[time_stamp()] \ref[src] ([x],[y],[z])</small> || [src] [message]<br>"


/client/proc/investigate_show( subject in list("hrefs","notes, memos, watchlist","singulo","wires","telesci", "gravity", "records", "cargo", "supermatter", "atmos", "experimentor", "botany") )
/client/proc/investigate_show(subject in list("hrefs","notes, memos, watchlist", INVESTIGATE_SINGULO, INVESTIGATE_WIRES, INVESTIGATE_TELESCI, INVESTIGATE_GRAVITY, INVESTIGATE_RECORDS, INVESTIGATE_CARGO, INVESTIGATE_SUPERMATTER, INVESTIGATE_ATMOS, INVESTIGATE_EXPERIMENTOR, INVESTIGATE_BOTANY) )
set name = "Investigate"
set category = "Admin"
if(!holder)
Expand Down
2 changes: 1 addition & 1 deletion code/modules/atmospherics/machinery/atmosmachinery.dm
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ Pipelines + Other Objects -> Pipe network
"[user] unfastens \the [src].", \
"<span class='notice'>You unfasten \the [src].</span>", \
"<span class='italics'>You hear ratchet.</span>")
investigate_log("was <span class='warning'>REMOVED</span> by [key_name(usr)]", "atmos")
investigate_log("was <span class='warning'>REMOVED</span> by [key_name(usr)]", INVESTIGATE_ATMOS)

//You unwrenched a pipe full of pressure? Let's splat you into the wall, silly.
if(unsafe_wrenching)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ Passive gate is similar to the regular pump except:
switch(action)
if("power")
on = !on
investigate_log("was turned [on ? "on" : "off"] by [key_name(usr)]", "atmos")
investigate_log("was turned [on ? "on" : "off"] by [key_name(usr)]", INVESTIGATE_ATMOS)
. = TRUE
if("pressure")
var/pressure = params["pressure"]
Expand All @@ -128,7 +128,7 @@ Passive gate is similar to the regular pump except:
. = TRUE
if(.)
target_pressure = Clamp(pressure, 0, MAX_OUTPUT_PRESSURE)
investigate_log("was set to [target_pressure] kPa by [key_name(usr)]", "atmos")
investigate_log("was set to [target_pressure] kPa by [key_name(usr)]", INVESTIGATE_ATMOS)
update_icon()

/obj/machinery/atmospherics/components/binary/passive_gate/atmosinit()
Expand All @@ -152,7 +152,7 @@ Passive gate is similar to the regular pump except:
target_pressure = Clamp(text2num(signal.data["set_output_pressure"]),0,ONE_ATMOSPHERE*50)

if(on != old_on)
investigate_log("was turned [on ? "on" : "off"] by a remote signal", "atmos")
investigate_log("was turned [on ? "on" : "off"] by a remote signal", INVESTIGATE_ATMOS)

if("status" in signal.data)
broadcast_status()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ Thus, the two variables affect pump operation are set in New():
switch(action)
if("power")
on = !on
investigate_log("was turned [on ? "on" : "off"] by [key_name(usr)]", "atmos")
investigate_log("was turned [on ? "on" : "off"] by [key_name(usr)]", INVESTIGATE_ATMOS)
. = TRUE
if("pressure")
var/pressure = params["pressure"]
Expand All @@ -135,7 +135,7 @@ Thus, the two variables affect pump operation are set in New():
. = TRUE
if(.)
target_pressure = Clamp(pressure, 0, MAX_OUTPUT_PRESSURE)
investigate_log("was set to [target_pressure] kPa by [key_name(usr)]", "atmos")
investigate_log("was set to [target_pressure] kPa by [key_name(usr)]", INVESTIGATE_ATMOS)
update_icon()

/obj/machinery/atmospherics/components/binary/pump/atmosinit()
Expand All @@ -159,7 +159,7 @@ Thus, the two variables affect pump operation are set in New():
target_pressure = Clamp(text2num(signal.data["set_output_pressure"]),0,ONE_ATMOSPHERE*50)

if(on != old_on)
investigate_log("was turned [on ? "on" : "off"] by a remote signal", "atmos")
investigate_log("was turned [on ? "on" : "off"] by a remote signal", INVESTIGATE_ATMOS)

if("status" in signal.data)
broadcast_status()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@ It's like a regular ol' straight pipe, but you can turn it on and off.
update_parents()
var/datum/pipeline/parent1 = PARENT1
parent1.reconcile_air()
investigate_log("was opened by [usr ? key_name(usr) : "a remote signal"]", "atmos")
investigate_log("was opened by [usr ? key_name(usr) : "a remote signal"]", INVESTIGATE_ATMOS)

/obj/machinery/atmospherics/components/binary/valve/proc/close()
open = 0
update_icon_nopipes()
investigate_log("was closed by [usr ? key_name(usr) : "a remote signal"]", "atmos")
investigate_log("was closed by [usr ? key_name(usr) : "a remote signal"]", INVESTIGATE_ATMOS)

/obj/machinery/atmospherics/components/binary/valve/proc/normalize_dir()
if(dir==SOUTH)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ Thus, the two variables affect pump operation are set in New():
switch(action)
if("power")
on = !on
investigate_log("was turned [on ? "on" : "off"] by [key_name(usr)]", "atmos")
investigate_log("was turned [on ? "on" : "off"] by [key_name(usr)]", INVESTIGATE_ATMOS)
. = TRUE
if("rate")
var/rate = params["rate"]
Expand All @@ -135,7 +135,7 @@ Thus, the two variables affect pump operation are set in New():
. = TRUE
if(.)
transfer_rate = Clamp(rate, 0, MAX_TRANSFER_RATE)
investigate_log("was set to [transfer_rate] L/s by [key_name(usr)]", "atmos")
investigate_log("was set to [transfer_rate] L/s by [key_name(usr)]", INVESTIGATE_ATMOS)
update_icon()

/obj/machinery/atmospherics/components/binary/volume_pump/receive_signal(datum/signal/signal)
Expand All @@ -155,7 +155,7 @@ Thus, the two variables affect pump operation are set in New():
transfer_rate = Clamp(text2num(signal.data["set_transfer_rate"]),0,air1.volume)

if(on != old_on)
investigate_log("was turned [on ? "on" : "off"] by a remote signal", "atmos")
investigate_log("was turned [on ? "on" : "off"] by a remote signal", INVESTIGATE_ATMOS)

if("status" in signal.data)
broadcast_status()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,20 +83,20 @@

if(!removed)
return

var/filtering = filter_type ? TRUE : FALSE

if(filtering && !istext(filter_type))
WARNING("Wrong gas ID in [src]'s filter_type var. filter_type == [filter_type]")
filtering = FALSE

if(filtering && removed.gases[filter_type])
var/datum/gas_mixture/filtered_out = new

filtered_out.temperature = removed.temperature
filtered_out.assert_gas(filter_type)
filtered_out.gases[filter_type][MOLES] = removed.gases[filter_type][MOLES]

removed.gases[filter_type][MOLES] = 0
removed.garbage_collect()

Expand Down Expand Up @@ -133,7 +133,7 @@
switch(action)
if("power")
on = !on
investigate_log("was turned [on ? "on" : "off"] by [key_name(usr)]", "atmos")
investigate_log("was turned [on ? "on" : "off"] by [key_name(usr)]", INVESTIGATE_ATMOS)
. = TRUE
if("pressure")
var/pressure = params["pressure"]
Expand All @@ -149,14 +149,14 @@
. = TRUE
if(.)
target_pressure = Clamp(pressure, 0, MAX_OUTPUT_PRESSURE)
investigate_log("was set to [target_pressure] kPa by [key_name(usr)]", "atmos")
investigate_log("was set to [target_pressure] kPa by [key_name(usr)]", INVESTIGATE_ATMOS)
if("filter")
filter_type = ""
var/filter_name = "nothing"
var/gas = params["mode"]
if(gas in GLOB.meta_gas_info)
filter_type = gas
filter_name = GLOB.meta_gas_info[gas][META_GAS_NAME]
investigate_log("was set to filter [filter_name] by [key_name(usr)]", "atmos")
investigate_log("was set to filter [filter_name] by [key_name(usr)]", INVESTIGATE_ATMOS)
. = TRUE
update_icon()
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@
switch(action)
if("power")
on = !on
investigate_log("was turned [on ? "on" : "off"] by [key_name(usr)]", "atmos")
investigate_log("was turned [on ? "on" : "off"] by [key_name(usr)]", INVESTIGATE_ATMOS)
. = TRUE
if("pressure")
var/pressure = params["pressure"]
Expand All @@ -154,17 +154,17 @@
. = TRUE
if(.)
target_pressure = Clamp(pressure, 0, MAX_OUTPUT_PRESSURE)
investigate_log("was set to [target_pressure] kPa by [key_name(usr)]", "atmos")
investigate_log("was set to [target_pressure] kPa by [key_name(usr)]", INVESTIGATE_ATMOS)
if("node1")
var/value = text2num(params["concentration"])
node1_concentration = max(0, min(1, node1_concentration + value))
node2_concentration = max(0, min(1, node2_concentration - value))
investigate_log("was set to [node1_concentration] % on node 1 by [key_name(usr)]", "atmos")
investigate_log("was set to [node1_concentration] % on node 1 by [key_name(usr)]", INVESTIGATE_ATMOS)
. = TRUE
if("node2")
var/value = text2num(params["concentration"])
node2_concentration = max(0, min(1, node2_concentration + value))
node1_concentration = max(0, min(1, node1_concentration - value))
investigate_log("was set to [node2_concentration] % on node 2 by [key_name(usr)]", "atmos")
investigate_log("was set to [node2_concentration] % on node 2 by [key_name(usr)]", INVESTIGATE_ATMOS)
. = TRUE
update_icon()
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@
switch(action)
if("power")
on = !on
investigate_log("was turned [on ? "on" : "off"] by [key_name(usr)]", "atmos")
investigate_log("was turned [on ? "on" : "off"] by [key_name(usr)]", INVESTIGATE_ATMOS)
. = TRUE
if("rate")
var/rate = params["rate"]
Expand All @@ -183,7 +183,7 @@
. = TRUE
if(.)
volume_rate = Clamp(rate, 0, MAX_TRANSFER_RATE)
investigate_log("was set to [volume_rate] L/s by [key_name(usr)]", "atmos")
investigate_log("was set to [volume_rate] L/s by [key_name(usr)]", INVESTIGATE_ATMOS)
update_icon()
broadcast_status()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@
if("power")
on = !on
use_power = 1 + on
investigate_log("was turned [on ? "on" : "off"] by [key_name(usr)]", "atmos")
investigate_log("was turned [on ? "on" : "off"] by [key_name(usr)]", INVESTIGATE_ATMOS)
. = TRUE
if("target")
var/target = params["target"]
Expand All @@ -190,7 +190,7 @@
. = TRUE
if(.)
target_temperature = Clamp(target, min_temperature, max_temperature)
investigate_log("was set to [target_temperature] K by [key_name(usr)]", "atmos")
investigate_log("was set to [target_temperature] K by [key_name(usr)]", INVESTIGATE_ATMOS)
update_icon()

/obj/machinery/atmospherics/components/unary/thermomachine/freezer
Expand Down
6 changes: 3 additions & 3 deletions code/modules/atmospherics/machinery/portable/canister.dm
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@
density = 0
playsound(src.loc, 'sound/effects/spray.ogg', 10, 1, -3)
update_icon()
investigate_log("was destroyed.", "atmos")
investigate_log("was destroyed.", INVESTIGATE_ATMOS)

if(holding)
holding.forceMove(T)
Expand Down Expand Up @@ -388,7 +388,7 @@
. = TRUE
if(.)
release_pressure = Clamp(round(pressure), can_min_release_pressure, can_max_release_pressure)
investigate_log("was set to [release_pressure] kPa by [key_name(usr)].", "atmos")
investigate_log("was set to [release_pressure] kPa by [key_name(usr)].", INVESTIGATE_ATMOS)
if("valve")
var/logmsg
valve_open = !valve_open
Expand Down Expand Up @@ -439,7 +439,7 @@
if("eject")
if(holding)
if(valve_open)
investigate_log("[key_name(usr)] removed the [holding], leaving the valve open and transfering into the <span class='boldannounce'>air</span><br>", "atmos")
investigate_log("[key_name(usr)] removed the [holding], leaving the valve open and transfering into the <span class='boldannounce'>air</span><br>", INVESTIGATE_ATMOS)
holding.forceMove(get_turf(src))
holding = null
. = TRUE
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,6 @@
if(I.force < 10 && !(stat & BROKEN))
take_damage(0)
else
investigate_log("was smacked with \a [I] by [key_name(user)].", "atmos")
investigate_log("was smacked with \a [I] by [key_name(user)].", INVESTIGATE_ATMOS)
add_fingerprint(user)
..()
2 changes: 1 addition & 1 deletion code/modules/atmospherics/machinery/portable/pump.dm
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@
. = TRUE
if(.)
pump.target_pressure = Clamp(round(pressure), PUMP_MIN_PRESSURE, PUMP_MAX_PRESSURE)
investigate_log("was set to [pump.target_pressure] kPa by [key_name(usr)].", "atmos")
investigate_log("was set to [pump.target_pressure] kPa by [key_name(usr)].", INVESTIGATE_ATMOS)
if("eject")
if(holding)
holding.loc = get_turf(src)
Expand Down
6 changes: 3 additions & 3 deletions code/modules/cargo/console.dm
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
var/safety_warning = "For safety reasons the automated supply shuttle \
cannot transport live organisms, classified nuclear weaponry or \
homing beacons."

light_color = "#E2853D"//orange

/obj/machinery/computer/cargo/request
Expand Down Expand Up @@ -106,9 +106,9 @@
SSshuttle.supply.contraband = contraband
SSshuttle.moveShuttle("supply", "supply_away", TRUE)
say("The supply shuttle has departed.")
investigate_log("[key_name(usr)] sent the supply shuttle away.", "cargo")
investigate_log("[key_name(usr)] sent the supply shuttle away.", INVESTIGATE_CARGO)
else
investigate_log("[key_name(usr)] called the supply shuttle.", "cargo")
investigate_log("[key_name(usr)] called the supply shuttle.", INVESTIGATE_CARGO)
say("The supply shuttle has been called and will arrive in [SSshuttle.supply.timeLeft(600)] minutes.")
SSshuttle.moveShuttle("supply", "supply_home", TRUE)
. = TRUE
Expand Down
Loading

0 comments on commit 7d91e31

Please sign in to comment.