From 015f464359e811ff72277c847465226bcd860c79 Mon Sep 17 00:00:00 2001 From: Ren Erthilo Date: Tue, 1 May 2012 00:10:05 +0100 Subject: [PATCH] TG: Fixes Issue 441 (it was a typo) Fixes Issue 424 (it was some code in turrets.dm which was setting all the turret controls in the lobby area to off...for no raisin.) Admins can now PM people in the lobby Admin-PM verb now uses clients instead of mobs Removed a vulnerability in the PM system that allowed unauthorised access to a select few admin-tools. Text changes in examine verbs for monkeys and humans (typos) Revision: r3366 Author: elly1...@rocketmail.com --- code/game/machinery/turrets.dm | 92 +++++++++++++------------ code/modules/admin/verbs/randomverbs.dm | 33 +++++++-- 2 files changed, 76 insertions(+), 49 deletions(-) diff --git a/code/game/machinery/turrets.dm b/code/game/machinery/turrets.dm index 0a4ec6453cd..bc1c8ffe9c2 100644 --- a/code/game/machinery/turrets.dm +++ b/code/game/machinery/turrets.dm @@ -3,44 +3,35 @@ var/list/turretTargets = list() /area/turret_protected/proc/subjectDied(target) - if (istype(target, /mob)) - if (!istype(target, /mob/living/silicon)) - if (target:stat) - if (target in turretTargets) + if( ismob(target) ) + if( !issilicon(target) ) + if( target:stat ) + if( target in turretTargets ) src.Exited(target) +//TODO: make teleporting to places trigger Entered() ~Carn /area/turret_protected/Entered(O) ..() - if(master && master != src) + if( master && master != src ) return master.Entered(O) -// world << "[O] entered[src.x],[src.y],[src.z]" - if (istype(O, /mob/living/carbon)) - if (!(O in turretTargets)) - turretTargets += O - else if (istype(O, /obj/mecha)) - var/obj/mecha/M = O - if (M.occupant) - if (!(M in turretTargets)) - turretTargets += M + if( iscarbon(O) ) + turretTargets |= O + else if( istype(O, /obj/mecha) ) + var/obj/mecha/Mech = O + if( Mech.occupant ) + turretTargets |= Mech return 1 /area/turret_protected/Exited(O) - if(master && master != src) + if( master && master != src ) return master.Exited(O) -// world << "[O] exited [src.x],[src.y],[src.z]" - if (istype(O, /mob)) - if (!istype(O, /mob/living/silicon)) - if (O in turretTargets) - //O << "removing you from target list" - turretTargets -= O - //else - //O << "You aren't in our target list!" - else if (istype(O, /obj/mecha)) - if (O in turretTargets) - turretTargets -= O + if( ismob(O) && !issilicon(O) ) + turretTargets -= O + else if( istype(O, /obj/mecha) ) + turretTargets -= O ..() return 1 @@ -130,18 +121,19 @@ return /obj/machinery/turret/proc/check_target(var/atom/movable/T as mob|obj) - if(T && T in protected_area.turretTargets) - if(!T in protected_area) + if( T && T in protected_area.turretTargets ) + var/area/area_T = get_area(T) + if( !area_T || (area_T.type != protected_area.type) ) protected_area.Exited(T) return 0 //If the guy is somehow not in the turret's area (teleportation), get them out the damn list. --NEO - if(istype(T, /mob/living/carbon)) + if( iscarbon(T) ) var/mob/living/carbon/MC = T - if(!MC.stat) - if(!MC.lying || lasers) + if( !MC.stat ) + if( !MC.lying || lasers ) return 1 - else if(istype(T, /obj/mecha)) + else if( istype(T, /obj/mecha) ) var/obj/mecha/ME = T - if(ME.occupant) + if( ME.occupant ) return 1 return 0 @@ -338,10 +330,10 @@ if(stat & BROKEN) return if (istype(user, /mob/living/silicon)) return src.attack_hand(user) - else // trying to unlock the interface + else if( get_dist(src, user) == 0 ) // trying to unlock the interface if (src.allowed(usr)) locked = !locked - user << "You [ locked ? "lock" : "unlock"] the panel." + user << "You [ locked ? "lock" : "unlock"] the panel." if (locked) if (user.machine==src) user.machine = null @@ -350,7 +342,7 @@ if (user.machine==src) src.attack_hand(usr) else - user << "\red Access denied." + user << "Access denied." /obj/machinery/turretid/attack_ai(mob/user as mob) if(!ailock) @@ -359,9 +351,9 @@ user << "There seems to be a firewall preventing you from accessing this device." /obj/machinery/turretid/attack_hand(mob/user as mob) - if ( (get_dist(src, user) > 1 )) - if (!istype(user, /mob/living/silicon)) - user << text("Too far away.") + if ( get_dist(src, user) > 0 ) + if ( !issilicon(user) ) + user << "You are too far away." user.machine = null user << browse(null, "window=turretid") return @@ -405,12 +397,13 @@ if (!istype(usr, /mob/living/silicon)) usr << "Control panel is locked!" return - if (href_list["toggleOn"]) - src.enabled = !src.enabled - src.updateTurrets() - else if (href_list["toggleLethal"]) - src.lethal = !src.lethal - src.updateTurrets() + if ( get_dist(src, usr) == 0 || issilicon(usr)) + if (href_list["toggleOn"]) + src.enabled = !src.enabled + src.updateTurrets() + else if (href_list["toggleLethal"]) + src.lethal = !src.lethal + src.updateTurrets() src.attack_hand(usr) /obj/machinery/turretid/proc/updateTurrets() @@ -434,6 +427,15 @@ for(var/obj/machinery/turretid/TC in src.similar_controls) TC.icon_state = "motion0" +// if(control_area) //USE: updates other controls in the area +// for (var/obj/machinery/turretid/Turret_Control in world) //I'm not sure if this is what it was +// if( Turret_Control.control_area != src.control_area ) continue //supposed to do. Or whether the person +// Turret_Control.icon_state = icon_state //who coded it originally was just tired +// Turret_Control.enabled = enabled //or something. I don't see any situation +// Turret_Control.lethal = lethal //in which this would be used on the current map. + //If he wants it back he can uncomment it + + for (var/obj/machinery/turret/aTurret in turrets) aTurret.setState(enabled, lethal) diff --git a/code/modules/admin/verbs/randomverbs.dm b/code/modules/admin/verbs/randomverbs.dm index 501a211db18..8eab8fbf6fd 100644 --- a/code/modules/admin/verbs/randomverbs.dm +++ b/code/modules/admin/verbs/randomverbs.dm @@ -9,6 +9,7 @@ log_admin("[key_name(usr)] made [key_name(M)] drop everything!") message_admins("[key_name_admin(usr)] made [key_name_admin(M)] drop everything!", 1) + //feedback_add_details("admin_verb","DEVR") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! /client/proc/cmd_admin_prison(mob/M as mob in world) set category = "Admin" @@ -35,6 +36,7 @@ M << "\red You have been sent to the prison station!" log_admin("[key_name(usr)] sent [key_name(M)] to the prison station.") message_admins("\blue [key_name_admin(usr)] sent [key_name_admin(M)] to the prison station.", 1) + //feedback_add_details("admin_verb","PRISON") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! /client/proc/cmd_admin_subtle_message(mob/M as mob in world) set category = "Special Verbs" @@ -56,6 +58,7 @@ log_admin("SubtlePM: [key_name(usr)] -> [key_name(M)] : [msg]") message_admins("\blue \bold SubtleMessage: [key_name_admin(usr)] -> [key_name_admin(M)] : [msg]", 1) + //feedback_add_details("admin_verb","SMS") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! /client/proc/cmd_admin_world_narrate() // Allows administrators to fluff events a little easier -- TLE set category = "Special Verbs" @@ -72,6 +75,7 @@ world << "[msg]" log_admin("GlobalNarrate: [key_name(usr)] : [msg]") message_admins("\blue \bold GlobalNarrate: [key_name_admin(usr)] : [msg]
", 1) + //feedback_add_details("admin_verb","GLN") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! /client/proc/cmd_admin_direct_narrate(mob/M as mob in world) // Targetted narrate -- TLE set category = "Special Verbs" @@ -84,6 +88,7 @@ M << msg log_admin("DirectNarrate: [key_name(usr)] to ([M.name]/[M.key]): [msg]") message_admins("\blue \bold DirectNarrate: [key_name(usr)] to ([M.name]/[M.key]): [msg]
", 1) + //feedback_add_details("admin_verb","DIRN") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! /client/proc/cmd_admin_mute(mob/M as mob in world) set category = "Special Verbs" @@ -103,6 +108,7 @@ message_admins("[key_name_admin(src)] has [(M.client.muted ? "muted" : "voiced")] [key_name_admin(M)].", 1) M << "You have been [(M.client.muted ? "muted" : "voiced")]." + //feedback_add_details("admin_verb","MUTE") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! /client/proc/cmd_admin_add_random_ai_law() @@ -120,6 +126,7 @@ world << sound('ionstorm.ogg') //IonStorm(0) + //feedback_add_details("admin_verb","ION") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! /* Stealth spawns xenos @@ -136,6 +143,7 @@ return create_xeno() + //feedback_add_details("admin_verb","X") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! return //I use this proc for respawn character too. /N @@ -406,6 +414,7 @@ Traitors and the like can also be revived with the previous role mostly intact. new_character << "You have been fully respawned. Enjoy the game." del(G_found)//Don't want to leave ghosts around. + //feedback_add_details("admin_verb","RSPCH") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! return new_character /client/proc/cmd_admin_add_freeform_ai_law() @@ -434,11 +443,11 @@ Traitors and the like can also be revived with the previous role mostly intact. if(show_log == "Yes") command_alert("Ion storm detected near the station. Please check all AI-controlled equipment for errors.", "Anomaly Alert") world << sound('ionstorm.ogg') + //feedback_add_details("admin_verb","IONC") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! /client/proc/cmd_admin_rejuvenate(mob/living/M as mob in world) set category = "Special Verbs" set name = "Rejuvenate" - // All admins should be authenticated, but... what if? if(!holder) src << "Only administrators may use this command." return @@ -498,6 +507,7 @@ Traitors and the like can also be revived with the previous role mostly intact. message_admins("\red Admin [key_name_admin(usr)] healed / revived [key_name_admin(M)]!", 1) else alert("Admin revive disabled") + //feedback_add_details("admin_verb","REJU") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! /client/proc/cmd_admin_create_centcom_report() set category = "Special Verbs" @@ -529,6 +539,7 @@ Traitors and the like can also be revived with the previous role mostly intact. world << sound('commandreport.ogg') log_admin("[key_name(src)] has created a command report: [input]") message_admins("[key_name_admin(src)] has created a command report", 1) + //feedback_add_details("admin_verb","CCR") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! /client/proc/cmd_admin_delete(atom/O as obj|mob|turf in world) set category = "Admin" @@ -541,6 +552,7 @@ Traitors and the like can also be revived with the previous role mostly intact. if (alert(src, "Are you sure you want to delete:\n[O]\nat ([O.x], [O.y], [O.z])?", "Confirmation", "Yes", "No") == "Yes") log_admin("[key_name(usr)] deleted [O] at ([O.x],[O.y],[O.z])") message_admins("[key_name_admin(usr)] deleted [O] at ([O.x],[O.y],[O.z])", 1) + //feedback_add_details("admin_verb","DEL") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! del(O) /client/proc/cmd_admin_list_open_jobs() @@ -553,6 +565,7 @@ Traitors and the like can also be revived with the previous role mostly intact. if(job_master) for(var/datum/job/job in job_master.occupations) src << "[job.title]: [job.total_positions]" + //feedback_add_details("admin_verb","LFS") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! /client/proc/cmd_admin_explosion(atom/O as obj|mob|turf in world) set category = "Special Verbs" @@ -579,7 +592,7 @@ Traitors and the like can also be revived with the previous role mostly intact. explosion (O, devastation, heavy, light, flash) log_admin("[key_name(usr)] created an explosion ([devastation],[heavy],[light],[flash]) at ([O.x],[O.y],[O.z])") message_admins("[key_name_admin(usr)] created an explosion ([devastation],[heavy],[light],[flash]) at ([O.x],[O.y],[O.z])", 1) - + //feedback_add_details("admin_verb","EXPL") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! return else return @@ -602,6 +615,7 @@ Traitors and the like can also be revived with the previous role mostly intact. empulse(O, heavy, light) log_admin("[key_name(usr)] created an EM Pulse ([heavy],[light]) at ([O.x],[O.y],[O.z])") message_admins("[key_name_admin(usr)] created an EM PUlse ([heavy],[light]) at ([O.x],[O.y],[O.z])", 1) + //feedback_add_details("admin_verb","EMP") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! return else @@ -629,6 +643,7 @@ Traitors and the like can also be revived with the previous role mostly intact. return M.gib() + //feedback_add_details("admin_verb","GIB") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! /client/proc/cmd_admin_gib_self() set name = "Gibself" @@ -637,6 +652,7 @@ Traitors and the like can also be revived with the previous role mostly intact. return else mob.gib() + //feedback_add_details("admin_verb","GIBS") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! /* /client/proc/cmd_manual_ban() set name = "Manual Ban" @@ -708,6 +724,7 @@ Traitors and the like can also be revived with the previous role mostly intact. var/list/L = M.get_contents() for(var/t in L) usr << "[t]" + //feedback_add_details("admin_verb","CC") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! /client/proc/cmd_admin_remove_plasma(area/A as area) set category = "Debug" @@ -716,7 +733,7 @@ Traitors and the like can also be revived with the previous role mostly intact. if(!holder) src << "Only administrators may use this command." return - + //feedback_add_details("admin_verb","STATM") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! spawn(1) for(var/turf/simulated/T in A) if(T.air) @@ -738,6 +755,7 @@ Traitors and the like can also be revived with the previous role mostly intact. view = input("Select view range:", "FUCK YE", 7) in list(1,2,3,4,5,6,7,8,9,10,11,12,13,14,128) else view = world.view + //feedback_add_details("admin_verb","CVRA") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! /client/proc/admin_call_shuttle() @@ -764,6 +782,7 @@ Traitors and the like can also be revived with the previous role mostly intact. emergency_shuttle.incall() world << "\blue Alert: The emergency shuttle has been called. It will arrive in [round(emergency_shuttle.timeleft()/60)] minutes." world << sound('shuttlecalled.ogg') + //feedback_add_details("admin_verb","CSHUT") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! return /client/proc/admin_cancel_shuttle() @@ -782,6 +801,7 @@ Traitors and the like can also be revived with the previous role mostly intact. if(confirm != "Yes") return emergency_shuttle.recall() + //feedback_add_details("admin_verb","CCSHUT") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! return @@ -808,6 +828,7 @@ Traitors and the like can also be revived with the previous role mostly intact. usr << text("\red Attack Log for []", mob) for(var/t in M.attack_log) usr << t + //feedback_add_details("admin_verb","ATTL") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! /client/proc/everyone_random() @@ -839,6 +860,7 @@ Traitors and the like can also be revived with the previous role mostly intact. usr << "Remember: you can always disable the randomness by using the verb again, assuming the round hasn't started yet." ticker.random_players = 1 + //feedback_add_details("admin_verb","MER") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! /client/proc/toggle_gravity_on() set category = "Debug" @@ -854,6 +876,7 @@ Traitors and the like can also be revived with the previous role mostly intact. A.gravitychange(1,A) command_alert("CentComm is now beaming gravitons to your station. We appoligize for any inconvience.") + //feedback_add_details("admin_verb","TSGON") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! /client/proc/toggle_gravity_off() set category = "Debug" @@ -869,7 +892,9 @@ Traitors and the like can also be revived with the previous role mostly intact. A.gravitychange(0,A) command_alert("For budget reasons, Centcomm is no longer beaming gravitons to your station. We appoligize for any inconvience.") -//CARN + //feedback_add_details("admin_verb","TSGOFF") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! + + /client/proc/toggle_random_events() set category = "Server" set name = "Toggle random events on/off"