From 3d0d03a74fe47f3b71fb21949dd52a81898a4d39 Mon Sep 17 00:00:00 2001 From: "baloh.matevz@gmail.com" Date: Fri, 18 Jan 2013 03:04:46 +0000 Subject: [PATCH] - Added killswitches to say, whisper, me, ooc, adminhelp and pray to try to determine if communication verbs are the cause of the constant lag we're getting. Toggle the killswitch with the 'disable communication verbs' verb, available in debug verbs. - Added killswitches to all Enter() and Entered() procs to try to determine if movement is the source of all the constant lag we're having. Toggle the killswitch with the 'disable all movement' verb, available in debug verbs. git-svn-id: http://tgstation13.googlecode.com/svn/trunk@5571 316c924e-a436-60f5-8080-3fe189b3f50e --- code/game/turfs/simulated.dm | 4 +++ code/game/turfs/space/space.dm | 3 ++ code/game/turfs/turf.dm | 6 ++++ code/game/verbs/ooc.dm | 4 +++ code/modules/admin/verbs/adminhelp.dm | 4 +++ code/modules/admin/verbs/mapping.dm | 28 ++++++++++++++++++- code/modules/admin/verbs/pray.dm | 4 +++ .../mob/living/carbon/human/whisper.dm | 4 +++ code/modules/mob/say.dm | 11 ++++++++ 9 files changed, 67 insertions(+), 1 deletion(-) diff --git a/code/game/turfs/simulated.dm b/code/game/turfs/simulated.dm index 2c8f505ae5..02d572e51e 100644 --- a/code/game/turfs/simulated.dm +++ b/code/game/turfs/simulated.dm @@ -14,6 +14,10 @@ levelupdate() /turf/simulated/Entered(atom/A, atom/OL) + if(movement_disabled) + usr << "\red Movement is admin-disabled." //This is to identify lag problems + return + if (istype(A,/mob/living/carbon)) var/mob/living/carbon/M = A if(M.lying) return diff --git a/code/game/turfs/space/space.dm b/code/game/turfs/space/space.dm index dcccefff4f..ec044dbed1 100644 --- a/code/game/turfs/space/space.dm +++ b/code/game/turfs/space/space.dm @@ -61,6 +61,9 @@ // Ported from unstable r355 /turf/space/Entered(atom/movable/A as mob|obj) + if(movement_disabled) + usr << "\red Movement is admin-disabled." //This is to identify lag problems + return ..() if ((!(A) || src != A.loc)) return diff --git a/code/game/turfs/turf.dm b/code/game/turfs/turf.dm index c9d8d9235c..df5226c958 100644 --- a/code/game/turfs/turf.dm +++ b/code/game/turfs/turf.dm @@ -68,6 +68,9 @@ return 0 /turf/Enter(atom/movable/mover as mob|obj, atom/forget as mob|obj|turf|area) + if(movement_disabled) + usr << "\red Movement is admin-disabled." //This is to identify lag problems + return if (!mover || !isturf(mover.loc)) return 1 @@ -108,6 +111,9 @@ /turf/Entered(atom/atom as mob|obj) + if(movement_disabled) + usr << "\red Movement is admin-disabled." //This is to identify lag problems + return ..() //vvvvv Infared beam stuff vvvvv diff --git a/code/game/verbs/ooc.dm b/code/game/verbs/ooc.dm index f02f084f9d..2271bc26b8 100644 --- a/code/game/verbs/ooc.dm +++ b/code/game/verbs/ooc.dm @@ -2,6 +2,10 @@ set name = "OOC" //Gave this shit a shorter name so you only have to time out "ooc" rather than "ooc message" to use it --NeoFite set category = "OOC" + if(say_disabled) //This is here to try to identify lag problems + usr << "\red Speech is currently admin-disabled." + return + if(!mob) return if(IsGuestKey(key)) src << "Guests may not use OOC." diff --git a/code/modules/admin/verbs/adminhelp.dm b/code/modules/admin/verbs/adminhelp.dm index 31664b4039..ef35112af2 100644 --- a/code/modules/admin/verbs/adminhelp.dm +++ b/code/modules/admin/verbs/adminhelp.dm @@ -7,6 +7,10 @@ var/list/adminhelp_ignored_words = list("unknown","the","a","an","of","monkey"," set category = "Admin" set name = "Adminhelp" + if(say_disabled) //This is here to try to identify lag problems + usr << "\red Speech is currently admin-disabled." + return + //handle muting and automuting if(prefs.muted & MUTE_ADMINHELP) src << "Error: Admin-PM: You cannot send adminhelps (Muted)." diff --git a/code/modules/admin/verbs/mapping.dm b/code/modules/admin/verbs/mapping.dm index 172be842c6..8cfde1c2ff 100644 --- a/code/modules/admin/verbs/mapping.dm +++ b/code/modules/admin/verbs/mapping.dm @@ -157,6 +157,8 @@ var/intercom_range_display_status = 0 src.verbs += /client/proc/regroup_all_air_groups src.verbs += /client/proc/kill_pipe_processing src.verbs += /client/proc/kill_air_processing + src.verbs += /client/proc/disable_communication + src.verbs += /client/proc/disable_movement //src.verbs += /client/proc/cmd_admin_rejuvenate feedback_add_details("admin_verb","mDV") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! @@ -270,4 +272,28 @@ var/global/prevent_airgroup_regroup = 0 if(air_processing_killed) message_admins("[src.ckey] used 'kill air processing', stopping all air processing.") else - message_admins("[src.ckey] used 'kill air processing', restoring all air processing.") \ No newline at end of file + message_admins("[src.ckey] used 'kill air processing', restoring all air processing.") + +//This proc is intended to detect lag problems relating to communication procs +var/global/say_disabled = 0 +/client/proc/disable_communication() + set category = "Mapping" + set name = "Disable all communication verbs" + + say_disabled = !say_disabled + if(say_disabled) + message_admins("[src.ckey] used 'Disable all communication verbs', killing all communication methods.") + else + message_admins("[src.ckey] used 'Disable all communication verbs', restoring all communication methods.") + +//This proc is intended to detect lag problems relating to movement +var/global/movement_disabled = 0 +/client/proc/disable_movement() + set category = "Mapping" + set name = "Disable all movement" + + movement_disabled = !movement_disabled + if(movement_disabled) + message_admins("[src.ckey] used 'Disable all movement', killing all movement.") + else + message_admins("[src.ckey] used 'Disable all movement', restoring all movement.") \ No newline at end of file diff --git a/code/modules/admin/verbs/pray.dm b/code/modules/admin/verbs/pray.dm index f4d12123d2..906ec8a5ac 100644 --- a/code/modules/admin/verbs/pray.dm +++ b/code/modules/admin/verbs/pray.dm @@ -2,6 +2,10 @@ set category = "IC" set name = "Pray" + if(say_disabled) //This is here to try to identify lag problems + usr << "\red Speech is currently admin-disabled." + return + msg = copytext(sanitize(msg), 1, MAX_MESSAGE_LEN) if(!msg) return diff --git a/code/modules/mob/living/carbon/human/whisper.dm b/code/modules/mob/living/carbon/human/whisper.dm index 8ba18757b5..b844ae784a 100644 --- a/code/modules/mob/living/carbon/human/whisper.dm +++ b/code/modules/mob/living/carbon/human/whisper.dm @@ -1,5 +1,9 @@ //Lallander was here /mob/living/carbon/human/whisper(message as text) + if(say_disabled) //This is here to try to identify lag problems + usr << "\red Speech is currently admin-disabled." + return + message = trim(copytext(strip_html_simple(message), 1, MAX_MESSAGE_LEN)) if (!message || silent || miming) diff --git a/code/modules/mob/say.dm b/code/modules/mob/say.dm index e5aa7e4f02..487dd675fe 100644 --- a/code/modules/mob/say.dm +++ b/code/modules/mob/say.dm @@ -9,12 +9,19 @@ /mob/verb/say_verb(message as text) set name = "Say" set category = "IC" + if(say_disabled) //This is here to try to identify lag problems + usr << "\red Speech is currently admin-disabled." + return usr.say(message) /mob/verb/me_verb(message as text) set name = "Me" set category = "IC" + if(say_disabled) //This is here to try to identify lag problems + usr << "\red Speech is currently admin-disabled." + return + message = trim(copytext(sanitize(message), 1, MAX_MESSAGE_LEN)) if(ishuman(src) || isrobot(src)) @@ -26,6 +33,10 @@ var/name = src.real_name var/alt_name = "" + if(say_disabled) //This is here to try to identify lag problems + usr << "\red Speech is currently admin-disabled." + return + if(mind && mind.name) name = "[mind.name]" else