Fix vulnerabilities in air alarm and APC, fix mitochondria log

This commit is contained in:
Markolie
2015-02-08 17:07:55 +01:00
parent 37811366a8
commit c1b6bba1ec
5 changed files with 86 additions and 9 deletions
+1 -1
View File
@@ -335,7 +335,7 @@
if(L)
usr.attack_log += text("\[[time_stamp()]\] <font color='red'>[usr.real_name] ([usr.ckey]) cast the spell [name] on [L.real_name] ([L.ckey]).</font>")
msg_admin_attack("[usr.real_name] ([usr.ckey]) has cast the spell [name] on [L.real_name] ([L.ckey]) (<A HREF='?_src_=holder;adminplayerobservecoodjump=1;X=[usr.x];Y=[usr.y];Z=[usr.z]'>)")
msg_admin_attack("[usr.real_name] ([usr.ckey]) has cast the spell [name] on [L.real_name] ([L.ckey]) (<A HREF='?_src_=holder;adminplayerobservecoodjump=1;X=[usr.x];Y=[usr.y];Z=[usr.z]'>JMP</a>)")
L.adjust_fire_stacks(0.5)
L.visible_message("\red <b>[L.name]</b> suddenly bursts into flames!")
+47
View File
@@ -727,8 +727,37 @@
wires.Interact(user)
if(!shorted)
ui_interact(user)
/obj/machinery/alarm/proc/can_use(mob/user as mob)
if (user.stat && !isobserver(user))
user << "\red You must be conscious to use this [src]!"
return 0
if(stat & (NOPOWER|BROKEN))
return 0
if(buildstage != 2)
return 0
if((get_dist(src, user) > 1) && !istype(user, /mob/living/silicon))
return 0
if(istype(user, /mob/living/silicon) && aidisabled)
user << "AI control for this air alarm interface has been disabled."
return 0
return 1
/obj/machinery/alarm/proc/is_authenticated(mob/user as mob)
if(isAI(user) || isrobot(user))
return 1
else
return !locked
/obj/machinery/alarm/Topic(href, href_list)
if(!can_use(usr))
return 0
var/changed=0
if(href_list["rcon"])
@@ -747,6 +776,9 @@
//testing(href)
if(href_list["command"])
if(!is_authenticated(usr))
return
var/device_id = href_list["id_tag"]
switch(href_list["command"])
if( "power",
@@ -832,11 +864,17 @@
return 1
if(href_list["screen"])
if(!is_authenticated(usr))
return
screen = text2num(href_list["screen"])
ui_interact(usr)
return 1
if(href_list["atmos_alarm"])
if(!is_authenticated(usr))
return
alarmActivated=1
alarm_area.updateDangerLevel()
update_icon()
@@ -844,6 +882,9 @@
return 1
if(href_list["atmos_reset"])
if(!is_authenticated(usr))
return
alarmActivated=0
alarm_area.updateDangerLevel()
update_icon()
@@ -851,12 +892,18 @@
return 1
if(href_list["mode"])
if(!is_authenticated(usr))
return
mode = text2num(href_list["mode"])
apply_mode()
ui_interact(usr)
return 1
if(href_list["preset"])
if(!is_authenticated(usr))
return
preset = text2num(href_list["preset"])
apply_preset()
ui_interact(usr)
@@ -75,10 +75,14 @@
else if(src.allowed(user) || !src.registered_name || (istype(I) && (src.registered_name == I.registered_name)))
//they can open all lockers, or nobody owns this, or they own this locker
src.locked = !( src.locked )
if(src.locked) src.icon_state = src.icon_locked
else src.icon_state = src.icon_closed
if(src.locked)
src.icon_state = src.icon_locked
else
src.icon_state = src.icon_closed
registered_name = null
desc = initial(desc)
if(!src.registered_name)
if(!src.registered_name && src.locked)
src.registered_name = I.registered_name
src.desc = "Owned by [I.registered_name]."
else
+29 -3
View File
@@ -805,6 +805,8 @@
if (user.stat && !isobserver(user))
user << "\red You must be conscious to use this [src]!"
return 0
if(stat & (NOPOWER|BROKEN))
return 0
if(!user.client)
return 0
if ( ! (istype(user, /mob/living/carbon/human) || \
@@ -849,36 +851,60 @@
user << "\red You momentarily forget how to use [src]."
return 0
return 1
/obj/machinery/power/apc/proc/is_authenticated(mob/user as mob)
if(isAI(user) || isrobot(user))
return 1
else
return !locked
/obj/machinery/power/apc/Topic(href, href_list, var/usingUI = 1)
if(!can_use(usr, 1))
return 0
return 0
if (href_list["lock"])
if(!is_authenticated(usr))
return
coverlocked = !coverlocked
else if (href_list["breaker"])
if(!is_authenticated(usr))
return
toggle_breaker()
else if (href_list["cmode"])
if(!is_authenticated(usr))
return
chargemode = !chargemode
if(!chargemode)
charging = 0
update_icon()
else if (href_list["eqp"])
if(!is_authenticated(usr))
return
var/val = text2num(href_list["eqp"])
equipment = setsubsystem(val)
update_icon()
update()
else if (href_list["lgt"])
if(!is_authenticated(usr))
return
var/val = text2num(href_list["lgt"])
lighting = setsubsystem(val)
update_icon()
update()
else if (href_list["env"])
if(!is_authenticated(usr))
return
var/val = text2num(href_list["env"])
environ = setsubsystem(val)
update_icon()
@@ -893,7 +919,7 @@
return 0
else if (href_list["overload"])
if(istype(usr, /mob/living/silicon))
if(istype(usr, /mob/living/silicon) && !aidisabled)
src.overload_lighting()
else if (href_list["malfhack"])
@@ -931,7 +957,7 @@
else if (href_list["toggleaccess"])
if(istype(usr, /mob/living/silicon))
if(emagged || (stat & (BROKEN|MAINT)))
if(emagged || aidisabled || (stat & (BROKEN|MAINT)))
usr << "The APC does not respond to the command."
else
locked = !locked
+2 -2
View File
@@ -132,7 +132,7 @@ Used In File(s): /code/game/machinery/alarm.dm
<div class="line">
<div class="statusLabel">Operating:</div>
<div class="statusValue">
{{:helper.link(value.power ? 'On':'Off','power',{'id_tag':value.id_tag,'command':'power','val':value.power?0:1},null,(value.power?'linkOn':'red'))}}
{{:helper.link(value.power ? 'On':'Off','power',{'id_tag':value.id_tag,'command':'power','val':value.power?0:1},null)}}
{{if value.direction=="siphon"}}
{{:helper.link('Siphoning','arrowthickstop-1-s',{'id_tag':value.id_tag,'command':'direction','val':'1'})}}
{{else}}
@@ -170,7 +170,7 @@ Used In File(s): /code/game/machinery/alarm.dm
<div class="line">
<div class="statusLabel">Operating:</div>
<div class="statusValue">
{{:helper.link(value.power ? 'On':'Off','power',{'id_tag':value.id_tag,'command':'power','val':value.power?0:1},null,(value.power?'linkOn':'red'))}}
{{:helper.link(value.power ? 'On':'Off','power',{'id_tag':value.id_tag,'command':'power','val':value.power?0:1},null)}}
</div>
</div>
<div class="line">