Skip to content

Commit

Permalink
Merge branch 'project/ares/admin_console' into project/ares/tm_holder
Browse files Browse the repository at this point in the history
  • Loading branch information
realforest2001 committed Mar 4, 2024
2 parents e14b925 + c5d4dc3 commit 0dbb1c5
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 70 deletions.
4 changes: 4 additions & 0 deletions code/game/machinery/ARES/ARES_interface.dm
Original file line number Diff line number Diff line change
Expand Up @@ -357,6 +357,8 @@
// -- Delete Button -- //
if("delete_record")
var/datum/ares_record/record = locate(params["record"])
if(!istype(record))
return FALSE
if(record.record_name == ARES_RECORD_DELETED)
return FALSE
var/datum/ares_record/deletion/new_delete = new
Expand Down Expand Up @@ -410,6 +412,8 @@

if("read_record")
var/datum/ares_record/deleted_talk/conversation = locate(params["record"])
if(!istype(conversation))
return FALSE
deleted_1to1 = conversation.conversation
last_menu = current_menu
current_menu = "read_deleted"
Expand Down
79 changes: 32 additions & 47 deletions code/game/machinery/ARES/ARES_interface_admin.dm
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,19 @@
set name = "Open ARES Interface"
set category = "Admin.Factions"

var/mob/user = usr
if(!check_rights(R_MOD))
to_chat(usr, SPAN_WARNING("You do not have access to this command."))
to_chat(user, SPAN_WARNING("You do not have access to this command."))
return FALSE

if(!SSticker.mode)
to_chat(usr, SPAN_WARNING("The round has not started yet."))
to_chat(user, SPAN_WARNING("The round has not started yet."))
return FALSE

if(!GLOB.ares_link || !GLOB.ares_link.admin_interface || !GLOB.ares_link.interface)
to_chat(usr, SPAN_BOLDWARNING("ERROR: ARES Link or Interface not found!"))
return FALSE
GLOB.ares_link.tgui_interact(mob)
var/mob/user = usr
GLOB.ares_link.tgui_interact(user)
var/log = "[key_name(user)] opened the remote ARES Interface."
if(user.job)
log = "[key_name(user)] ([user.job]) opened the remote ARES Interface."
Expand Down Expand Up @@ -53,8 +53,7 @@
data["is_pda"] = FALSE

data["admin_login"] = "[admin_interface.logged_in], [user.client.admin_holder?.rank]"
data["admin_access_log"] = list()
data["admin_access_log"] += admin_interface.access_list
data["admin_access_log"] = list(admin_interface.access_list)

data["current_menu"] = admin_interface.current_menu
data["last_page"] = admin_interface.last_menu
Expand All @@ -69,13 +68,10 @@
data["evac_status"] = SShijack.evac_status
data["worldtime"] = world.time

data["access_log"] = list()
data["access_log"] += datacore.interface_access_list
data["apollo_log"] = list()
data["apollo_log"] += datacore.apollo_log
data["access_log"] = datacore.interface_access_list
data["apollo_log"] = datacore.apollo_log

data["deleted_conversation"] = list()
data["deleted_conversation"] += admin_interface.deleted_1to1
data["deleted_conversation"] = admin_interface.deleted_1to1

data["distresstime"] = datacore.ares_distress_cooldown
data["distresstimelock"] = DISTRESS_TIME_LOCK
Expand All @@ -84,7 +80,7 @@
data["nuke_available"] = datacore.nuke_available

var/list/logged_announcements = list()
for(var/datum/ares_record/announcement/broadcast as anything in datacore.records_announcement)
for(var/datum/ares_record/announcement/broadcast in datacore.records_announcement)
var/list/current_broadcast = list()
current_broadcast["time"] = broadcast.time
current_broadcast["title"] = broadcast.title
Expand All @@ -94,7 +90,7 @@
data["records_announcement"] = logged_announcements

var/list/logged_alerts = list()
for(var/datum/ares_record/security/security_alert as anything in datacore.records_security)
for(var/datum/ares_record/security/security_alert in datacore.records_security)
var/list/current_alert = list()
current_alert["time"] = security_alert.time
current_alert["title"] = security_alert.title
Expand All @@ -104,7 +100,7 @@
data["records_security"] = logged_alerts

var/list/logged_flights = list()
for(var/datum/ares_record/flight/flight_log as anything in datacore.records_flight)
for(var/datum/ares_record/flight/flight_log in datacore.records_flight)
var/list/current_flight = list()
current_flight["time"] = flight_log.time
current_flight["title"] = flight_log.title
Expand All @@ -115,7 +111,7 @@
data["records_flight"] = logged_flights

var/list/logged_bioscans = list()
for(var/datum/ares_record/bioscan/scan as anything in datacore.records_bioscan)
for(var/datum/ares_record/bioscan/scan in datacore.records_bioscan)
var/list/current_scan = list()
current_scan["time"] = scan.time
current_scan["title"] = scan.title
Expand All @@ -125,7 +121,7 @@
data["records_bioscan"] = logged_bioscans

var/list/logged_bombs = list()
for(var/datum/ares_record/bombardment/bomb as anything in datacore.records_bombardment)
for(var/datum/ares_record/bombardment/bomb in datacore.records_bombardment)
var/list/current_bomb = list()
current_bomb["time"] = bomb.time
current_bomb["title"] = bomb.title
Expand All @@ -136,9 +132,7 @@
data["records_bombardment"] = logged_bombs

var/list/logged_deletes = list()
for(var/datum/ares_record/deletion/deleted as anything in datacore.records_deletion)
if(!istype(deleted))
continue
for(var/datum/ares_record/deletion/deleted in datacore.records_deletion)
var/list/current_delete = list()
current_delete["time"] = deleted.time
current_delete["title"] = deleted.title
Expand All @@ -149,9 +143,7 @@
data["records_deletion"] = logged_deletes

var/list/logged_discussions = list()
for(var/datum/ares_record/deleted_talk/deleted_convo as anything in datacore.records_deletion)
if(!istype(deleted_convo))
continue
for(var/datum/ares_record/deleted_talk/deleted_convo in datacore.records_deletion)
var/list/deleted_disc = list()
deleted_disc["time"] = deleted_convo.time
deleted_disc["title"] = deleted_convo.title
Expand All @@ -160,9 +152,7 @@
data["deleted_discussions"] = logged_discussions

var/list/logged_orders = list()
for(var/datum/ares_record/requisition_log/req_order as anything in datacore.records_asrs)
if(!istype(req_order))
continue
for(var/datum/ares_record/requisition_log/req_order in datacore.records_asrs)
var/list/current_order = list()
current_order["time"] = req_order.time
current_order["details"] = req_order.details
Expand All @@ -175,9 +165,7 @@
var/list/logged_convos = list()
var/list/active_convo = list()
var/active_ref
for(var/datum/ares_record/talk_log/log as anything in datacore.records_talking)
if(!istype(log))
continue
for(var/datum/ares_record/talk_log/log in datacore.records_talking)
if(log.user == interface.last_login)
active_convo = log.conversation
active_ref = "\ref[log]"
Expand All @@ -193,9 +181,7 @@
data["conversations"] = logged_convos

var/list/logged_maintenance = list()
for(var/datum/ares_ticket/maintenance/maint_ticket as anything in tickets_maintenance)
if(!istype(maint_ticket))
continue
for(var/datum/ares_ticket/maintenance/maint_ticket in tickets_maintenance)
var/lock_status = TICKET_OPEN
switch(maint_ticket.ticket_status)
if(TICKET_REJECTED, TICKET_CANCELLED, TICKET_COMPLETED)
Expand All @@ -216,7 +202,7 @@
data["maintenance_tickets"] = logged_maintenance

var/list/logged_access = list()
for(var/datum/ares_ticket/access/access_ticket as anything in tickets_access)
for(var/datum/ares_ticket/access/access_ticket in tickets_access)
var/lock_status = TICKET_OPEN
switch(access_ticket.ticket_status)
if(TICKET_REJECTED, TICKET_CANCELLED, TICKET_REVOKED)
Expand Down Expand Up @@ -255,23 +241,22 @@
. = ..()
if(.)
return
var/mob/user = usr

var/mob/user = ui.user
if(!check_rights_for(user.client, R_MOD))
to_chat(user, SPAN_WARNING("You require staff identification to access this terminal!"))
return FALSE
switch (action)
if("go_back")
if(!admin_interface.last_menu)
return to_chat(user, SPAN_WARNING("Error, no previous page detected."))
to_chat(user, SPAN_WARNING("Error, no previous page detected."))
return FALSE
var/temp_holder = admin_interface.current_menu
admin_interface.current_menu = admin_interface.last_menu
admin_interface.last_menu = temp_holder

if("login")
if(check_rights_for(user.client, R_MOD))
admin_interface.logged_in = user.client.ckey
admin_interface.access_list += "[user.client.ckey] at [worldtime2text()], Access Level '[user.client.admin_holder?.rank]'."
else
to_chat(user, SPAN_WARNING("You require staff identification to access this terminal!"))
return FALSE
admin_interface.logged_in = user.client.ckey
admin_interface.access_list += "[user.client.ckey] at [worldtime2text()], Access Level '[user.client.admin_holder?.rank]'."
admin_interface.current_menu = "main"

// -- Page Changers -- //
Expand Down Expand Up @@ -357,13 +342,17 @@
if(message)
interface.response_from_ares(message, params["active_convo"])
var/datum/ares_record/talk_log/conversation = locate(params["active_convo"])
if(!istype(conversation))
return FALSE
var/admin_log = SPAN_STAFF_IC("<b>ADMINS/MODS: [SPAN_RED("[key_name(user)] replied to [conversation.user]'s ARES message")] [SPAN_GREEN("via Remote Interface")] with: [SPAN_BLUE(message)] </b>")
for(var/client/admin in GLOB.admins)
if((R_ADMIN|R_MOD) & admin.admin_holder.rights)
to_chat(admin, admin_log)

if("read_record")
var/datum/ares_record/deleted_talk/conversation = locate(params["record"])
if(!istype(conversation))
return FALSE
admin_interface.deleted_1to1 = conversation.conversation
admin_interface.last_menu = admin_interface.current_menu
admin_interface.current_menu = "read_deleted"
Expand Down Expand Up @@ -393,20 +382,16 @@

if("auth_access")
var/datum/ares_ticket/access/access_ticket = locate(params["ticket"])
if(!access_ticket)
if(!istype(access_ticket))
return FALSE
for(var/obj/item/card/id/identification in waiting_ids)
if(!istype(identification))
continue
if(identification.registered_gid != access_ticket.user_id_num)
continue
identification.handle_ares_access(MAIN_AI_SYSTEM, user)
access_ticket.ticket_status = TICKET_GRANTED
ares_apollo_talk("Access Ticket [access_ticket.ticket_id]: [access_ticket.ticket_submitter] granted core access.")
return TRUE
for(var/obj/item/card/id/identification in active_ids)
if(!istype(identification))
continue
if(identification.registered_gid != access_ticket.user_id_num)
continue
identification.handle_ares_access(MAIN_AI_SYSTEM, user)
Expand Down
30 changes: 17 additions & 13 deletions code/game/machinery/ARES/ARES_procs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -223,35 +223,37 @@ GLOBAL_LIST_INIT(maintenance_categories, list(

/obj/structure/machinery/computer/proc/ares_auth_to_text(access_level)
switch(access_level)
if(ARES_ACCESS_LOGOUT)//0
if(ARES_ACCESS_LOGOUT)
return "Logged Out"
if(ARES_ACCESS_BASIC)//1
if(ARES_ACCESS_BASIC)
return "Authorized"
if(ARES_ACCESS_COMMAND)//2
if(ARES_ACCESS_COMMAND)
return "[MAIN_SHIP_NAME] Command"
if(ARES_ACCESS_JOE)//3
if(ARES_ACCESS_JOE)
return "Working Joe"
if(ARES_ACCESS_CORPORATE)//4
if(ARES_ACCESS_CORPORATE)
return "Weyland-Yutani"
if(ARES_ACCESS_SENIOR)//5
if(ARES_ACCESS_SENIOR)
return "[MAIN_SHIP_NAME] Senior Command"
if(ARES_ACCESS_CE)//6
if(ARES_ACCESS_CE)
return "Chief Engineer"
if(ARES_ACCESS_SYNTH)//7
if(ARES_ACCESS_SYNTH)
return "USCM Synthetic"
if(ARES_ACCESS_CO)//8
if(ARES_ACCESS_CO)
return "[MAIN_SHIP_NAME] Commanding Officer"
if(ARES_ACCESS_HIGH)//9
if(ARES_ACCESS_HIGH)
return "USCM High Command"
if(ARES_ACCESS_WY_COMMAND)//10
if(ARES_ACCESS_WY_COMMAND)
return "Weyland-Yutani Directorate"
if(ARES_ACCESS_DEBUG)//11
if(ARES_ACCESS_DEBUG)
return "AI Service Technician"


/obj/structure/machinery/computer/ares_console/proc/message_ares(text, mob/Sender, ref, fake = FALSE)
var/msg = SPAN_STAFF_IC("<b><font color=orange>ARES:</font> [key_name(Sender, 1)] [ARES_MARK(Sender)] [ADMIN_PP(Sender)] [ADMIN_VV(Sender)] [ADMIN_SM(Sender)] [ADMIN_JMP_USER(Sender)] [ARES_REPLY(Sender, ref)]:</b> [text]")
var/datum/ares_record/talk_log/conversation = locate(ref)
if(!istype(conversation))
return
var/msg = SPAN_STAFF_IC("<b><font color=orange>ARES:</font> [key_name(Sender, 1)] [ARES_MARK(Sender)] [ADMIN_PP(Sender)] [ADMIN_VV(Sender)] [ADMIN_SM(Sender)] [ADMIN_JMP_USER(Sender)] [ARES_REPLY(Sender, ref)]:</b> [text]")
conversation.conversation += "[last_login] at [worldtime2text()], '[text]'"
if(fake)
log_say("[key_name(Sender)] faked the message '[text]' from [last_login] in ARES 1:1.")
Expand All @@ -271,6 +273,8 @@ GLOBAL_LIST_INIT(maintenance_categories, list(

/obj/structure/machinery/computer/ares_console/proc/response_from_ares(text, ref)
var/datum/ares_record/talk_log/conversation = locate(ref)
if(!istype(conversation))
return
conversation.conversation += "[MAIN_AI_SYSTEM] at [worldtime2text()], '[text]'"
// ------ End ARES Interface Procs ------ //

Expand Down
11 changes: 1 addition & 10 deletions code/game/machinery/ARES/ARES_records.dm
Original file line number Diff line number Diff line change
Expand Up @@ -45,16 +45,7 @@

/datum/ares_record/flight/New(details, user)
time = worldtime2text()
src.title = "Flight Log"
src.details = details
src.user = user

/datum/ares_record/flight
record_name = ARES_RECORD_FLIGHT

/datum/ares_record/flight/New(details, user)
time = worldtime2text()
src.title = "Flight Log"
title = "Flight Log"
src.details = details
src.user = user

Expand Down

0 comments on commit 0dbb1c5

Please sign in to comment.