mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2026-01-03 22:13:50 +00:00
Merge pull request #6160 from Heroman3003/commod-fix
Fixes access restrictions for com&com MC program
This commit is contained in:
@@ -61,7 +61,7 @@
|
|||||||
data["message_line2"] = msg_line2
|
data["message_line2"] = msg_line2
|
||||||
data["state"] = current_status
|
data["state"] = current_status
|
||||||
data["isAI"] = issilicon(usr)
|
data["isAI"] = issilicon(usr)
|
||||||
data["authenticated"] = is_autenthicated(user)
|
data["authenticated"] = get_authentication_level(user)
|
||||||
data["current_security_level"] = security_level
|
data["current_security_level"] = security_level
|
||||||
data["current_security_level_title"] = num2seclevel(security_level)
|
data["current_security_level_title"] = num2seclevel(security_level)
|
||||||
|
|
||||||
@@ -95,9 +95,12 @@
|
|||||||
ui.set_initial_data(data)
|
ui.set_initial_data(data)
|
||||||
ui.open()
|
ui.open()
|
||||||
|
|
||||||
/datum/nano_module/program/comm/proc/is_autenthicated(var/mob/user)
|
/datum/nano_module/program/comm/proc/get_authentication_level(var/mob/user)
|
||||||
if(program)
|
if(program)
|
||||||
return program.can_run(user)
|
if(program.can_run(user, 0, access_captain))
|
||||||
|
return 2
|
||||||
|
else
|
||||||
|
return program.can_run(user)
|
||||||
return 1
|
return 1
|
||||||
|
|
||||||
/datum/nano_module/program/comm/proc/obtain_message_listener()
|
/datum/nano_module/program/comm/proc/obtain_message_listener()
|
||||||
@@ -119,7 +122,7 @@
|
|||||||
current_status = text2num(href_list["target"])
|
current_status = text2num(href_list["target"])
|
||||||
if("announce")
|
if("announce")
|
||||||
. = 1
|
. = 1
|
||||||
if(is_autenthicated(user) && !issilicon(usr) && ntn_comm)
|
if(get_authentication_level(user) == 2 && !issilicon(usr) && ntn_comm)
|
||||||
if(user)
|
if(user)
|
||||||
var/obj/item/weapon/card/id/id_card = user.GetIdCard()
|
var/obj/item/weapon/card/id/id_card = user.GetIdCard()
|
||||||
crew_announcement.announcer = GetNameAndAssignmentFromId(id_card)
|
crew_announcement.announcer = GetNameAndAssignmentFromId(id_card)
|
||||||
@@ -139,7 +142,7 @@
|
|||||||
. = 1
|
. = 1
|
||||||
if(href_list["target"] == "emagged")
|
if(href_list["target"] == "emagged")
|
||||||
if(program)
|
if(program)
|
||||||
if(is_autenthicated(user) && program.computer_emagged && !issilicon(usr) && ntn_comm)
|
if(get_authentication_level(user) == 2 && program.computer_emagged && !issilicon(usr) && ntn_comm)
|
||||||
if(centcomm_message_cooldown)
|
if(centcomm_message_cooldown)
|
||||||
to_chat(usr, "<span class='warning'>Arrays recycling. Please stand by.</span>")
|
to_chat(usr, "<span class='warning'>Arrays recycling. Please stand by.</span>")
|
||||||
SSnanoui.update_uis(src)
|
SSnanoui.update_uis(src)
|
||||||
@@ -154,7 +157,7 @@
|
|||||||
spawn(300)//30 second cooldown
|
spawn(300)//30 second cooldown
|
||||||
centcomm_message_cooldown = 0
|
centcomm_message_cooldown = 0
|
||||||
else if(href_list["target"] == "regular")
|
else if(href_list["target"] == "regular")
|
||||||
if(is_autenthicated(user) && !issilicon(usr) && ntn_comm)
|
if(get_authentication_level(user) == 2 && !issilicon(usr) && ntn_comm)
|
||||||
if(centcomm_message_cooldown)
|
if(centcomm_message_cooldown)
|
||||||
to_chat(usr, "<span class='warning'>Arrays recycling. Please stand by.</span>")
|
to_chat(usr, "<span class='warning'>Arrays recycling. Please stand by.</span>")
|
||||||
SSnanoui.update_uis(src)
|
SSnanoui.update_uis(src)
|
||||||
@@ -173,7 +176,7 @@
|
|||||||
centcomm_message_cooldown = 0
|
centcomm_message_cooldown = 0
|
||||||
if("shuttle")
|
if("shuttle")
|
||||||
. = 1
|
. = 1
|
||||||
if(is_autenthicated(user) && ntn_cont)
|
if(get_authentication_level(user) && ntn_cont)
|
||||||
if(href_list["target"] == "call")
|
if(href_list["target"] == "call")
|
||||||
var/confirm = alert("Are you sure you want to call the shuttle?", name, "No", "Yes")
|
var/confirm = alert("Are you sure you want to call the shuttle?", name, "No", "Yes")
|
||||||
if(confirm == "Yes" && can_still_topic())
|
if(confirm == "Yes" && can_still_topic())
|
||||||
@@ -185,7 +188,7 @@
|
|||||||
cancel_call_proc(usr)
|
cancel_call_proc(usr)
|
||||||
if("setstatus")
|
if("setstatus")
|
||||||
. = 1
|
. = 1
|
||||||
if(is_autenthicated(user) && ntn_cont)
|
if(get_authentication_level(user) && ntn_cont)
|
||||||
switch(href_list["target"])
|
switch(href_list["target"])
|
||||||
if("line1")
|
if("line1")
|
||||||
var/linput = reject_bad_text(sanitize(input("Line 1", "Enter Message Text", msg_line1) as text|null, 40), 40)
|
var/linput = reject_bad_text(sanitize(input("Line 1", "Enter Message Text", msg_line1) as text|null, 40), 40)
|
||||||
@@ -203,7 +206,7 @@
|
|||||||
post_status(href_list["target"])
|
post_status(href_list["target"])
|
||||||
if("setalert")
|
if("setalert")
|
||||||
. = 1
|
. = 1
|
||||||
if(is_autenthicated(user) && !issilicon(usr) && ntn_cont && ntn_comm)
|
if(get_authentication_level(user) && !issilicon(usr) && ntn_cont && ntn_comm)
|
||||||
var/current_level = text2num(href_list["target"])
|
var/current_level = text2num(href_list["target"])
|
||||||
var/confirm = alert("Are you sure you want to change alert level to [num2seclevel(current_level)]?", name, "No", "Yes")
|
var/confirm = alert("Are you sure you want to change alert level to [num2seclevel(current_level)]?", name, "No", "Yes")
|
||||||
if(confirm == "Yes" && can_still_topic())
|
if(confirm == "Yes" && can_still_topic())
|
||||||
@@ -232,7 +235,7 @@
|
|||||||
current_status = STATE_DEFAULT
|
current_status = STATE_DEFAULT
|
||||||
if("viewmessage")
|
if("viewmessage")
|
||||||
. = 1
|
. = 1
|
||||||
if(is_autenthicated(user) && ntn_comm)
|
if(get_authentication_level(user) && ntn_comm)
|
||||||
current_viewing_message_id = text2num(href_list["target"])
|
current_viewing_message_id = text2num(href_list["target"])
|
||||||
for(var/list/m in l.messages)
|
for(var/list/m in l.messages)
|
||||||
if(m["id"] == current_viewing_message_id)
|
if(m["id"] == current_viewing_message_id)
|
||||||
@@ -240,12 +243,12 @@
|
|||||||
current_status = STATE_VIEWMESSAGE
|
current_status = STATE_VIEWMESSAGE
|
||||||
if("delmessage")
|
if("delmessage")
|
||||||
. = 1
|
. = 1
|
||||||
if(is_autenthicated(user) && ntn_comm && l != global_message_listener)
|
if(get_authentication_level(user) && ntn_comm && l != global_message_listener)
|
||||||
l.Remove(current_viewing_message)
|
l.Remove(current_viewing_message)
|
||||||
current_status = STATE_MESSAGELIST
|
current_status = STATE_MESSAGELIST
|
||||||
if("printmessage")
|
if("printmessage")
|
||||||
. = 1
|
. = 1
|
||||||
if(is_autenthicated(user) && ntn_comm)
|
if(get_authentication_level(user) && ntn_comm)
|
||||||
if(program && program.computer && program.computer.nano_printer)
|
if(program && program.computer && program.computer.nano_printer)
|
||||||
if(!program.computer.nano_printer.print_text(current_viewing_message["contents"],current_viewing_message["title"]))
|
if(!program.computer.nano_printer.print_text(current_viewing_message["contents"],current_viewing_message["title"]))
|
||||||
to_chat(usr, "<span class='notice'>Hardware error: Printer was unable to print the file. It may be out of paper.</span>")
|
to_chat(usr, "<span class='notice'>Hardware error: Printer was unable to print the file. It may be out of paper.</span>")
|
||||||
|
|||||||
@@ -1,11 +1,13 @@
|
|||||||
{{if data.authenticated}}
|
{{if data.authenticated}}
|
||||||
{{if data.state === 1}}
|
{{if data.state === 1}}
|
||||||
<div class=item>{{:helper.link('Make An Announcement', null, {'action' : 'announce'}, data.isAI || !data.net_comms ? 'disabled' : null)}} </div>
|
{{if data.authenticated == 2}}
|
||||||
<div class=item>{{if data.emagged}}
|
<div class=item>{{:helper.link('Make An Announcement', null, {'action' : 'announce'}, data.isAI || !data.net_comms ? 'disabled' : null)}} </div>
|
||||||
{{:helper.link('Send an emergency message to [UNKNOWN]', null, {'action' : 'message', 'target' : 'emagged'}, data.isAI || !data.net_comms ? 'disabled' : null)}}
|
<div class=item>{{if data.emagged}}
|
||||||
{{else}}
|
{{:helper.link('Send an emergency message to [UNKNOWN]', null, {'action' : 'message', 'target' : 'emagged'}, data.isAI || !data.net_comms ? 'disabled' : null)}}
|
||||||
{{:helper.link('Send an emergency message to Centcom', null, {'action' : 'message', 'target' : 'regular'}, data.isAI || !data.net_comms ? 'disabled' : null)}}
|
{{else}}
|
||||||
{{/if}} </div>
|
{{:helper.link('Send an emergency message to Centcom', null, {'action' : 'message', 'target' : 'regular'}, data.isAI || !data.net_comms ? 'disabled' : null)}}
|
||||||
|
{{/if}} </div>
|
||||||
|
{{/if}}
|
||||||
<div class=item>{{:helper.link('Change alert level', null, {'action' : 'sw_menu', 'target' : 5}, data.isAI || !data.net_syscont || !data.net_comms ? 'disabled' : null)}} </div>
|
<div class=item>{{:helper.link('Change alert level', null, {'action' : 'sw_menu', 'target' : 5}, data.isAI || !data.net_syscont || !data.net_comms ? 'disabled' : null)}} </div>
|
||||||
<div class=item>{{if data.have_shuttle && data.have_shuttle_called}}
|
<div class=item>{{if data.have_shuttle && data.have_shuttle_called}}
|
||||||
{{:helper.link('Cancel Shuttle Call', null, {'action' : 'shuttle', 'target' : 'cancel'}, data.isAI || !data.net_syscont ? 'disabled' : null)}}
|
{{:helper.link('Cancel Shuttle Call', null, {'action' : 'shuttle', 'target' : 'cancel'}, data.isAI || !data.net_syscont ? 'disabled' : null)}}
|
||||||
|
|||||||
Reference in New Issue
Block a user