From 883b290064a1061fdae892b76ac71133d33f9a33 Mon Sep 17 00:00:00 2001 From: "johnsonmt88@gmail.com" Date: Thu, 14 Jun 2012 19:31:15 +0000 Subject: [PATCH] Server crashing and exploit fixes Added a cooldown to the containment field shocking players - If a containment field was set up in a small room, it was possible to crash the server by jumping into the field with no way to escape it. This was likely due to the hundreds of spark effects being generated every second, on top of all the other calls it had to make. Used the existing parent proc to check for proximity, canmove and death on: - Atmos pumps - Atmos mixers - Canisters. (This should finish off issue 397.) - Crew monitering computer (This one probably didn't need it but it shouldn't change the way it works.) Added admin checks to: - datum/mind - tensioner If either of these fail an admin check an admin log will be entered into the server logs and a message will be displayed to admins. git-svn-id: http://tgstation13.googlecode.com/svn/trunk@3818 316c924e-a436-60f5-8080-3fe189b3f50e --- .../components/binary_devices/pump.dm | 1 + .../components/trinary_devices/mixer.dm | 1 + code/datums/helper_datums/tension.dm | 9 +++++++++ code/datums/mind.dm | 7 +++++++ code/game/machinery/atmoalter/canister.dm | 5 ++--- code/game/machinery/computer/crew.dm | 2 +- .../power/singularity/containment_field.dm | 15 +++++++++++++++ 7 files changed, 36 insertions(+), 4 deletions(-) diff --git a/code/ATMOSPHERICS/components/binary_devices/pump.dm b/code/ATMOSPHERICS/components/binary_devices/pump.dm index 9044fdb8ff..ed38fd9345 100644 --- a/code/ATMOSPHERICS/components/binary_devices/pump.dm +++ b/code/ATMOSPHERICS/components/binary_devices/pump.dm @@ -157,6 +157,7 @@ obj/machinery/atmospherics/binary/pump return Topic(href,href_list) + if(..()) return if(href_list["power"]) on = !on if(href_list["set_press"]) diff --git a/code/ATMOSPHERICS/components/trinary_devices/mixer.dm b/code/ATMOSPHERICS/components/trinary_devices/mixer.dm index 801b8bf83f..f480b26708 100644 --- a/code/ATMOSPHERICS/components/trinary_devices/mixer.dm +++ b/code/ATMOSPHERICS/components/trinary_devices/mixer.dm @@ -137,6 +137,7 @@ obj/machinery/atmospherics/trinary/mixer return Topic(href,href_list) + if(..()) return if(href_list["power"]) on = !on if(href_list["set_press"]) diff --git a/code/datums/helper_datums/tension.dm b/code/datums/helper_datums/tension.dm index 6744127c50..9b9830738f 100644 --- a/code/datums/helper_datums/tension.dm +++ b/code/datums/helper_datums/tension.dm @@ -232,9 +232,18 @@ var/global/datum/tension/tension_master Topic(href, href_list) + if(!usr || !usr.client) + return //This shouldnt happen + + if(!usr.client.holder) + message_admins("\red [key_name(usr)] tried to use the tensioner without authorization.") + log_admin("[key_name(usr)] tried to use the tensioner without authorization.") + return + log_admin("[key_name(usr)] used a tensioner override. The override was [href]") message_admins("[key_name(usr)] used a tensioner override. The override was [href]") + if(href_list["addScore"]) score += 50000 diff --git a/code/datums/mind.dm b/code/datums/mind.dm index 5baa7730f6..e6fd607112 100644 --- a/code/datums/mind.dm +++ b/code/datums/mind.dm @@ -287,6 +287,13 @@ datum/mind usr << browse(out, "window=edit_memory[src]") Topic(href, href_list) + if(!usr || !usr.client) + return + + if(!usr.client.holder) + message_admins("\red [key_name(usr)] tried to access [current]'s mind without authorization.") + log_admin("[key_name(usr)] tried to access [current]'s mind without authorization.") + return if (href_list["role_edit"]) var/new_role = input("Select new role", "Assigned role", assigned_role) as null|anything in get_all_jobs() diff --git a/code/game/machinery/atmoalter/canister.dm b/code/game/machinery/atmoalter/canister.dm index 83ca41f581..1e5097be5e 100644 --- a/code/game/machinery/atmoalter/canister.dm +++ b/code/game/machinery/atmoalter/canister.dm @@ -219,9 +219,8 @@ Release Pressure: -