Request Console cleanup.

Changes screen and departmentType to use defines and bitflags instead of magic numbers.
Moves code from the message sender to send_rc_message().
One console's destruction no longer prevents the entire department from receiving messages.
This commit is contained in:
Techhead0
2015-06-03 17:04:07 -04:00
parent b144a00ddc
commit 0195c179ff
4 changed files with 125 additions and 218 deletions

View File

@@ -1,6 +1,22 @@
/******************** Requests Console ********************/ /******************** Requests Console ********************/
/** Originally written by errorage, updated by: Carn, needs more work though. I just added some security fixes */ /** Originally written by errorage, updated by: Carn, needs more work though. I just added some security fixes */
//Request Console Department Types
#define RC_ASSIST 1 //Request Assistance
#define RC_SUPPLY 2 //Request Supplies
#define RC_INFO 4 //Relay Info
//Request Console Screens
#define RCS_RQASSIST 1 // Request supplies
#define RCS_RQSUPPLY 2 // Request assistance
#define RCS_SENDINFO 3 // Relay information
#define RCS_SENTPASS 4 // Message sent successfully
#define RCS_SENTFAIL 5 // Message sent unsuccessfully
#define RCS_VIEWMSGS 6 // View messages
#define RCS_MESSAUTH 7 // Authentication before sending
#define RCS_ANNOUNCE 8 // Send announcement
#define RCS_MAINMENU 9 // Main menu
var/req_console_assistance = list() var/req_console_assistance = list()
var/req_console_supplies = list() var/req_console_supplies = list()
var/req_console_information = list() var/req_console_information = list()
@@ -14,32 +30,13 @@ var/list/obj/machinery/requests_console/allConsoles = list()
icon_state = "req_comp0" icon_state = "req_comp0"
var/department = "Unknown" //The list of all departments on the station (Determined from this variable on each unit) Set this to the same thing if you want several consoles in one department var/department = "Unknown" //The list of all departments on the station (Determined from this variable on each unit) Set this to the same thing if you want several consoles in one department
var/list/messages = list() //List of all messages var/list/messages = list() //List of all messages
var/departmentType = 0 var/departmentType = 0 //Bitflag. Zero is reply-only. Map currently uses raw numbers instead of defines.
// 0 = none (not listed, can only repeplied to)
// 1 = assistance
// 2 = supplies
// 3 = info
// 4 = ass + sup //Erro goddamn you just HAD to shorten "assistance" down to "ass"
// 5 = ass + info
// 6 = sup + info
// 7 = ass + sup + info
var/newmessagepriority = 0 var/newmessagepriority = 0
// 0 = no new message // 0 = no new message
// 1 = normal priority // 1 = normal priority
// 2 = high priority // 2 = high priority
// 3 = extreme priority - not implemented, will probably require some hacking... everything needs to have a hidden feature in this game. // 3 = extreme priority - not implemented, will probably require some hacking... everything needs to have a hidden feature in this game.
var/screen = 0 var/screen = RCS_MAINMENU
// 0 = main menu,
// 1 = req. assistance,
// 2 = req. supplies
// 3 = relay information
// 4 = write msg - not used
// 5 = choose priority - not used
// 6 = sent successfully
// 7 = sent unsuccessfully
// 8 = view messages
// 9 = authentication before sending
// 10 = send announcement
var/silent = 0 // set to 1 for it not to beep all the time var/silent = 0 // set to 1 for it not to beep all the time
// var/hackState = 0 // var/hackState = 0
// 0 = not hacked // 0 = not hacked
@@ -77,49 +74,26 @@ var/list/obj/machinery/requests_console/allConsoles = list()
name = "[department] Requests Console" name = "[department] Requests Console"
allConsoles += src allConsoles += src
//req_console_departments += department if (departmentType & RC_ASSIST)
switch(departmentType)
if(1)
req_console_assistance |= department
if(2)
req_console_supplies |= department
if(3)
req_console_information |= department
if(4)
req_console_assistance |= department
req_console_supplies |= department
if(5)
req_console_assistance |= department
req_console_information |= department
if(6)
req_console_supplies |= department
req_console_information |= department
if(7)
req_console_assistance |= department req_console_assistance |= department
if (departmentType & RC_SUPPLY)
req_console_supplies |= department req_console_supplies |= department
if (departmentType & RC_INFO)
req_console_information |= department req_console_information |= department
/obj/machinery/requests_console/Destroy() /obj/machinery/requests_console/Destroy()
allConsoles -= src allConsoles -= src
switch(departmentType) var/lastDeptRC = 1
if(1) for (var/obj/machinery/requests_console/Console in allConsoles)
req_console_assistance -= department if (Console.department == department)
if(2) lastDeptRC = 0
req_console_supplies -= department break
if(3) if(lastDeptRC)
req_console_information -= department if (departmentType & RC_ASSIST)
if(4)
req_console_assistance -= department
req_console_supplies -= department
if(5)
req_console_assistance -= department
req_console_information -= department
if(6)
req_console_supplies -= department
req_console_information -= department
if(7)
req_console_assistance -= department req_console_assistance -= department
if (departmentType & RC_SUPPLY)
req_console_supplies -= department req_console_supplies -= department
if (departmentType & RC_INFO)
req_console_information -= department req_console_information -= department
..() ..()
@@ -130,7 +104,7 @@ var/list/obj/machinery/requests_console/allConsoles = list()
dat = text("<HEAD><TITLE>Requests Console</TITLE></HEAD><H3>[department] Requests Console</H3>") dat = text("<HEAD><TITLE>Requests Console</TITLE></HEAD><H3>[department] Requests Console</H3>")
if(!open) if(!open)
switch(screen) switch(screen)
if(1) //req. assistance if(RCS_RQASSIST) //req. assistance
dat += text("Which department do you need assistance from?<BR><BR>") dat += text("Which department do you need assistance from?<BR><BR>")
for(var/dpt in req_console_assistance) for(var/dpt in req_console_assistance)
if (dpt != department) if (dpt != department)
@@ -139,9 +113,9 @@ var/list/obj/machinery/requests_console/allConsoles = list()
// if (hackState == 1) // if (hackState == 1)
// dat += text(" or <A href='?src=\ref[src];write=[ckey(dpt)];priority=3'>EXTREME</A>)") // dat += text(" or <A href='?src=\ref[src];write=[ckey(dpt)];priority=3'>EXTREME</A>)")
dat += text(")<BR>") dat += text(")<BR>")
dat += text("<BR><A href='?src=\ref[src];setScreen=0'>Back</A><BR>") dat += text("<BR><A href='?src=\ref[src];setScreen=[RCS_MAINMENU]'>Back</A><BR>")
if(2) //req. supplies if(RCS_RQSUPPLY) //req. supplies
dat += text("Which department do you need supplies from?<BR><BR>") dat += text("Which department do you need supplies from?<BR><BR>")
for(var/dpt in req_console_supplies) for(var/dpt in req_console_supplies)
if (dpt != department) if (dpt != department)
@@ -150,9 +124,9 @@ var/list/obj/machinery/requests_console/allConsoles = list()
// if (hackState == 1) // if (hackState == 1)
// dat += text(" or <A href='?src=\ref[src];write=[ckey(dpt)];priority=3'>EXTREME</A>)") // dat += text(" or <A href='?src=\ref[src];write=[ckey(dpt)];priority=3'>EXTREME</A>)")
dat += text(")<BR>") dat += text(")<BR>")
dat += text("<BR><A href='?src=\ref[src];setScreen=0'>Back</A><BR>") dat += text("<BR><A href='?src=\ref[src];setScreen=[RCS_MAINMENU]'>Back</A><BR>")
if(3) //relay information if(RCS_SENDINFO) //relay information
dat += text("Which department would you like to send information to?<BR><BR>") dat += text("Which department would you like to send information to?<BR><BR>")
for(var/dpt in req_console_information) for(var/dpt in req_console_information)
if (dpt != department) if (dpt != department)
@@ -161,17 +135,17 @@ var/list/obj/machinery/requests_console/allConsoles = list()
// if (hackState == 1) // if (hackState == 1)
// dat += text(" or <A href='?src=\ref[src];write=[ckey(dpt)];priority=3'>EXTREME</A>)") // dat += text(" or <A href='?src=\ref[src];write=[ckey(dpt)];priority=3'>EXTREME</A>)")
dat += text(")<BR>") dat += text(")<BR>")
dat += text("<BR><A href='?src=\ref[src];setScreen=0'>Back</A><BR>") dat += text("<BR><A href='?src=\ref[src];setScreen=[RCS_MAINMENU]'>Back</A><BR>")
if(6) //sent successfully if(RCS_SENTPASS) //sent successfully
dat += text("<FONT COLOR='GREEN'>Message sent</FONT><BR><BR>") dat += text("<FONT COLOR='GREEN'>Message sent</FONT><BR><BR>")
dat += text("<A href='?src=\ref[src];setScreen=0'>Continue</A><BR>") dat += text("<A href='?src=\ref[src];setScreen=[RCS_MAINMENU]'>Continue</A><BR>")
if(7) //unsuccessful; not sent if(RCS_SENTFAIL) //unsuccessful; not sent
dat += text("<FONT COLOR='RED'>An error occurred. </FONT><BR><BR>") dat += text("<FONT COLOR='RED'>An error occurred. </FONT><BR><BR>")
dat += text("<A href='?src=\ref[src];setScreen=0'>Continue</A><BR>") dat += text("<A href='?src=\ref[src];setScreen=[RCS_MAINMENU]'>Continue</A><BR>")
if(8) //view messages if(RCS_VIEWMSGS) //view messages
for (var/obj/machinery/requests_console/Console in allConsoles) for (var/obj/machinery/requests_console/Console in allConsoles)
if (Console.department == department) if (Console.department == department)
Console.newmessagepriority = 0 Console.newmessagepriority = 0
@@ -181,18 +155,18 @@ var/list/obj/machinery/requests_console/allConsoles = list()
icon_state = "req_comp0" icon_state = "req_comp0"
for(var/msg in messages) for(var/msg in messages)
dat += text("[msg]<BR>") dat += text("[msg]<BR>")
dat += text("<A href='?src=\ref[src];setScreen=0'>Back to main menu</A><BR>") dat += text("<A href='?src=\ref[src];setScreen=[RCS_MAINMENU]'>Back to main menu</A><BR>")
if(9) //authentication before sending if(RCS_MESSAUTH) //authentication before sending
dat += text("<B>Message Authentication</B><BR><BR>") dat += text("<B>Message Authentication</B><BR><BR>")
dat += text("<b>Message for [dpt]: </b>[message]<BR><BR>") dat += text("<b>Message for [dpt]: </b>[message]<BR><BR>")
dat += text("You may authenticate your message now by scanning your ID or your stamp<BR><BR>") dat += text("You may authenticate your message now by scanning your ID or your stamp<BR><BR>")
dat += text("Validated by: [msgVerified]<br>"); dat += text("Validated by: [msgVerified]<br>");
dat += text("Stamped by: [msgStamped]<br>"); dat += text("Stamped by: [msgStamped]<br>");
dat += text("<A href='?src=\ref[src];department=[dpt]'>Send</A><BR>"); dat += text("<A href='?src=\ref[src];department=[dpt]'>Send</A><BR>");
dat += text("<BR><A href='?src=\ref[src];setScreen=0'>Back</A><BR>") dat += text("<BR><A href='?src=\ref[src];setScreen=[RCS_MAINMENU]'>Back</A><BR>")
if(10) //send announcement if(RCS_ANNOUNCE) //send announcement
dat += text("<B>Station wide announcement</B><BR><BR>") dat += text("<B>Station wide announcement</B><BR><BR>")
if(announceAuth) if(announceAuth)
dat += text("<b>Authentication accepted</b><BR><BR>") dat += text("<b>Authentication accepted</b><BR><BR>")
@@ -201,22 +175,22 @@ var/list/obj/machinery/requests_console/allConsoles = list()
dat += text("<b>Message: </b>[message] <A href='?src=\ref[src];writeAnnouncement=1'>Write</A><BR><BR>") dat += text("<b>Message: </b>[message] <A href='?src=\ref[src];writeAnnouncement=1'>Write</A><BR><BR>")
if (announceAuth && message) if (announceAuth && message)
dat += text("<A href='?src=\ref[src];sendAnnouncement=1'>Announce</A><BR>"); dat += text("<A href='?src=\ref[src];sendAnnouncement=1'>Announce</A><BR>");
dat += text("<BR><A href='?src=\ref[src];setScreen=0'>Back</A><BR>") dat += text("<BR><A href='?src=\ref[src];setScreen=[RCS_MAINMENU]'>Back</A><BR>")
else //main menu else //main menu
screen = 0 screen = RCS_MAINMENU
reset_announce() reset_announce()
if (newmessagepriority == 1) if (newmessagepriority == 1)
dat += text("<FONT COLOR='RED'>There are new messages</FONT><BR>") dat += text("<FONT COLOR='RED'>There are new messages</FONT><BR>")
if (newmessagepriority == 2) if (newmessagepriority == 2)
dat += text("<FONT COLOR='RED'><B>NEW PRIORITY MESSAGES</B></FONT><BR>") dat += text("<FONT COLOR='RED'><B>NEW PRIORITY MESSAGES</B></FONT><BR>")
dat += text("<A href='?src=\ref[src];setScreen=8'>View Messages</A><BR><BR>") dat += text("<A href='?src=\ref[src];setScreen=[RCS_VIEWMSGS]'>View Messages</A><BR><BR>")
dat += text("<A href='?src=\ref[src];setScreen=1'>Request Assistance</A><BR>") dat += text("<A href='?src=\ref[src];setScreen=[RCS_RQASSIST]'>Request Assistance</A><BR>")
dat += text("<A href='?src=\ref[src];setScreen=2'>Request Supplies</A><BR>") dat += text("<A href='?src=\ref[src];setScreen=[RCS_RQSUPPLY]'>Request Supplies</A><BR>")
dat += text("<A href='?src=\ref[src];setScreen=3'>Relay Anonymous Information</A><BR><BR>") dat += text("<A href='?src=\ref[src];setScreen=[RCS_SENDINFO]'>Relay Anonymous Information</A><BR><BR>")
if(announcementConsole) if(announcementConsole)
dat += text("<A href='?src=\ref[src];setScreen=10'>Send station-wide announcement</A><BR><BR>") dat += text("<A href='?src=\ref[src];setScreen=[RCS_ANNOUNCE]'>Send station-wide announcement</A><BR><BR>")
if (silent) if (silent)
dat += text("Speaker <A href='?src=\ref[src];setSilent=0'>OFF</A>") dat += text("Speaker <A href='?src=\ref[src];setSilent=0'>OFF</A>")
else else
@@ -237,7 +211,7 @@ var/list/obj/machinery/requests_console/allConsoles = list()
var/new_message = sanitize(input("Write your message:", "Awaiting Input", "")) var/new_message = sanitize(input("Write your message:", "Awaiting Input", ""))
if(new_message) if(new_message)
message = new_message message = new_message
screen = 9 screen = RCS_MESSAUTH
switch(href_list["priority"]) switch(href_list["priority"])
if("2") priority = 2 if("2") priority = 2
else priority = -1 else priority = -1
@@ -245,7 +219,7 @@ var/list/obj/machinery/requests_console/allConsoles = list()
dpt = ""; dpt = "";
msgVerified = "" msgVerified = ""
msgStamped = "" msgStamped = ""
screen = 0 screen = RCS_MAINMENU
priority = -1 priority = -1
if(href_list["writeAnnouncement"]) if(href_list["writeAnnouncement"])
@@ -257,107 +231,41 @@ var/list/obj/machinery/requests_console/allConsoles = list()
else priority = -1 else priority = -1
else else
reset_announce() reset_announce()
screen = 0 screen = RCS_MAINMENU
if(href_list["sendAnnouncement"]) if(href_list["sendAnnouncement"])
if(!announcementConsole) return if(!announcementConsole) return
announcement.Announce(message, msg_sanitized = 1) announcement.Announce(message, msg_sanitized = 1)
reset_announce() reset_announce()
screen = 0 screen = RCS_MAINMENU
if( href_list["department"] && message ) if( href_list["department"] && message )
var/log_msg = message var/log_msg = message
var/sending = message
sending += "<br>"
if (msgVerified)
sending += msgVerified
sending += "<br>"
if (msgStamped)
sending += msgStamped
sending += "<br>"
screen = 7 //if it's successful, this will get overrwritten (7 = unsufccessfull, 6 = successfull)
if (sending)
var/pass = 0 var/pass = 0
screen = RCS_SENTFAIL
for (var/obj/machinery/message_server/MS in world) for (var/obj/machinery/message_server/MS in world)
if(!MS.active) continue if(!MS.active) continue
MS.send_rc_message(href_list["department"],department,log_msg,msgStamped,msgVerified,priority) MS.send_rc_message(href_list["department"],department,log_msg,msgStamped,msgVerified,priority)
pass = 1 pass = 1
if(pass) if(pass)
screen = RCS_SENTPASS
for (var/obj/machinery/requests_console/Console in allConsoles)
if (ckey(Console.department) == ckey(href_list["department"]))
switch(priority)
if("2") //High priority
if(Console.newmessagepriority < 2)
Console.newmessagepriority = 2
Console.icon_state = "req_comp2"
if(!Console.silent)
playsound(Console.loc, 'sound/machines/twobeep.ogg', 50, 1)
for (var/mob/O in hearers(5, Console.loc))
O.show_message(text("\icon[Console] *The Requests Console beeps: 'PRIORITY Alert in [department]'"))
Console.messages += "<B><FONT color='red'>High Priority message from <A href='?src=\ref[Console];write=[ckey(department)]'>[department]</A></FONT></B><BR>[sending]"
// if("3") //Not implemanted, but will be //Removed as it doesn't look like anybody intends on implimenting it ~Carn
// if(Console.newmessagepriority < 3)
// Console.newmessagepriority = 3
// Console.icon_state = "req_comp3"
// if(!Console.silent)
// playsound(Console.loc, 'sound/machines/twobeep.ogg', 50, 1)
// for (var/mob/O in hearers(7, Console.loc))
// O.show_message(text("\icon[Console] *The Requests Console yells: 'EXTREME PRIORITY alert in [department]'"))
// Console.messages += "<B><FONT color='red'>Extreme Priority message from [ckey(department)]</FONT></B><BR>[message]"
else // Normal priority
if(Console.newmessagepriority < 1)
Console.newmessagepriority = 1
Console.icon_state = "req_comp1"
if(!Console.silent)
playsound(Console.loc, 'sound/machines/twobeep.ogg', 50, 1)
for (var/mob/O in hearers(4, Console.loc))
O.show_message(text("\icon[Console] *The Requests Console beeps: 'Message from [department]'"))
Console.messages += "<B>Message from <A href='?src=\ref[Console];write=[ckey(department)]'>[department]</A></FONT></B><BR>[message]"
screen = 6
Console.set_light(2)
messages += "<B>Message sent to [dpt]</B><BR>[message]" messages += "<B>Message sent to [dpt]</B><BR>[message]"
else else
for (var/mob/O in hearers(4, src.loc)) audible_message(text("\icon[src] *The Requests Console beeps: 'NOTICE: No server detected!'"),,4)
O.show_message(text("\icon[src] *The Requests Console beeps: 'NOTICE: No server detected!'"))
//Handle screen switching //Handle screen switching
switch(text2num(href_list["setScreen"])) var/tempScreen = text2num(href_list["setScreen"])
if(null) //skip if(tempScreen)
if(1) //req. assistance if(tempScreen == RCS_ANNOUNCE && !announcementConsole)
screen = 1 return
if(2) //req. supplies if(tempScreen == RCS_MAINMENU)
screen = 2
if(3) //relay information
screen = 3
// if(4) //write message
// screen = 4
if(5) //choose priority
screen = 5
if(6) //sent successfully
screen = 6
if(7) //unsuccessfull; not sent
screen = 7
if(8) //view messages
screen = 8
if(9) //authentication
screen = 9
if(10) //send announcement
if(!announcementConsole) return
screen = 10
else //main menu
dpt = "" dpt = ""
msgVerified = "" msgVerified = ""
msgStamped = "" msgStamped = ""
message = "" message = ""
priority = -1 priority = -1
screen = 0 screen = tempScreen
//Handle silencing the console //Handle silencing the console
switch( href_list["setSilent"] ) switch( href_list["setSilent"] )
@@ -393,21 +301,21 @@ var/list/obj/machinery/requests_console/allConsoles = list()
user << "You can't do much with that."*/ user << "You can't do much with that."*/
if (istype(O, /obj/item/weapon/card/id)) if (istype(O, /obj/item/weapon/card/id))
if(screen == 9) if(screen == RCS_MESSAUTH)
var/obj/item/weapon/card/id/T = O var/obj/item/weapon/card/id/T = O
msgVerified = text("<font color='green'><b>Verified by [T.registered_name] ([T.assignment])</b></font>") msgVerified = text("<font color='green'><b>Verified by [T.registered_name] ([T.assignment])</b></font>")
updateUsrDialog() updateUsrDialog()
if(screen == 10) if(screen == RCS_ANNOUNCE)
var/obj/item/weapon/card/id/ID = O var/obj/item/weapon/card/id/ID = O
if (access_RC_announce in ID.GetAccess()) if (access_RC_announce in ID.GetAccess())
announceAuth = 1 announceAuth = 1
announcement.announcer = ID.assignment ? "[ID.assignment] [ID.registered_name]" : ID.registered_name announcement.announcer = ID.assignment ? "[ID.assignment] [ID.registered_name]" : ID.registered_name
else else
reset_announce() reset_announce()
user << "\red You are not authorized to send announcements." user << "<span class='warning'> You are not authorized to send announcements.</span>"
updateUsrDialog() updateUsrDialog()
if (istype(O, /obj/item/weapon/stamp)) if (istype(O, /obj/item/weapon/stamp))
if(screen == 9) if(screen == RCS_MESSAUTH)
var/obj/item/weapon/stamp/T = O var/obj/item/weapon/stamp/T = O
msgStamped = text("<font color='blue'><b>Stamped with the [T.name]</b></font>") msgStamped = text("<font color='blue'><b>Stamped with the [T.name]</b></font>")
updateUsrDialog() updateUsrDialog()
@@ -417,3 +325,13 @@ var/list/obj/machinery/requests_console/allConsoles = list()
announceAuth = 0 announceAuth = 0
message = "" message = ""
announcement.announcer = "" announcement.announcer = ""
#undef RCS_RQASSIST
#undef RCS_RQSUPPLY
#undef RCS_SENDINFO
#undef RCS_SENTPASS
#undef RCS_SENTFAIL
#undef RCS_VIEWMSGS
#undef RCS_MESSAUTH
#undef RCS_ANNOUNCE
#undef RCS_MAINMENU

View File

@@ -19,30 +19,11 @@
without intervention this attack will succeed in approximately 10 minutes. Required intervention: temporary suspension of affected accounts until the attack has ceased. \ without intervention this attack will succeed in approximately 10 minutes. Required intervention: temporary suspension of affected accounts until the attack has ceased. \
Notifications will be sent as updates occur.<br>" Notifications will be sent as updates occur.<br>"
var/my_department = "[station_name()] firewall subroutines" var/my_department = "[station_name()] firewall subroutines"
var/sending = message + "<font color='blue'><b>Message dispatched by [my_department].</b></font>"
var/pass = 0
for(var/obj/machinery/message_server/MS in world) for(var/obj/machinery/message_server/MS in world)
if(!MS.active) continue if(!MS.active) continue
// /obj/machinery/message_server/proc/send_rc_message(var/recipient = "",var/sender = "",var/message = "",var/stamp = "", var/id_auth = "", var/priority = 1) MS.send_rc_message("Head of Personnel's Desk", my_department, message, "", "", 2)
MS.send_rc_message("Engineering/Security/Bridge", my_department, message, "", "", 2)
pass = 1
if(pass)
var/keyed_dpt1 = ckey("Engineering")
var/keyed_dpt2 = ckey("Security")
var/keyed_dpt3 = ckey("Bridge")
for (var/obj/machinery/requests_console/Console in allConsoles)
var/keyed_department = ckey(Console.department)
if(keyed_department == keyed_dpt1 || keyed_department == keyed_dpt2 || keyed_department == keyed_dpt3)
if(Console.newmessagepriority < 2)
Console.newmessagepriority = 2
Console.icon_state = "req_comp2"
if(!Console.silent)
playsound(Console.loc, 'sound/machines/twobeep.ogg', 50, 1)
for (var/mob/O in hearers(5, Console.loc))
O.show_message(text("\icon[Console] *The Requests Console beeps: 'PRIORITY Alert in [my_department]'"))
Console.messages += "<B><FONT color='red'>High Priority message from [my_department]</FONT></B><BR>[sending]"
/datum/event/money_hacker/tick() /datum/event/money_hacker/tick()
if(world.time >= end_time) if(world.time >= end_time)
@@ -80,27 +61,7 @@
message = "The attack has ceased, the affected accounts can now be brought online." message = "The attack has ceased, the affected accounts can now be brought online."
var/my_department = "[station_name()] firewall subroutines" var/my_department = "[station_name()] firewall subroutines"
var/sending = message + "<font color='blue'><b>Message dispatched by [my_department].</b></font>"
var/pass = 0
for(var/obj/machinery/message_server/MS in world) for(var/obj/machinery/message_server/MS in world)
if(!MS.active) continue if(!MS.active) continue
// /obj/machinery/message_server/proc/send_rc_message(var/recipient = "",var/sender = "",var/message = "",var/stamp = "", var/id_auth = "", var/priority = 1) MS.send_rc_message("Head of Personnel's Desk", my_department, message, "", "", 2)
MS.send_rc_message("Engineering/Security/Bridge", my_department, message, "", "", 2)
pass = 1
if(pass)
var/keyed_dpt1 = ckey("Engineering")
var/keyed_dpt2 = ckey("Security")
var/keyed_dpt3 = ckey("Bridge")
for (var/obj/machinery/requests_console/Console in allConsoles)
var/keyed_department = ckey(Console.department)
if(keyed_department == keyed_dpt1 || keyed_department == keyed_dpt2 || keyed_department == keyed_dpt3)
if(Console.newmessagepriority < 2)
Console.newmessagepriority = 2
Console.icon_state = "req_comp2"
if(!Console.silent)
playsound(Console.loc, 'sound/machines/twobeep.ogg', 50, 1)
for (var/mob/O in hearers(5, Console.loc))
O.show_message(text("\icon[Console] *The Requests Console beeps: 'PRIORITY Alert in [my_department]'"))
Console.messages += "<B><FONT color='red'>High Priority message from [my_department]</FONT></B><BR>[sending]"

View File

@@ -108,6 +108,34 @@ var/global/list/obj/machinery/message_server/message_servers = list()
/obj/machinery/message_server/proc/send_rc_message(var/recipient = "",var/sender = "",var/message = "",var/stamp = "", var/id_auth = "", var/priority = 1) /obj/machinery/message_server/proc/send_rc_message(var/recipient = "",var/sender = "",var/message = "",var/stamp = "", var/id_auth = "", var/priority = 1)
rc_msgs += new/datum/data_rc_msg(recipient,sender,message,stamp,id_auth) rc_msgs += new/datum/data_rc_msg(recipient,sender,message,stamp,id_auth)
var/authmsg = "[message]<br>"
if (id_auth)
authmsg += "[id_auth]<br>"
if (stamp)
authmsg += "[stamp]<br>"
for (var/obj/machinery/requests_console/Console in allConsoles)
if (ckey(Console.department) == ckey(recipient))
if(Console.newmessagepriority < priority)
Console.newmessagepriority = priority
Console.icon_state = "req_comp[priority]"
switch(priority)
if(2)
if(!Console.silent)
playsound(Console.loc, 'sound/machines/twobeep.ogg', 50, 1)
Console.audible_message(text("\icon[Console] *The Requests Console beeps: 'PRIORITY Alert in [sender]'"),,5)
Console.messages += "<B><FONT color='red'>High Priority message from <A href='?src=\ref[Console];write=[ckey(sender)]'>[sender]</A></FONT></B><BR>[authmsg]"
if(3)
if(!Console.silent)
playsound(Console.loc, 'sound/machines/twobeep.ogg', 70, 1)
Console.audible_message(text("\icon[Console] *The Requests Console yells: 'EXTREME PRIORITY alert in [sender]'"),,7)
Console.messages += "<B><FONT color='red'>Extreme Priority message from <A href='?src=\ref[Console];write=[ckey(sender)]'>[sender]</A></FONT></B><BR>[authmsg]"
else
if(!Console.silent)
playsound(Console.loc, 'sound/machines/twobeep.ogg', 50, 1)
Console.audible_message(text("\icon[Console] *The Requests Console beeps: 'Message from [sender]'"),,4)
Console.messages += "<B>Message from <A href='?src=\ref[Console];write=[ckey(sender)]'>[sender]</A></B><BR>[authmsg]"
Console.set_light(2)
/obj/machinery/message_server/attack_hand(user as mob) /obj/machinery/message_server/attack_hand(user as mob)
// user << "\blue There seem to be some parts missing from this server. They should arrive on the station in a few days, give or take a few CentCom delays." // user << "\blue There seem to be some parts missing from this server. They should arrive on the station in a few days, give or take a few CentCom delays."

View File

@@ -6059,7 +6059,7 @@
"cmA" = (/obj/machinery/light{icon_state = "tube1"; dir = 4},/obj/structure/reagent_dispensers/watertank,/turf/simulated/floor,/area/construction) "cmA" = (/obj/machinery/light{icon_state = "tube1"; dir = 4},/obj/structure/reagent_dispensers/watertank,/turf/simulated/floor,/area/construction)
"cmB" = (/obj/machinery/light{dir = 8; icon_state = "tube1"; pixel_y = 0},/obj/machinery/light_switch{pixel_x = -27; pixel_y = 0},/obj/machinery/airlock_sensor/airlock_exterior{id_tag = "eng_al_ext_snsr"; layer = 3.3; master_tag = "engine_room_airlock"; pixel_y = -22; req_access = list(10)},/obj/structure/table/standard,/obj/item/weapon/book/manual/supermatter_engine,/obj/machinery/atmospherics/pipe/manifold/hidden/scrubbers{dir = 8},/turf/simulated/floor,/area/engineering/engine_airlock) "cmB" = (/obj/machinery/light{dir = 8; icon_state = "tube1"; pixel_y = 0},/obj/machinery/light_switch{pixel_x = -27; pixel_y = 0},/obj/machinery/airlock_sensor/airlock_exterior{id_tag = "eng_al_ext_snsr"; layer = 3.3; master_tag = "engine_room_airlock"; pixel_y = -22; req_access = list(10)},/obj/structure/table/standard,/obj/item/weapon/book/manual/supermatter_engine,/obj/machinery/atmospherics/pipe/manifold/hidden/scrubbers{dir = 8},/turf/simulated/floor,/area/engineering/engine_airlock)
"cmC" = (/obj/machinery/atmospherics/pipe/simple/hidden/cyan{dir = 4; icon_state = "intact"; tag = "icon-intact-f (EAST)"},/turf/simulated/floor,/area/engineering/foyer) "cmC" = (/obj/machinery/atmospherics/pipe/simple/hidden/cyan{dir = 4; icon_state = "intact"; tag = "icon-intact-f (EAST)"},/turf/simulated/floor,/area/engineering/foyer)
"cmD" = (/obj/machinery/atmospherics/pipe/simple/hidden/cyan{dir = 4; icon_state = "intact"; tag = "icon-intact-f (EAST)"},/obj/machinery/requests_console{announcementConsole = 0; department = "Engineering"; departmentType = 4; name = "Engineering RC"; pixel_x = 0; pixel_y = -32},/turf/simulated/floor,/area/engineering/foyer) "cmD" = (/obj/machinery/atmospherics/pipe/simple/hidden/cyan{dir = 4; icon_state = "intact"; tag = "icon-intact-f (EAST)"},/obj/machinery/requests_console{announcementConsole = 0; department = "Engineering"; departmentType = 3; name = "Engineering RC"; pixel_x = 0; pixel_y = -32},/turf/simulated/floor,/area/engineering/foyer)
"cmE" = (/obj/machinery/atmospherics/pipe/simple/hidden/cyan{dir = 4; icon_state = "intact"; tag = "icon-intact-f (EAST)"},/obj/machinery/computer/guestpass{pixel_y = -28},/turf/simulated/floor,/area/engineering/foyer) "cmE" = (/obj/machinery/atmospherics/pipe/simple/hidden/cyan{dir = 4; icon_state = "intact"; tag = "icon-intact-f (EAST)"},/obj/machinery/computer/guestpass{pixel_y = -28},/turf/simulated/floor,/area/engineering/foyer)
"cmF" = (/obj/machinery/atmospherics/pipe/simple/hidden/cyan{dir = 9; icon_state = "intact"; tag = "icon-intact-f (NORTHWEST)"},/turf/simulated/floor,/area/engineering/foyer) "cmF" = (/obj/machinery/atmospherics/pipe/simple/hidden/cyan{dir = 9; icon_state = "intact"; tag = "icon-intact-f (NORTHWEST)"},/turf/simulated/floor,/area/engineering/foyer)
"cmG" = (/obj/machinery/atmospherics/pipe/simple/hidden/supply{dir = 4},/obj/machinery/atmospherics/pipe/simple/hidden/yellow,/turf/simulated/floor{icon_state = "hydrofloor"},/area/rnd/xenobiology/xenoflora) "cmG" = (/obj/machinery/atmospherics/pipe/simple/hidden/supply{dir = 4},/obj/machinery/atmospherics/pipe/simple/hidden/yellow,/turf/simulated/floor{icon_state = "hydrofloor"},/area/rnd/xenobiology/xenoflora)
@@ -6127,7 +6127,7 @@
"cnQ" = (/obj/machinery/door/firedoor/border_only{dir = 1; name = "Engineering Firelock"},/obj/machinery/door/airlock/glass_engineering{name = "Engineering Locker Room"; req_one_access = list(11,24)},/obj/structure/cable/green{d1 = 4; d2 = 8; icon_state = "4-8"},/turf/simulated/floor,/area/engineering/locker_room) "cnQ" = (/obj/machinery/door/firedoor/border_only{dir = 1; name = "Engineering Firelock"},/obj/machinery/door/airlock/glass_engineering{name = "Engineering Locker Room"; req_one_access = list(11,24)},/obj/structure/cable/green{d1 = 4; d2 = 8; icon_state = "4-8"},/turf/simulated/floor,/area/engineering/locker_room)
"cnR" = (/turf/simulated/wall/r_wall,/area/engineering/locker_room) "cnR" = (/turf/simulated/wall/r_wall,/area/engineering/locker_room)
"cnS" = (/obj/effect/decal/cleanable/dirt,/obj/structure/cable{d1 = 1; d2 = 2; icon_state = "1-2"},/obj/machinery/atmospherics/pipe/simple/hidden/supply,/obj/machinery/atmospherics/pipe/simple/hidden/scrubbers,/turf/simulated/floor/plating{dir = 4; icon_state = "warnplatecorner"},/area/maintenance/engineering) "cnS" = (/obj/effect/decal/cleanable/dirt,/obj/structure/cable{d1 = 1; d2 = 2; icon_state = "1-2"},/obj/machinery/atmospherics/pipe/simple/hidden/supply,/obj/machinery/atmospherics/pipe/simple/hidden/scrubbers,/turf/simulated/floor/plating{dir = 4; icon_state = "warnplatecorner"},/area/maintenance/engineering)
"cnT" = (/obj/structure/table/standard,/obj/item/device/t_scanner,/obj/item/device/multitool{pixel_x = 5},/obj/item/device/radio/headset/headset_eng,/obj/item/weapon/cartridge/atmos,/obj/item/weapon/cartridge/atmos,/obj/item/device/pipe_painter,/obj/machinery/requests_console{department = "Atmospherics"; departmentType = 4; name = "Atmos RC"; pixel_x = 0; pixel_y = 28},/turf/simulated/floor,/area/engineering/atmos) "cnT" = (/obj/structure/table/standard,/obj/item/device/t_scanner,/obj/item/device/multitool{pixel_x = 5},/obj/item/device/radio/headset/headset_eng,/obj/item/weapon/cartridge/atmos,/obj/item/weapon/cartridge/atmos,/obj/item/device/pipe_painter,/obj/machinery/requests_console{department = "Atmospherics"; departmentType = 3; name = "Atmos RC"; pixel_x = 0; pixel_y = 28},/turf/simulated/floor,/area/engineering/atmos)
"cnU" = (/obj/machinery/disposal,/obj/structure/disposalpipe/trunk,/obj/structure/sign/deathsposal{pixel_x = 32},/obj/effect/decal/cleanable/dirt,/turf/simulated/floor/plating,/area/maintenance/incinerator) "cnU" = (/obj/machinery/disposal,/obj/structure/disposalpipe/trunk,/obj/structure/sign/deathsposal{pixel_x = 32},/obj/effect/decal/cleanable/dirt,/turf/simulated/floor/plating,/area/maintenance/incinerator)
"cnV" = (/obj/structure/table/standard,/obj/item/weapon/storage/box/syringes,/obj/structure/cable/green{d1 = 4; d2 = 8; icon_state = "4-8"},/turf/simulated/floor{icon_state = "white"},/area/rnd/xenobiology) "cnV" = (/obj/structure/table/standard,/obj/item/weapon/storage/box/syringes,/obj/structure/cable/green{d1 = 4; d2 = 8; icon_state = "4-8"},/turf/simulated/floor{icon_state = "white"},/area/rnd/xenobiology)
"cnW" = (/obj/machinery/computer/med_data,/obj/machinery/light,/turf/simulated/floor{icon_state = "white"},/area/medical/surgery) "cnW" = (/obj/machinery/computer/med_data,/obj/machinery/light,/turf/simulated/floor{icon_state = "white"},/area/medical/surgery)
@@ -6711,7 +6711,7 @@
"czc" = (/obj/machinery/light{dir = 1},/turf/simulated/floor{icon_state = "white"},/area/rnd/xenobiology) "czc" = (/obj/machinery/light{dir = 1},/turf/simulated/floor{icon_state = "white"},/area/rnd/xenobiology)
"czd" = (/obj/structure/grille,/obj/structure/window/reinforced{dir = 4},/obj/structure/window/reinforced{dir = 1},/obj/structure/window/reinforced{dir = 8},/obj/machinery/door/firedoor/border_only{dir = 2},/turf/simulated/floor/plating,/area/rnd/xenobiology) "czd" = (/obj/structure/grille,/obj/structure/window/reinforced{dir = 4},/obj/structure/window/reinforced{dir = 1},/obj/structure/window/reinforced{dir = 8},/obj/machinery/door/firedoor/border_only{dir = 2},/turf/simulated/floor/plating,/area/rnd/xenobiology)
"cze" = (/obj/structure/table/standard,/obj/random/tech_supply,/obj/random/tech_supply,/obj/random/tech_supply,/obj/random/tech_supply,/turf/simulated/floor,/area/engineering/locker_room) "cze" = (/obj/structure/table/standard,/obj/random/tech_supply,/obj/random/tech_supply,/obj/random/tech_supply,/obj/random/tech_supply,/turf/simulated/floor,/area/engineering/locker_room)
"czf" = (/obj/machinery/requests_console{announcementConsole = 0; department = "Engineering"; departmentType = 4; name = "Engineering RC"; pixel_x = 0; pixel_y = -32},/turf/simulated/floor,/area/engineering/workshop) "czf" = (/obj/machinery/requests_console{announcementConsole = 0; department = "Engineering"; departmentType = 3; name = "Engineering RC"; pixel_x = 0; pixel_y = -32},/turf/simulated/floor,/area/engineering/workshop)
"czg" = (/obj/structure/closet/emcloset,/obj/effect/decal/cleanable/dirt,/turf/simulated/floor{icon_state = "floorgrime"},/area/maintenance/incinerator) "czg" = (/obj/structure/closet/emcloset,/obj/effect/decal/cleanable/dirt,/turf/simulated/floor{icon_state = "floorgrime"},/area/maintenance/incinerator)
"czh" = (/obj/structure/bed/chair{dir = 8},/obj/machinery/power/apc{dir = 1; name = "north bump"; pixel_x = 0; pixel_y = 24},/obj/structure/cable/green{d2 = 2; icon_state = "0-2"},/turf/simulated/floor/plating,/area/maintenance/engi_shuttle) "czh" = (/obj/structure/bed/chair{dir = 8},/obj/machinery/power/apc{dir = 1; name = "north bump"; pixel_x = 0; pixel_y = 24},/obj/structure/cable/green{d2 = 2; icon_state = "0-2"},/turf/simulated/floor/plating,/area/maintenance/engi_shuttle)
"czi" = (/obj/structure/cable/yellow{d2 = 4; icon_state = "0-4"},/turf/simulated/floor/plating/airless,/area/solar/port) "czi" = (/obj/structure/cable/yellow{d2 = 4; icon_state = "0-4"},/turf/simulated/floor/plating/airless,/area/solar/port)