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)

git-svn-id: http://tgstation13.googlecode.com/svn/trunk@3366 316c924e-a436-60f5-8080-3fe189b3f50e
This commit is contained in:
elly1989@rocketmail.com
2012-03-28 10:06:32 +00:00
parent 4c7d775593
commit 38a9e343a6
7 changed files with 108 additions and 82 deletions

View File

@@ -3,43 +3,34 @@
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)
if( ismob(O) && !issilicon(O) )
turretTargets -= O
else if( istype(O, /obj/mecha) )
turretTargets -= O
..()
return 1
@@ -129,18 +120,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
@@ -325,10 +317,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 << "<span class='notice'>You [ locked ? "lock" : "unlock"] the panel.</span>"
if (locked)
if (user.machine==src)
user.machine = null
@@ -337,18 +329,18 @@
if (user.machine==src)
src.attack_hand(usr)
else
user << "\red Access denied."
user << "<span class='warning'>Access denied.</span>"
/obj/machinery/turretid/attack_ai(mob/user as mob)
if(!ailock)
return attack_hand(user)
else
user << "There seems to be a firewall preventing you from accessing this device."
user << "<span class='notice'>There seems to be a firewall preventing you from accessing this device.</span>"
/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 << "<span class='notice'>You are too far away.</span>"
user.machine = null
user << browse(null, "window=turretid")
return
@@ -392,6 +384,7 @@
if (!istype(usr, /mob/living/silicon))
usr << "Control panel is locked!"
return
if ( get_dist(src, usr) == 0 )
if (href_list["toggleOn"])
src.enabled = !src.enabled
src.updateTurrets()
@@ -404,7 +397,7 @@
if(control_area)
for (var/obj/machinery/turret/aTurret in get_area_all_atoms(control_area))
aTurret.setState(enabled, lethal)
update_icons()
src.update_icons()
/obj/machinery/turretid/proc/update_icons()
if (src.enabled)
@@ -414,12 +407,14 @@
icon_state = "motion3"
else
icon_state = "motion0"
if(control_area)
for (var/obj/machinery/turretid/aTurret in get_area_all_atoms(control_area))
aTurret.icon_state = icon_state
aTurret.enabled = enabled
aTurret.lethal = lethal
//CODE FIXED BUT REMOVED
// 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
/obj/structure/turret/gun_turret

View File

@@ -85,38 +85,57 @@
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]<BR>", 1)
/client/proc/cmd_admin_pm(mob/M as mob in world)
/client/proc/cmd_admin_pm()
set category = "Admin"
set name = "Admin PM"
if(!authenticated || !holder)
src << "Only administrators may use this command."
return
if(M)
var/list/client/targets[0]
for(var/client/C)
if(C.mob)
if(istype(C.mob, /mob/new_player))
targets["[C] - (New Player)"] = C
else if(istype(C.mob, /mob/dead/observer))
targets["[C] - [C.mob.name](Ghost)"] = C
else
targets["[C] - [C.mob.real_name](as [C.mob.name])"] = C
else
targets["[C] - No Mob"] = C
var/target = input(usr,"To whom shall we send a message?","Admin PM",null) in targets
var/client/C = targets[target]
if( !C || !istype(C,/client) )
src << "\red Error: Admin-PM: Client not found."
return
if(src.muted_complete)
src << "You are muted have a nice day"
return
if (!( ismob(M) ))
return
var/t = input("Message:", text("Private message to [M.key]")) as text|null
if(holder.rank != "Game Admin" && holder.rank != "Game Master")
t = strip_html(t,500)
if (!( t ))
src << "\red Error: Admin-PM: You are muted."
return
var/t = input("Message:", "Private message to [C.key]") as text|null
if( !(holder.rank in list("Game Admin", "Game Master")) )
t = sanitize(copytext(t,1,500))
if ( !t || !C || !C.mob ) return
//TODO: rewrite key_name() to use something other than mobs. ~CARN
if (usr.client && usr.client.holder)
M << "\red Admin PM from-<b>[key_name(usr, M, 0)]</b>: [t]"
usr << "\blue Admin PM to-<b>[key_name(M, usr, 1)]</b>: [t]"
C << "\red Admin PM from-<b>[key_name(usr, C.mob, 0)]</b>: [t]"
src << "\blue Admin PM to-<b>[key_name(C, usr, 1)]</b>: [t]"
else
if (M.client && M.client.holder)
M << "\blue Reply PM from-<b>[key_name(usr, M, 1)]</b>: [t]"
if (C && C.holder)
C << "\blue Reply PM from-<b>[key_name(usr, C.mob, 1)]</b>: [t]"
else
M << "\red Reply PM from-<b>[key_name(usr, M, 0)]</b>: [t]"
usr << "\blue Reply PM to-<b>[key_name(M, usr, 0)]</b>: [t]"
C << "\red Reply PM from-<b>[key_name(usr, C.mob, 0)]</b>: [t]"
src << "\blue Reply PM to-<b>[key_name(C.mob, usr, 0)]</b>: [t]"
log_admin("PM: [key_name(usr)]->[key_name(M)] : [t]")
log_admin("PM: [key_name(usr)]->[key_name(C.mob)] : [t]")
for(var/mob/K in world) //we don't use message_admins here because the sender/receiver might get it too
if(K && K.client && K.client.holder && K.key != usr.key && K.key != M.key)
K << "<B><font color='blue'>PM: [key_name(usr, K)]-&gt;[key_name(M, K)]:</B> \blue [t]</font>"
for(var/client/X) //there are fewer clients than mobs
if(X.holder && X.key!=usr.key && X.key!=C.key) //check client/X is an admin and isn't the sender or recipient
var/mob/K = X.mob //get X's mob
if(K)
K << "<B><font color='blue'>PM: [key_name(usr, K)]-&gt;[key_name(C.mob, K)]:</B> \blue [t]</font>" //inform X
/client/proc/cmd_admin_godmode(mob/M as mob in world)
set category = "Special Verbs"

View File

@@ -187,7 +187,7 @@
foundghost++
break
if(!foundghost)
msg += "and [t_his] soul has departed"
msg += " and [t_his] soul has departed"
msg += "...</span>\n"
else

View File

@@ -37,7 +37,7 @@
msg += "</span>"
if (src.digitalcamo)
msg += "It looks replusingly uncanny!\n"
msg += "It is repulsively uncanny!\n"
msg += "*---------*</span>"

View File

@@ -631,9 +631,10 @@
src.client << "\red Admin-player or player-admin conversation only!"
return.
var/t = input("Message:", text("Private message to [C.key]")) as text|null
if (!t || !usr || !C || !usr.client)
return
//get message text, limit it's length.and clean/escape html
var/t = input("Message:", "Private message to [C.key]") as text|null
t = sanitize( copytext(t,1,500) )
if (!t || !usr || !C || !usr.client) return
if (usr.client && usr.client.holder) //Admin is messaging a player
C << "\red <font size='4'><b>-- Administrator private message --</b></font>"
C << "<b>[key_name(usr.client, C, 0)] [t]</b>"

View File

@@ -233,6 +233,9 @@
else if(!href_list["late_join"])
new_player_panel()
if(href_list["priv_msg"])
..() //pass PM calls along to /mob/Topic
return
proc/IsJobAvailable(rank)
var/datum/job/job = job_master.GetJob(rank)

View File

@@ -92,6 +92,14 @@ should be listed in the changelog upon commit tho. Thanks. -->
<!-- To take advantage of the pretty new format (well it was new when I wrote this anyway), open the "add-to-changelog.html" file in any browser and add the stuff and then generate the html code and paste it here -->
<div class="commit sansserif">
<h2 class="date">28 March 2012</h2>
<h3 class="author">Carn updated:</h3>
<ul class="changes bgimages16">
<li class="bugfix">Fixed turrets shooting people that leave the area and the telecomm turret controls.</li>
</ul>
</div>
<div class="commit sansserif">
<h2 class="date">27 March 2012</h2>
<h3 class="author">Nodrak updated:</h3>