mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2026-08-30 00:35:45 +01:00
Merge pull request #1541 from CHOMPStationBot/upstream-merge-9765
[MIRROR] [MIRROR] Ports TGUI Security Stuff
This commit is contained in:
@@ -15,6 +15,9 @@
|
||||
var/stop = 0.0
|
||||
var/screen = 0 // 0 - No Access Denied, 1 - Access allowed
|
||||
|
||||
/obj/machinery/computer/prisoner/attack_ai(var/mob/user as mob)
|
||||
return src.attack_hand(user)
|
||||
|
||||
/obj/machinery/computer/prisoner/attack_hand(mob/user)
|
||||
if(..())
|
||||
return
|
||||
@@ -28,7 +31,7 @@
|
||||
|
||||
/obj/machinery/computer/prisoner/tgui_data(mob/user)
|
||||
var/list/data = list()
|
||||
|
||||
|
||||
data["locked"] = !screen
|
||||
data["chemImplants"] = list()
|
||||
data["trackImplants"] = list()
|
||||
@@ -65,24 +68,22 @@
|
||||
|
||||
return data
|
||||
|
||||
|
||||
/obj/machinery/computer/prisoner/tgui_act(action, list/params)
|
||||
if(..())
|
||||
return TRUE
|
||||
|
||||
switch(action)
|
||||
if("inject")
|
||||
var/obj/item/weapon/implant/I = locate(params["imp"])
|
||||
if(I)
|
||||
I.activate(clamp(params["val"], 0, 10))
|
||||
. = TRUE
|
||||
|
||||
if("lock")
|
||||
if(allowed(usr))
|
||||
screen = !screen
|
||||
else
|
||||
to_chat(usr, "Unauthorized Access.")
|
||||
. = TRUE
|
||||
|
||||
if("warn")
|
||||
var/warning = sanitize(input(usr, "Message:", "Enter your message here!", ""))
|
||||
if(!warning)
|
||||
@@ -91,5 +92,4 @@
|
||||
if(I && I.imp_in)
|
||||
to_chat(I.imp_in, "<span class='notice'>You hear a voice in your head saying: '[warning]'</span>")
|
||||
. = TRUE
|
||||
|
||||
add_fingerprint(usr)
|
||||
add_fingerprint(usr)
|
||||
|
||||
@@ -389,11 +389,11 @@
|
||||
|
||||
if(field == "age")
|
||||
answer = text2num(answer)
|
||||
|
||||
|
||||
if(field == "rank")
|
||||
if(answer in joblist)
|
||||
active1.fields["real_rank"] = answer
|
||||
|
||||
|
||||
if(field == "criminal")
|
||||
for(var/mob/living/carbon/human/H in player_list)
|
||||
BITSET(H.hud_updateflag, WANTED_HUD)
|
||||
|
||||
@@ -8,8 +8,6 @@
|
||||
#define PRESET_MEDIUM 5 MINUTES
|
||||
#define PRESET_LONG 10 MINUTES
|
||||
|
||||
//This file was auto-corrected by findeclaration.exe on 25.5.2012 20:42:31
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Brig Door control displays.
|
||||
// Description: This is a controls the timer for the brig doors, displays the timer on itself and
|
||||
@@ -25,16 +23,16 @@
|
||||
layer = ABOVE_WINDOW_LAYER
|
||||
desc = "A remote control for a door."
|
||||
req_access = list(access_brig)
|
||||
anchored = 1.0 // can't pick it up
|
||||
density = 0 // can walk through it.
|
||||
var/id = null // id of door it controls.
|
||||
|
||||
anchored = 1.0 // can't pick it up
|
||||
density = 0 // can walk through it.
|
||||
var/id = null // id of door it controls.
|
||||
var/activation_time = 0
|
||||
var/timer_duration = 0
|
||||
|
||||
var/timing = FALSE // boolean, true/1 timer is on, false/0 means it's not timing
|
||||
var/list/obj/machinery/targets = list()
|
||||
|
||||
|
||||
maptext_height = 26
|
||||
maptext_width = 32
|
||||
|
||||
@@ -71,12 +69,12 @@
|
||||
/obj/machinery/door_timer/process()
|
||||
if(stat & (NOPOWER|BROKEN))
|
||||
return
|
||||
|
||||
if(timing)
|
||||
if(world.time - activation_time >= timer_duration)
|
||||
timer_end() // open doors, reset timer, clear status screen
|
||||
update_icon()
|
||||
|
||||
|
||||
// has the door power situation changed, if so update icon.
|
||||
/obj/machinery/door_timer/power_change()
|
||||
..()
|
||||
@@ -107,7 +105,7 @@
|
||||
C.icon_state = "closed_locked"
|
||||
return 1
|
||||
|
||||
// Opens and unlocks doors, power check
|
||||
/// Opens and unlocks doors, power check
|
||||
/obj/machinery/door_timer/proc/timer_end(forced = FALSE)
|
||||
if(stat & (NOPOWER|BROKEN))
|
||||
return 0
|
||||
@@ -144,6 +142,9 @@
|
||||
if(timer_duration && activation_time && timing) // Setting it while active will reset the activation time
|
||||
activation_time = world.time
|
||||
|
||||
/obj/machinery/door_timer/attack_ai(mob/user)
|
||||
return src.attack_hand(user)
|
||||
|
||||
/obj/machinery/door_timer/attack_hand(mob/user)
|
||||
if(..())
|
||||
return TRUE
|
||||
|
||||
@@ -141,4 +141,4 @@
|
||||
else if(bloodsamp)
|
||||
icon_state = "dnaclosed"
|
||||
else
|
||||
icon_state = "dnaopen"
|
||||
icon_state = "dnaopen"
|
||||
Reference in New Issue
Block a user