mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-08-23 13:05:44 +01:00
pAIs, Computers and ntIRC (#8757)
#8005 just revived. Tasks to acomplish while here: Fix merge conflicts Add ntIRC direct messaging Things I migth consider adding in future PR: Porting IRC to VueUI Porting File Manager to VueUI.
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
/datum/computer_file/program
|
||||
filetype = "PRG"
|
||||
filename = "UnknownProgram" // File name. FILE NAME MUST BE UNIQUE IF YOU WANT THE PROGRAM TO BE DOWNLOADABLE FROM NTNET!
|
||||
var/program_type = PROGRAM_NORMAL // Program type, used to determine if program runs in background or not.
|
||||
var/required_access_run // List of required accesses to run the program.
|
||||
var/required_access_download // List of required accesses to download the program.
|
||||
var/requires_access_to_run = PROGRAM_ACCESS_ONE // Whether the program checks for required_access when run. (1 = requires single access, 2 = requires single access from list, 3 = requires all access from list)
|
||||
@@ -22,7 +23,8 @@
|
||||
var/available_on_syndinet = FALSE // Whether the program can be downloaded from SyndiNet (accessible via emagging the computer). Set to 1 to enable.
|
||||
var/computer_emagged = FALSE // Set to TRUE if computer that's running us was emagged. Computer updates this every Process() tick
|
||||
var/ui_header // Example: "something.gif" - a header image that will be rendered in computer's UI when this program is running at background. Images are taken from /nano/images/status_icons. Be careful not to use too large images!
|
||||
var/color = "#FFFFFF" // The color of light the computer should emit when this program is open.
|
||||
var/color = "#FFFFFF" // The color of light the computer should emit when this program is open.
|
||||
var/service_state = PROGRAM_STATE_KILLED // PROGRAM_STATE_KILLED or PROGRAM_STATE_ACTIVE - specifies whether this program's service is running.
|
||||
|
||||
/datum/computer_file/program/New(var/obj/item/modular_computer/comp)
|
||||
..()
|
||||
@@ -30,6 +32,8 @@
|
||||
computer = comp
|
||||
|
||||
/datum/computer_file/program/Destroy()
|
||||
computer.idle_threads -= src
|
||||
computer.enabled_services -= src
|
||||
computer = null
|
||||
. = ..()
|
||||
|
||||
@@ -135,6 +139,10 @@
|
||||
if(!check_type)
|
||||
check_type = requires_access_to_download
|
||||
|
||||
if(istype(computer, /obj/item/modular_computer/silicon/pai))
|
||||
check_type = requires_access_to_run
|
||||
access_to_check = required_access_run
|
||||
|
||||
// No required_access, allow it.
|
||||
if(!access_to_check || !requires_access_to_download)
|
||||
return TRUE
|
||||
@@ -213,7 +221,6 @@
|
||||
|
||||
// CONVENTIONS, READ THIS WHEN CREATING NEW PROGRAM AND OVERRIDING THIS PROC:
|
||||
// Topic calls are automagically forwarded from NanoModule this program contains.
|
||||
// Calls beginning with "PRG_" are reserved for programs handling.
|
||||
// Calls beginning with "PC_" are reserved for computer handling (by whatever runs the program)
|
||||
// ALWAYS INCLUDE PARENT CALL ..() OR DIE IN FIRE.
|
||||
/datum/computer_file/program/Topic(href, href_list)
|
||||
@@ -228,3 +235,12 @@
|
||||
return NM.check_eye(user)
|
||||
else
|
||||
return -1
|
||||
|
||||
// Is called when program service is being activated
|
||||
// Returns 1 if service startup was sucessfull
|
||||
/datum/computer_file/program/proc/service_activate()
|
||||
return 0
|
||||
|
||||
// Is called when program service is being deactivated
|
||||
/datum/computer_file/program/proc/service_deactivate()
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user