Merge pull request #10869 from kevinz000/WHY

can we talk about how admin attack logs being viewable in game is not a good thing, alternatively "i want a word with whoever coded mech logging"
This commit is contained in:
Ghom
2020-02-05 06:52:20 +01:00
committed by GitHub
11 changed files with 66 additions and 70 deletions
+6 -10
View File
@@ -43,7 +43,7 @@
/obj/item/mecha_parts/mecha_equipment/proc/critfail()
if(chassis)
log_message("Critical failure", color="red")
mecha_log_message("Critical failure", color="red")
/obj/item/mecha_parts/mecha_equipment/proc/get_equip_info()
if(!chassis)
@@ -116,7 +116,7 @@
M.equipment += src
chassis = M
forceMove(M)
M.log_message("[src] initialized.")
M.mecha_log_message("[src] initialized.")
if(!M.selected && selectable)
M.selected = src
src.update_chassis_page()
@@ -129,7 +129,7 @@
if(chassis.selected == src)
chassis.selected = null
update_chassis_page()
chassis.log_message("[src] removed from equipment.")
chassis.mecha_log_message("[src] removed from equipment.")
chassis = null
set_ready_state(1)
return
@@ -150,18 +150,14 @@
chassis.occupant_message("[icon2html(src, chassis.occupant)] [message]")
return
/obj/item/mecha_parts/mecha_equipment/log_message(message, message_type=LOG_GAME, color=null, log_globally)
/obj/item/mecha_parts/mecha_equipment/proc/mecha_log_message(message, color)
log_message(message, LOG_GAME, color) //pass to default admin logging too
if(chassis)
chassis.log_message("([src]) [message]", message_type, color)
else
..()
return
chassis.mecha_log_message(message, color) //and pass to our chassis
//Used for reloading weapons/tools etc. that use some form of resource
/obj/item/mecha_parts/mecha_equipment/proc/rearm()
return 0
/obj/item/mecha_parts/mecha_equipment/proc/needs_rearm()
return 0
@@ -66,7 +66,7 @@
update_equip_info()
occupant_message("<span class='notice'>[target] successfully loaded into [src]. Life support functions engaged.</span>")
chassis.visible_message("<span class='warning'>[chassis] loads [target] into [src].</span>")
log_message("[target] loaded. Life support functions engaged.")
mecha_log_message("[target] loaded. Life support functions engaged.")
/obj/item/mecha_parts/mecha_equipment/medical/sleeper/proc/patient_insertion_check(mob/living/carbon/target)
if(target.buckled)
@@ -85,7 +85,7 @@
return
patient.forceMove(get_turf(src))
occupant_message("[patient] ejected. Life support functions disabled.")
log_message("[patient] ejected. Life support functions disabled.")
mecha_log_message("[patient] ejected. Life support functions disabled.")
STOP_PROCESSING(SSobj, src)
patient = null
update_equip_info()
@@ -193,7 +193,7 @@
var/to_inject = min(R.volume, inject_amount)
if(to_inject && patient.reagents.get_reagent_amount(R.type) + to_inject <= inject_amount*2)
occupant_message("Injecting [patient] with [to_inject] units of [R.name].")
log_message("Injecting [patient] with [to_inject] units of [R.name].")
mecha_log_message("Injecting [patient] with [to_inject] units of [R.name].")
log_combat(chassis.occupant, patient, "injected", "[name] ([R] - [to_inject] units)")
SG.reagents.trans_id_to(patient,R.type,to_inject)
update_equip_info()
@@ -216,7 +216,7 @@
return
if(!chassis.has_charge(energy_drain))
set_ready_state(1)
log_message("Deactivated.")
mecha_log_message("Deactivated.")
occupant_message("[src] deactivated - no power.")
STOP_PROCESSING(SSobj, src)
return
@@ -312,7 +312,7 @@
mechsyringe.icon = 'icons/obj/chemical.dmi'
mechsyringe.icon_state = "syringeproj"
playsound(chassis, 'sound/items/syringeproj.ogg', 50, 1)
log_message("Launched [mechsyringe] from [src], targeting [target].")
mecha_log_message("Launched [mechsyringe] from [src], targeting [target].")
var/mob/originaloccupant = chassis.occupant
spawn(0)
src = null //if src is deleted, still process the syringe
@@ -376,7 +376,7 @@
START_PROCESSING(SSobj, src)
occupant_message(message)
occupant_message("Reagent processing started.")
log_message("Reagent processing started.")
mecha_log_message("Reagent processing started.")
return
if(afilter.get("show_reagents"))
chassis.occupant << browse(get_reagents_page(),"window=msyringegun")
@@ -511,7 +511,7 @@
return
if(!processed_reagents.len || reagents.total_volume >= reagents.maximum_volume || !chassis.has_charge(energy_drain))
occupant_message("<span class=\"alert\">Reagent processing stopped.</a>")
log_message("Reagent processing stopped.")
mecha_log_message("Reagent processing stopped.")
STOP_PROCESSING(SSobj, src)
return
var/amount = synth_speed / processed_reagents.len
@@ -37,7 +37,7 @@
if(do_after_cooldown(target))
set_ready_state(FALSE)
log_message("Started drilling [target]")
mecha_log_message("Started drilling [target]")
if(isturf(target))
var/turf/T = target
T.drill_act(src)
@@ -61,13 +61,13 @@
/turf/closed/wall/drill_act(obj/item/mecha_parts/mecha_equipment/drill/drill)
if(drill.do_after_mecha(src, 60 / drill.drill_level))
drill.log_message("Drilled through [src]")
drill.mecha_log_message("Drilled through [src]")
dismantle_wall(TRUE, FALSE)
/turf/closed/wall/r_wall/drill_act(obj/item/mecha_parts/mecha_equipment/drill/drill)
if(drill.drill_level >= DRILL_HARDENED)
if(drill.do_after_mecha(src, 120 / drill.drill_level))
drill.log_message("Drilled through [src]")
drill.mecha_log_message("Drilled through [src]")
dismantle_wall(TRUE, FALSE)
else
drill.occupant_message("<span class='danger'>[src] is too durable to drill through.</span>")
@@ -76,14 +76,14 @@
for(var/turf/closed/mineral/M in range(drill.chassis,1))
if(get_dir(drill.chassis,M)&drill.chassis.dir)
M.gets_drilled()
drill.log_message("Drilled through [src]")
drill.mecha_log_message("Drilled through [src]")
drill.move_ores()
/turf/open/floor/plating/asteroid/drill_act(obj/item/mecha_parts/mecha_equipment/drill/drill)
for(var/turf/open/floor/plating/asteroid/M in range(1, drill.chassis))
if((get_dir(drill.chassis,M)&drill.chassis.dir) && !M.dug)
M.getDug()
drill.log_message("Drilled through [src]")
drill.mecha_log_message("Drilled through [src]")
drill.move_ores()
@@ -216,12 +216,12 @@
if(equip_ready)
START_PROCESSING(SSobj, src)
droid_overlay = new(src.icon, icon_state = "repair_droid_a")
log_message("Activated.")
mecha_log_message("Activated.")
set_ready_state(0)
else
STOP_PROCESSING(SSobj, src)
droid_overlay = new(src.icon, icon_state = "repair_droid")
log_message("Deactivated.")
mecha_log_message("Deactivated.")
set_ready_state(1)
chassis.add_overlay(droid_overlay)
send_byjax(chassis.occupant,"exosuit.browser","[REF(src)]",src.get_equip_info())
@@ -304,11 +304,11 @@
if(equip_ready) //inactive
START_PROCESSING(SSobj, src)
set_ready_state(0)
log_message("Activated.")
mecha_log_message("Activated.")
else
STOP_PROCESSING(SSobj, src)
set_ready_state(1)
log_message("Deactivated.")
mecha_log_message("Deactivated.")
/obj/item/mecha_parts/mecha_equipment/tesla_energy_relay/get_equip_info()
if(!chassis)
@@ -379,11 +379,11 @@
if(equip_ready) //inactive
set_ready_state(0)
START_PROCESSING(SSobj, src)
log_message("Activated.")
mecha_log_message("Activated.")
else
set_ready_state(1)
STOP_PROCESSING(SSobj, src)
log_message("Deactivated.")
mecha_log_message("Deactivated.")
/obj/item/mecha_parts/mecha_equipment/generator/get_equip_info()
var/output = ..()
@@ -440,14 +440,14 @@
return
if(fuel.amount<=0)
STOP_PROCESSING(SSobj, src)
log_message("Deactivated - no fuel.")
mecha_log_message("Deactivated - no fuel.")
set_ready_state(1)
return
var/cur_charge = chassis.get_charge()
if(isnull(cur_charge))
set_ready_state(1)
occupant_message("No powercell detected.")
log_message("Deactivated.")
mecha_log_message("Deactivated.")
STOP_PROCESSING(SSobj, src)
return
var/use_fuel = fuel_per_cycle_idle
@@ -45,7 +45,7 @@
O.forceMove(chassis)
O.anchored = FALSE
occupant_message("<span class='notice'>[target] successfully loaded.</span>")
log_message("Loaded [O]. Cargo compartment capacity: [cargo_holder.cargo_capacity - cargo_holder.cargo.len]")
mecha_log_message("Loaded [O]. Cargo compartment capacity: [cargo_holder.cargo_capacity - cargo_holder.cargo.len]")
else
O.anchored = initial(O.anchored)
else
@@ -105,7 +105,7 @@
O.forceMove(chassis)
O.anchored = FALSE
occupant_message("<span class='notice'>[target] successfully loaded.</span>")
log_message("Loaded [O]. Cargo compartment capacity: [cargo_holder.cargo_capacity - cargo_holder.cargo.len]")
mecha_log_message("Loaded [O]. Cargo compartment capacity: [cargo_holder.cargo_capacity - cargo_holder.cargo.len]")
else
O.anchored = initial(O.anchored)
else
@@ -388,7 +388,7 @@
if(href_list["toggle"])
set_ready_state(!equip_ready)
occupant_message("[src] [equip_ready?"dea":"a"]ctivated.")
log_message("[equip_ready?"Dea":"A"]ctivated.")
mecha_log_message("[equip_ready?"Dea":"A"]ctivated.")
return
if(href_list["cut"])
if(cable && cable.amount)
@@ -411,7 +411,7 @@
if(!cable || cable.amount<1)
set_ready_state(1)
occupant_message("Cable depleted, [src] deactivated.")
log_message("Cable depleted, [src] deactivated.")
mecha_log_message("Cable depleted, [src] deactivated.")
return
if(cable.amount < amount)
occupant_message("No enough cable to finish the task.")
+4 -4
View File
@@ -53,7 +53,7 @@
if(kickback)
chassis.newtonian_move(turn(chassis.dir,180))
chassis.log_message("Fired from [src.name], targeting [target].")
chassis.mecha_log_message("Fired from [src.name], targeting [target].")
return 1
@@ -184,7 +184,7 @@
else
M.Jitter(500)
log_message("Honked from [src.name]. HONK!")
mecha_log_message("Honked from [src.name]. HONK!")
var/turf/T = get_turf(src)
message_admins("[ADMIN_LOOKUPFLW(chassis.occupant)] used a Mecha Honker in [ADMIN_VERBOSEJMP(T)]")
log_game("[key_name(chassis.occupant)] used a Mecha Honker in [AREACOORD(T)]")
@@ -220,7 +220,7 @@
projectiles_to_add--
chassis.use_power(projectile_energy_cost)
send_byjax(chassis.occupant,"exosuit.browser","[REF(src)]",src.get_equip_info())
log_message("Rearmed [src.name].")
mecha_log_message("Rearmed [src.name].")
return 1
@@ -323,7 +323,7 @@
return
var/obj/O = new projectile(chassis.loc)
playsound(chassis, fire_sound, 50, 1)
log_message("Launched a [O.name] from [name], targeting [target].")
mecha_log_message("Launched a [O.name] from [name], targeting [target].")
projectiles--
proj_init(O)
O.throw_at(target, missile_range, missile_speed, chassis.occupant, FALSE, diagonals_first = diags_first)
+7 -7
View File
@@ -139,7 +139,7 @@
add_cell()
START_PROCESSING(SSobj, src)
GLOB.poi_list |= src
log_message("[src.name] created.")
mecha_log_message("[src.name] created.")
GLOB.mechas_list += src //global mech list
prepare_huds()
for(var/datum/atom_hud/data/diagnostic/diag_hud in GLOB.huds)
@@ -493,7 +493,7 @@
events.fireEvent("onMove",get_turf(src))
if (internal_tank.disconnect()) // Something moved us and broke connection
occupant_message("<span class='warning'>Air port connection teared off!</span>")
log_message("Lost connection to gas port.")
mecha_log_message("Lost connection to gas port.")
/obj/mecha/Process_Spacemove(var/movement_dir = 0)
. = ..()
@@ -822,7 +822,7 @@
return
if(!ishuman(user)) // no silicons or drones in mechas.
return
log_message("[user] tries to move in.")
mecha_log_message("[user] tries to move in.")
if (occupant)
to_chat(usr, "<span class='warning'>The [name] is already occupied!</span>")
log_append_to_last("Permission denied.")
@@ -932,7 +932,7 @@
icon_state = initial(icon_state)
update_icon()
setDir(dir_in)
log_message("[mmi_as_oc] moved in as pilot.")
mecha_log_message("[mmi_as_oc] moved in as pilot.")
if(!internal_damage)
SEND_SOUND(occupant, sound('sound/mecha/nominal.ogg',volume=50))
GrantActions(brainmob)
@@ -983,7 +983,7 @@
var/mob/living/L = occupant
occupant = null //we need it null when forceMove calls Exited().
if(mob_container.forceMove(newloc))//ejecting mob container
log_message("[mob_container] moved out.")
mecha_log_message("[mob_container] moved out.")
L << browse(null, "window=exosuit")
if(istype(mob_container, /obj/item/mmi))
@@ -1028,10 +1028,10 @@
to_chat(occupant, "[icon2html(src, occupant)] [message]")
return
/obj/mecha/log_message(message as text, message_type=LOG_GAME, color=null, log_globally)
/obj/mecha/proc/mecha_log_message(message, color)
log.len++
log[log.len] = list("time"="[STATION_TIME_TIMESTAMP("hh:mm:ss", world.time)]","date","year"="[GLOB.year_integer]","message"="[color?"<font color='[color]'>":null][message][color?"</font>":null]")
..()
log_message(message, LOG_GAME, color) //also do the normal admin logs I guess.
return log.len
/obj/mecha/proc/log_append_to_last(message as text,red=null)
+7 -7
View File
@@ -56,7 +56,7 @@
chassis.use_internal_tank = !chassis.use_internal_tank
button_icon_state = "mech_internals_[chassis.use_internal_tank ? "on" : "off"]"
chassis.occupant_message("Now taking air from [chassis.use_internal_tank?"internal airtank":"environment"].")
chassis.log_message("Now taking air from [chassis.use_internal_tank?"internal airtank":"environment"].")
chassis.mecha_log_message("Now taking air from [chassis.use_internal_tank?"internal airtank":"environment"].")
UpdateButtonIcon()
/datum/action/innate/mecha/mech_cycle_equip
@@ -114,7 +114,7 @@
chassis.set_light(-chassis.lights_power)
button_icon_state = "mech_lights_off"
chassis.occupant_message("Toggled lights [chassis.lights?"on":"off"].")
chassis.log_message("Toggled lights [chassis.lights?"on":"off"].")
chassis.mecha_log_message("Toggled lights [chassis.lights?"on":"off"].")
UpdateButtonIcon()
/datum/action/innate/mecha/mech_view_stats
@@ -147,7 +147,7 @@
strafe = !strafe
occupant_message("Toggled strafing mode [strafe?"on":"off"].")
log_message("Toggled strafing mode [strafe?"on":"off"].")
mecha_log_message("Toggled strafing mode [strafe?"on":"off"].")
strafing_action.UpdateButtonIcon()
//////////////////////////////////////// Specific Ability Actions ///////////////////////////////////////////////
@@ -163,7 +163,7 @@
if(chassis.get_charge() > 0)
chassis.thrusters_active = !chassis.thrusters_active
button_icon_state = "mech_thrusters_[chassis.thrusters_active ? "on" : "off"]"
chassis.log_message("Toggled thrusters.")
chassis.mecha_log_message("Toggled thrusters.")
chassis.occupant_message("<font color='[chassis.thrusters_active ?"blue":"red"]'>Thrusters [chassis.thrusters_active ?"en":"dis"]abled.")
@@ -185,7 +185,7 @@
else
chassis.deflect_chance = initial(chassis.deflect_chance)
chassis.occupant_message("<span class='danger'>You disable [chassis] defence mode.</span>")
chassis.log_message("Toggled defence mode.")
chassis.mecha_log_message("Toggled defence mode.")
UpdateButtonIcon()
/datum/action/innate/mecha/mech_overload_mode
@@ -200,7 +200,7 @@
else
chassis.leg_overload_mode = !chassis.leg_overload_mode
button_icon_state = "mech_overload_[chassis.leg_overload_mode ? "on" : "off"]"
chassis.log_message("Toggled leg actuators overload.")
chassis.mecha_log_message("Toggled leg actuators overload.")
if(chassis.leg_overload_mode)
chassis.leg_overload_mode = 1
chassis.bumpsmash = 1
@@ -240,7 +240,7 @@
if(owner.client)
chassis.zoom_mode = !chassis.zoom_mode
button_icon_state = "mech_zoom_[chassis.zoom_mode ? "on" : "off"]"
chassis.log_message("Toggled zoom mode.")
chassis.mecha_log_message("Toggled zoom mode.")
chassis.occupant_message("<font color='[chassis.zoom_mode?"blue":"red"]'>Zoom mode [chassis.zoom_mode?"en":"dis"]abled.</font>")
if(chassis.zoom_mode)
owner.client.change_view(12)
+12 -12
View File
@@ -62,7 +62,7 @@
user.do_attack_animation(src, ATTACK_EFFECT_PUNCH)
playsound(loc, 'sound/weapons/tap.ogg', 40, 1, -1)
user.visible_message("<span class='danger'>[user] hits [name]. Nothing happens</span>", null, null, COMBAT_MESSAGE_RANGE)
log_message("Attack by hand/paw. Attacker - [user].", color="red")
mecha_log_message("Attack by hand/paw. Attacker - [user].", color="red")
log_append_to_last("Armor saved.")
/obj/mecha/attack_paw(mob/user as mob)
@@ -70,12 +70,12 @@
/obj/mecha/attack_alien(mob/living/user)
log_message("Attack by alien. Attacker - [user].", color="red")
mecha_log_message("Attack by alien. Attacker - [user].", color="red")
playsound(src.loc, 'sound/weapons/slash.ogg', 100, 1)
attack_generic(user, 15, BRUTE, "melee", 0)
/obj/mecha/attack_animal(mob/living/simple_animal/user)
log_message("Attack by simple animal. Attacker - [user].", color="red")
mecha_log_message("Attack by simple animal. Attacker - [user].", color="red")
if(!user.melee_damage_upper && !user.obj_damage)
user.emote("custom", message = "[user.friendly] [src].")
return 0
@@ -99,7 +99,7 @@
/obj/mecha/attack_hulk(mob/living/carbon/human/user)
. = ..()
if(.)
log_message("Attack by hulk. Attacker - [user].", color="red")
mecha_log_message("Attack by hulk. Attacker - [user].", color="red")
log_combat(user, src, "punched", "hulk powers")
/obj/mecha/blob_act(obj/structure/blob/B)
@@ -109,16 +109,16 @@
return
/obj/mecha/hitby(atom/movable/AM, skipcatch, hitpush, blocked, datum/thrownthing/throwingdatum) //wrapper
log_message("Hit by [AM].", color="red")
mecha_log_message("Hit by [AM].", color="red")
. = ..()
/obj/mecha/bullet_act(obj/item/projectile/Proj) //wrapper
log_message("Hit by projectile. Type: [Proj.name]([Proj.flag]).", color="red")
mecha_log_message("Hit by projectile. Type: [Proj.name]([Proj.flag]).", color="red")
. = ..()
/obj/mecha/ex_act(severity, target)
log_message("Affected by explosion of severity: [severity].", color="red")
mecha_log_message("Affected by explosion of severity: [severity].", color="red")
if(prob(deflect_chance))
severity++
log_append_to_last("Armor saved, changing severity to [severity].")
@@ -148,7 +148,7 @@
if(get_charge())
use_power((cell.charge/3)/(severity*2))
take_damage(30 / severity, BURN, "energy", 1)
log_message("EMP detected", color="red")
mecha_log_message("EMP detected", color="red")
if(istype(src, /obj/mecha/combat))
mouse_pointer = 'icons/mecha/mecha_mouse-disable.dmi'
@@ -160,7 +160,7 @@
/obj/mecha/temperature_expose(datum/gas_mixture/air, exposed_temperature, exposed_volume)
if(exposed_temperature>max_temperature)
log_message("Exposed to dangerous temperature.", color="red")
mecha_log_message("Exposed to dangerous temperature.", color="red")
take_damage(5, BURN, 0, 1)
/obj/mecha/attackby(obj/item/W as obj, mob/user as mob, params)
@@ -232,7 +232,7 @@
cell = null
state = 4
to_chat(user, "<span class='notice'>You unscrew and pry out the powercell.</span>")
log_message("Powercell removed")
mecha_log_message("Powercell removed")
else if(state==4 && cell)
state=3
to_chat(user, "<span class='notice'>You screw the cell in place.</span>")
@@ -246,7 +246,7 @@
var/obj/item/stock_parts/cell/C = W
to_chat(user, "<span class='notice'>You install the powercell.</span>")
cell = C
log_message("Powercell installed")
mecha_log_message("Powercell installed")
else
to_chat(user, "<span class='notice'>There's already a powercell installed.</span>")
return
@@ -280,7 +280,7 @@
return ..()
/obj/mecha/attacked_by(obj/item/I, mob/living/user)
log_message("Attacked by [I]. Attacker - [user]")
mecha_log_message("Attacked by [I]. Attacker - [user]")
..()
/obj/mecha/proc/mech_toxin_damage(mob/living/target)
+5 -5
View File
@@ -315,7 +315,7 @@
if(internal_tank.connected_port)
if(internal_tank.disconnect())
occupant_message("Disconnected from the air system port.")
log_message("Disconnected from gas port.")
mecha_log_message("Disconnected from gas port.")
else
occupant_message("<span class='warning'>Unable to disconnect from the air system port!</span>")
return
@@ -323,7 +323,7 @@
var/obj/machinery/atmospherics/components/unary/portables_connector/possible_port = locate() in loc
if(internal_tank.connect(possible_port))
occupant_message("Connected to the air system port.")
log_message("Connected to gas port.")
mecha_log_message("Connected to gas port.")
else
occupant_message("<span class='warning'>Unable to connect with air system port!</span>")
return
@@ -341,14 +341,14 @@
if(href_list["repair_int_control_lost"])
occupant_message("Recalibrating coordination system...")
log_message("Recalibration of coordination system started.")
mecha_log_message("Recalibration of coordination system started.")
var/T = loc
spawn(100)
if(T == loc)
clearInternalDamage(MECHA_INT_CONTROL_LOST)
occupant_message("<span class='notice'>Recalibration successful.</span>")
log_message("Recalibration of coordination system finished with 0 errors.")
mecha_log_message("Recalibration of coordination system finished with 0 errors.")
else
occupant_message("<span class='warning'>Recalibration failed!</span>")
log_message("Recalibration of coordination system failed with 1 error.", color="red")
mecha_log_message("Recalibration of coordination system failed with 1 error.", color="red")
+1 -1
View File
@@ -150,7 +150,7 @@
occupant_message("<span class='notice'>You unload [O].</span>")
O.forceMove(drop_location())
cargo -= O
log_message("Unloaded [O]. Cargo compartment capacity: [cargo_capacity - src.cargo.len]")
mecha_log_message("Unloaded [O]. Cargo compartment capacity: [cargo_capacity - src.cargo.len]")
return