Ports some modular computer stuff from baystation

This commit is contained in:
Casey
2022-06-30 23:58:24 -04:00
committed by CHOMPStation2
parent a34b97046c
commit e1edec79c8
51 changed files with 460 additions and 111 deletions

View File

@@ -10,21 +10,30 @@ var/global/datum/ntnet/ntnet_global = new()
var/list/available_news = list()
var/list/chat_channels = list()
var/list/fileservers = list()
var/list/email_accounts = list() // I guess we won't have more than 999 email accounts active at once in single round, so this will do until Servers are implemented someday.
/// Holds all the email accounts that exists. Hopefully won't exceed 999
var/list/email_accounts = list()
var/list/banned_nids = list()
// Amount of logs the system tries to keep in memory. Keep below 999 to prevent byond from acting weirdly.
// High values make displaying logs much laggier.
/// A list of nid - os datum pairs. An OS in this list is not necessarily connected to NTNet or visible on it.
var/list/registered_nids = list()
/// Amount of log entries the system tries to keep in memory. Keep below 999 to prevent byond from acting weirdly. High values make displaying logs much laggier.
var/setting_maxlogcount = 100
// These only affect wireless. LAN (consoles) are unaffected since it would be possible to create scenario where someone turns off NTNet, and is unable to turn it back on since it refuses connections
var/setting_softwaredownload = 1
var/setting_peertopeer = 1
var/setting_communication = 1
var/setting_systemcontrol = 1
var/setting_disabled = 0 // Setting to 1 will disable all wireless, independently on relays status.
/// Programs requiring NTNET_SOFTWAREDOWNLOAD won't work if this is set to FALSE and public-facing device they are connecting with is wireless.
var/setting_softwaredownload = TRUE
/// Programs requiring NTNET_PEERTOPEER won't work if this is set to FALSE and public-facing device they are connecting with is wireless.
var/setting_peertopeer = TRUE
/// Programs requiring NTNET_COMMUNICATION won't work if this is set to FALSE and public-facing device they are connecting with is wireless.
var/setting_communication = TRUE
/// Programs requiring NTNET_SYSTEMCONTROL won't work if this is set to FALSE and public-facing device they are connecting with is wireless.
var/setting_systemcontrol = TRUE
var/intrusion_detection_enabled = 1 // Whether the IDS warning system is enabled
var/intrusion_detection_alarm = 0 // Set when there is an IDS warning due to malicious (antag) software.
/// Setting to TRUE will disable all wireless connections, independently off relays status.
var/setting_disabled = FALSE
/// Whether the IDS warning system is enabled
var/intrusion_detection_enabled = TRUE
/// Set when there is an IDS warning due to malicious (antag) software.
var/intrusion_detection_alarm = FALSE
// If new NTNet datum is spawned, it replaces the old one.
@@ -62,7 +71,13 @@ var/global/datum/ntnet/ntnet_global = new()
else
break
/datum/ntnet/proc/check_banned(var/NID)
/datum/ntnet/proc/get_os_by_nid(NID)
return registered_nids["[NID]"]
/datum/ntnet/proc/unregister(NID)
registered_nids -= "[NID]"
/datum/ntnet/proc/check_banned(NID)
if(!relays || !relays.len)
return FALSE
@@ -138,10 +153,12 @@ var/global/datum/ntnet/ntnet_global = new()
// Resets the IDS alarm
/datum/ntnet/proc/resetIDS()
intrusion_detection_alarm = 0
add_log("-!- INTRUSION DETECTION ALARM RESET BY SYSTEM OPERATOR -!-")
/datum/ntnet/proc/toggleIDS()
resetIDS()
intrusion_detection_enabled = !intrusion_detection_enabled
add_log("Configuration Updated. Intrusion Detection [intrusion_detection_enabled ? "enabled" : "disabled"].")
// Removes all logs
/datum/ntnet/proc/purge_logs()
@@ -185,4 +202,3 @@ var/global/datum/ntnet/ntnet_global = new()
for(var/datum/ntnet_conversation/chan in chat_channels)
if(chan.id == id)
return chan

View File

@@ -1,12 +1,22 @@
/datum/computer_file/data/email_account/
var/list/inbox = list()
var/list/outbox = list()
var/list/spam = list()
var/list/deleted = list()
var/login = ""
var/password = ""
var/can_login = TRUE // Whether you can log in with this account. Set to false for system accounts
var/suspended = FALSE // Whether the account is banned by the SA.
/// Whether you can log in with this account. Set to FALSE for system accounts.
var/can_login = TRUE
/// Whether the account is banned by the SA.
var/suspended = FALSE
var/connected_clients = list()
var/fullname = "N/A"
var/assignment = "N/A"
var/notification_mute = FALSE
var/notification_sound = "*beep*"
/datum/computer_file/data/email_account/calculate_size()
size = 1
@@ -64,7 +74,28 @@
can_login = FALSE
/datum/computer_file/data/email_account/service/broadcaster/
login = "broadcast@internal-services.nt"
login = EMAIL_BROADCAST
/datum/computer_file/data/email_account/service/broadcaster/receive_mail(var/datum/computer_file/data/email_message/received_message, var/relayed)
if(suspended || !istype(received_message) || relayed)
return FALSE
// Possibly exploitable for user spamming so keep admins informed.
if(!received_message.spam)
log_and_message_admins("Broadcast email address used by [usr]. Message title: [received_message.title].")
spawn(0)
for(var/datum/computer_file/data/email_account/email_account in ntnet_global.email_accounts)
var/datum/computer_file/data/email_message/new_message = received_message.clone()
send_mail(email_account.login, new_message, 1)
sleep(2)
return TRUE
/datum/computer_file/data/email_account/service/document
login = EMAIL_DOCUMENTS
/datum/computer_file/data/email_account/service/sysadmin
login = EMAIL_SYSADMIN
/datum/computer_file/data/email_account/service/broadcaster/receive_mail(var/datum/computer_file/data/email_message/received_message, var/relayed)
if(!istype(received_message) || relayed)
@@ -79,4 +110,4 @@
send_mail(email_account.login, new_message, 1)
sleep(2)
return 1
return 1

View File

@@ -53,4 +53,12 @@
var/obj/item/weapon/computer_hardware/nano_printer/nano_printer // Nano Printer component of this computer, for your everyday paperwork needs.
var/obj/item/weapon/computer_hardware/hard_drive/portable/portable_drive // Portable data storage
var/obj/item/weapon/computer_hardware/ai_slot/ai_slot // AI slot, an intellicard housing that allows modifications of AIs.
var/obj/item/weapon/computer_hardware/tesla_link/tesla_link // Tesla Link, Allows remote charging from nearest APC.
var/obj/item/weapon/computer_hardware/tesla_link/tesla_link // Tesla Link, Allows remote charging from nearest APC.
var/modifiable = TRUE // can't be modified or damaged if false
var/stores_pen = FALSE
var/obj/item/weapon/pen/stored_pen
var/interact_sounds
var/interact_sound_volume = 40

View File

@@ -1,18 +1,35 @@
var/global/file_uid = 0
/datum/computer_file/
var/filename = "NewFile" // Placeholder. No spacebars
var/filetype = "XXX" // File full names are [filename].[filetype] so like NewFile.XXX in this case
var/size = 1 // File size in GQ. Integers only!
var/obj/item/weapon/computer_hardware/hard_drive/holder // Holder that contains this file.
var/unsendable = 0 // Whether the file may be sent to someone via NTNet transfer or other means.
var/undeletable = 0 // Whether the file may be deleted. Setting to 1 prevents deletion/renaming/etc.
var/uid // UID of this file
/// Placeholder. Whitespace and most special characters are not allowed.
var/filename = "NewFile"
/// File full names are [filename].[filetype] so like NewFile.XXX in this case
var/filetype = "XXX"
/// File size in GQ. Integers only!
var/size = 1
/// Holder that contains this file.
var/obj/item/weapon/computer_hardware/hard_drive/holder
//// Whether the file may be sent to someone via NTNet transfer, email or other means.
var/unsendable = FALSE
/// Whether the file may be deleted. Setting to TRUE prevents deletion/renaming/etc.
var/undeletable = FALSE
/// Whether the file is hidden from view in the OS
var/hidden = FALSE
/// Protects files that should never be edited by the user due to special properties.
var/read_only = FALSE
/// UID of this file
var/uid
/// Any metadata the file uses.
var/list/metadata
/// Paper type to use for printing
var/papertype = /obj/item/weapon/paper
/datum/computer_file/New()
/datum/computer_file/New(list/md = null)
..()
uid = file_uid
file_uid++
if(islist(md))
metadata = md.Copy()
/datum/computer_file/Destroy()
if(!holder)
@@ -30,10 +47,13 @@ var/global/file_uid = 0
var/datum/computer_file/temp = new type
temp.unsendable = unsendable
temp.undeletable = undeletable
temp.hidden = hidden
temp.size = size
if(metadata)
temp.metadata = metadata.Copy()
if(rename)
temp.filename = filename + "(Copy)"
else
temp.filename = filename
temp.filetype = filetype
return temp
return temp

View File

@@ -1,10 +1,11 @@
// /data/ files store data in string format.
// They don't contain other logic for now.
/datum/computer_file/data
var/stored_data = "" // Stored data in string format.
filetype = "DAT"
var/stored_data = "" // Stored data in string format.
var/block_size = 250
var/do_not_edit = 0 // Whether the user will be reminded that the file probably shouldn't be edited.
var/do_not_edit = FALSE // Whether the user will be reminded that the file probably shouldn't be edited.
/datum/computer_file/data/clone()
var/datum/computer_file/data/temp = ..()
@@ -15,5 +16,43 @@
/datum/computer_file/data/proc/calculate_size()
size = max(1, round(length(stored_data) / block_size))
/datum/computer_file/data/proc/generate_file_data(mob/user)
return digitalPencode2html(stored_data)
/datum/computer_file/data/logfile
filetype = "LOG"
/datum/computer_file/data/text
filetype = "TXT"
/// Mapping tool - creates a named modular computer file in a computer's storage on late initialize.
/// Use this to do things like automatic records and blackboxes. Alternative for paper records.
/// Values can be in the editor for each map or as a subtype.
/// This is an obj because raw atoms can't be placed in DM or third-party mapping tools.
///obj/effect/computer_file_creator
// name = "computer file creator"
// desc = "This is a mapping tool used for installing text files onto a modular device when it's mapped on top of them. If you see it, it's bugged."
// icon = 'icons/effects/landmarks.dmi'
// icon_state = "x3"
// anchored = TRUE
// unacidable = TRUE
// simulated = FALSE
// invisibility = 101
// /// The name that the file will have once it's created.
// var/file_name = "helloworld"
// /// The contents of this file. Uses paper formatting.
// var/file_info = "Hello World!"
///obj/effect/computer_file_creator/Initialize()
// . = ..()
// return INITIALIZE_HINT_LATELOAD
///obj/effect/computer_file_creator/LateInitialize()
// var/turf/T = get_turf(src)
// for (var/obj/O in T)
// if (!istype(O, /obj/machinery/computer/modular) && !istype(O, /obj/item/modular_computer))
// continue
// var/datum/extension/interactive/ntos/os = get_extension(O, /datum/extension/interactive/ntos)
// if (os)
// os.create_data_file(file_name, file_info, /datum/computer_file/data/text)
// qdel(src)

View File

@@ -1,30 +1,39 @@
// /program/ files are executable programs that do things.
/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!
filetype = "PRG"
var/required_access = null // List of required accesses to run/download the program.
var/requires_access_to_run = 1 // Whether the program checks for required_access when run.
var/requires_access_to_download = 1 // Whether the program checks for required_access when downloading.
// TGUIModule
var/datum/tgui_module/TM = null // If the program uses TGUIModule, put it here and it will be automagically opened. Otherwise implement tgui_interact.
var/tguimodule_path = null // Path to tguimodule, make sure to set this if implementing new program.
// Etc Program stuff
var/program_state = PROGRAM_STATE_KILLED// PROGRAM_STATE_KILLED or PROGRAM_STATE_BACKGROUND or PROGRAM_STATE_ACTIVE - specifies whether this program is running.
var/obj/item/modular_computer/computer // Device that runs this program.
var/filedesc = "Unknown Program" // User-friendly name of this program.
var/extended_desc = "N/A" // Short description of this program's function.
/// Category that this program belongs to.
var/category = PROG_MISC
var/usage_flags = PROGRAM_ALL // Bitflags (PROGRAM_CONSOLE, PROGRAM_LAPTOP, PROGRAM_TABLET combination) or PROGRAM_ALL
var/program_icon_state = null // Program-specific screen icon state
var/program_key_state = "standby_key" // Program-specific keyboard icon state
var/program_menu_icon = "newwin" // Icon to use for program's link in main menu
var/ui_header = null // 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/requires_ntnet = 0 // Set to 1 for program to require nonstop NTNet connection to run. If NTNet connection is lost program crashes.
var/requires_ntnet_feature = 0 // Optional, if above is set to 1 checks for specific function of NTNet (currently NTNET_SOFTWAREDOWNLOAD, NTNET_PEERTOPEER, NTNET_SYSTEMCONTROL and NTNET_COMMUNICATION)
var/ntnet_status = 1 // NTNet status, updated every tick by computer running this program. Don't use this for checks if NTNet works, computers do that. Use this for calculations, etc.
var/usage_flags = PROGRAM_ALL // Bitflags (PROGRAM_CONSOLE, PROGRAM_LAPTOP, PROGRAM_TABLET combination) or PROGRAM_ALL
var/network_destination = null // Optional string that describes what NTNet server/system this program connects to. Used in default logging.
var/ntnet_status = 1 // NTNet status, updated every tick by computer running this program. Don't use this for checks if NTNet works, computers do that. Use this for calculations, etc.
var/available_on_ntnet = 1 // Whether the program can be downloaded from NTNet. Set to 0 to disable.
var/available_on_syndinet = 0 // Whether the program can be downloaded from SyndiNet (accessible via emagging the computer). Set to 1 to enable.
// Misc
var/computer_emagged = 0 // Set to 1 if computer that's running us was emagged. Computer updates this every Process() tick
var/ui_header = null // 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/ntnet_speed = 0 // GQ/s - current network connectivity transfer rate
/// Name of the tgui interface
var/tgui_id
@@ -230,4 +239,4 @@
/datum/computer_file/program/proc/relaymove(var/mob/M, direction)
if(TM)
return TM.relaymove(M, direction)
return TM.relaymove(M, direction)

View File

@@ -7,8 +7,8 @@
program_menu_icon = "zoomin"
extended_desc = "This very advanced piece of software uses adaptive programming and large database of cipherkeys to bypass most encryptions used on camera networks. Be warned that system administrator may notice this."
size = 73 // Very large, a price for bypassing ID checks completely.
available_on_ntnet = 0
available_on_syndinet = 1
available_on_ntnet = FALSE
available_on_syndinet = TRUE
/datum/computer_file/program/camera_monitor/hacked/process_tick()
..()

View File

@@ -7,5 +7,6 @@
program_menu_icon = "key"
extended_desc = "Program for programming crew ID cards."
required_access = access_change_ids
requires_ntnet = 0
requires_ntnet = FALSE
size = 8
category = PROG_COMMAND

View File

@@ -12,10 +12,11 @@
tguimodule_path = /datum/tgui_module/communications/ntos
extended_desc = "Used to command and control. Can relay long-range communications. This program can not be run on tablet computers."
required_access = access_heads
requires_ntnet = 1
requires_ntnet = TRUE
size = 12
usage_flags = PROGRAM_CONSOLE | PROGRAM_LAPTOP
network_destination = "long-range communication array"
category = PROG_COMMAND
var/datum/comm_message_listener/message_core = new
/datum/computer_file/program/comm/clone()

View File

@@ -8,9 +8,10 @@
program_menu_icon = "alert"
extended_desc = "This program provides visual interface for the engineering alarm system."
required_access = access_engine
requires_ntnet = 1
requires_ntnet = TRUE
network_destination = "alarm monitoring network"
size = 5
category = PROG_MONITOR
var/has_alert = 0
/datum/computer_file/program/alarm_monitor/process_tick()

View File

@@ -7,8 +7,9 @@
program_menu_icon = "shuffle"
extended_desc = "This program allows remote control of air alarms. This program can not be run on tablet computers."
required_access = access_atmospherics
requires_ntnet = 1
requires_ntnet = TRUE
network_destination = "atmospheric control system"
requires_ntnet_feature = NTNET_SYSTEMCONTROL
usage_flags = PROGRAM_LAPTOP | PROGRAM_CONSOLE
category = PROG_ENG
size = 17

View File

@@ -8,9 +8,10 @@
extended_desc = "This program connects to sensors to provide information about electrical systems"
ui_header = "power_norm.gif"
required_access = access_engine
requires_ntnet = 1
requires_ntnet = TRUE
network_destination = "power monitoring system"
size = 9
category = PROG_ENG
var/has_alert = 0
/datum/computer_file/program/power_monitor/process_tick()

View File

@@ -7,8 +7,9 @@
program_menu_icon = "power"
extended_desc = "This program allows remote control of power distribution systems. This program can not be run on tablet computers."
required_access = access_engine
requires_ntnet = 1
requires_ntnet = TRUE
network_destination = "RCON remote control system"
requires_ntnet_feature = NTNET_SYSTEMCONTROL
usage_flags = PROGRAM_LAPTOP | PROGRAM_CONSOLE
size = 19
category = PROG_ENG

View File

@@ -7,7 +7,8 @@
program_menu_icon = "wrench"
extended_desc = "This program allows for remote monitoring and control of emergency shutoff valves."
required_access = access_engine
requires_ntnet = 1
requires_ntnet = TRUE
network_destination = "shutoff valve control computer"
size = 5
category = PROG_ENG
var/has_alert = 0

View File

@@ -8,9 +8,10 @@
extended_desc = "This program connects to specially calibrated supermatter sensors to provide information on the status of supermatter-based engines."
ui_header = "smmon_0.gif"
required_access = access_engine
requires_ntnet = 1
requires_ntnet = TRUE
network_destination = "supermatter monitoring system"
size = 5
category = PROG_ENG
var/last_status = 0
/datum/computer_file/program/supermatter_monitor/process_tick()

View File

@@ -40,6 +40,7 @@
size = 12
available_on_ntnet = 1
requires_ntnet = 1
category = PROG_MONITOR
// ERT Variant of the program
/datum/computer_file/program/camera_monitor/ert

View File

@@ -12,6 +12,8 @@
unsendable = 1
undeletable = 1
size = 4
available_on_ntnet = 0
requires_ntnet = 0
available_on_ntnet = FALSE
requires_ntnet = FALSE
tguimodule_path = /datum/tgui_module/computer_configurator
usage_flags = PROGRAM_ALL
category = PROG_UTIL

View File

@@ -6,10 +6,12 @@
program_key_state = "generic_key"
program_menu_icon = "mail-closed"
size = 7
requires_ntnet = 1
available_on_ntnet = 1
requires_ntnet = TRUE
available_on_ntnet = TRUE
var/stored_login = ""
var/stored_password = ""
usage_flags = PROGRAM_ALL
category = PROG_OFFICE
tguimodule_path = /datum/tgui_module/email_client

View File

@@ -13,6 +13,8 @@
var/open_file
var/error
usage_flags = PROGRAM_ALL
category = PROG_UTIL
/datum/computer_file/program/filemanager/tgui_act(action, list/params, datum/tgui/ui)
if(..())

View File

@@ -26,6 +26,8 @@
///Determines which boss image to use on the UI.
var/boss_id = 1
usage_flags = PROGRAM_ALL
// This is the primary game loop, which handles the logic of being defeated or winning.
/datum/computer_file/program/game/proc/game_check(mob/user)
sleep(5)

View File

@@ -8,7 +8,7 @@
size = 4
requires_ntnet = TRUE
available_on_ntnet = TRUE
usage_flags = PROGRAM_ALL
tgui_id = "NtosNewsBrowser"
var/datum/computer_file/data/news_article/loaded_article
@@ -118,4 +118,3 @@
if("PRG_toggle_archived")
. = TRUE
show_archived = !show_archived

View File

@@ -16,12 +16,19 @@
var/datum/computer_file/program/downloaded_file = null
var/hacked_download = 0
var/download_completion = 0 //GQ of downloaded data.
///GQ of downloaded data.
var/download_completion = 0
var/download_netspeed = 0
var/downloaderror = ""
var/obj/item/modular_computer/my_computer = null
var/list/downloads_queue[0]
var/file_info
var/server
usage_flags = PROGRAM_ALL
category = PROG_UTIL
var/obj/item/modular_computer/my_computer = null
/datum/computer_file/program/ntnetdownload/kill_program()
..()
abort_file_download()

View File

@@ -12,12 +12,16 @@
ui_header = "ntnrc_idle.gif"
available_on_ntnet = 1
tgui_id = "NtosNetChat"
var/last_message // Used to generate the toolbar icon
/// Used to generate the toolbar icon
var/last_message
var/username
var/active_channel
var/list/channel_history = list()
var/operator_mode = FALSE // Channel operator mode
var/netadmin_mode = FALSE // Administrator mode (invisible to other users + bypasses passwords)
/// Channel operator mode
var/operator_mode = FALSE
/// Administrator mode (invisible to other users + bypasses passwords)
var/netadmin_mode = FALSE
usage_flags = PROGRAM_ALL
/datum/computer_file/program/chatclient/New()
username = "DefaultUser[rand(100, 999)]"
@@ -169,7 +173,7 @@
var/list/data = list()
data["can_admin"] = can_run(user, FALSE, access_network)
return data
/datum/computer_file/program/chatclient/tgui_data(mob/user)
if(!ntnet_global || !ntnet_global.chat_channels)
return list()
@@ -223,4 +227,4 @@
data["authed"] = FALSE
data["messages"] = list()
return data
return data

View File

@@ -8,11 +8,12 @@ var/global/nttransfer_uid = 0
program_key_state = "generic_key"
program_menu_icon = "transferthick-e-w"
size = 7
requires_ntnet = 1
requires_ntnet = TRUE
requires_ntnet_feature = NTNET_PEERTOPEER
network_destination = "other device via P2P tunnel"
available_on_ntnet = 1
available_on_ntnet = TRUE
tgui_id = "NtosNetTransfer"
category = PROG_UTIL
var/error = "" // Error screen
var/server_password = "" // Optional password to download the file.
@@ -23,7 +24,7 @@ var/global/nttransfer_uid = 0
var/download_completion = 0 // Download progress in GQ
var/actual_netspeed = 0 // Displayed in the UI, this is the actual transfer speed.
var/unique_token // UID of this program
var/upload_menu = 0 // Whether we show the program list and upload menu
var/upload_menu = FALSE // Whether we show the program list and upload menu
/datum/computer_file/program/nttransfer/New()
unique_token = nttransfer_uid
@@ -86,14 +87,14 @@ var/global/nttransfer_uid = 0
data["download_progress"] = download_completion
data["download_netspeed"] = actual_netspeed
data["download_name"] = "[downloaded_file.filename].[downloaded_file.filetype]"
data["uploading"] = !!provided_file
if(provided_file)
data["upload_uid"] = unique_token
data["upload_clients"] = connected_clients.len
data["upload_haspassword"] = server_password ? 1 : 0
data["upload_filename"] = "[provided_file.filename].[provided_file.filetype]"
data["upload_filelist"] = list()
if(upload_menu)
var/list/all_files = list()
@@ -104,7 +105,7 @@ var/global/nttransfer_uid = 0
"size" = F.size
)))
data["upload_filelist"] = all_files
data["servers"] = list()
if(!(downloaded_file || provided_file || upload_menu))
var/list/all_servers = list()

View File

@@ -9,12 +9,15 @@
available_on_ntnet = TRUE
tgui_id = "NtosWordProcessor"
var/browsing
var/browsing = FALSE
var/open_file
var/loaded_data
var/error
var/is_edited
usage_flags = PROGRAM_ALL
category = PROG_OFFICE
/datum/computer_file/program/wordprocessor/proc/get_file(var/filename)
var/obj/item/weapon/computer_hardware/hard_drive/HDD = computer.hard_drive
if(!HDD)

View File

@@ -7,6 +7,7 @@
program_menu_icon = "heart"
extended_desc = "This program connects to life signs monitoring system to provide basic information on crew health."
required_access = access_medical
requires_ntnet = 1
requires_ntnet = TRUE
network_destination = "crew lifesigns monitoring system"
size = 11
category = PROG_MONITOR

View File

@@ -6,10 +6,11 @@
program_key_state = "generic_key"
program_menu_icon = "mail-open"
size = 12
requires_ntnet = 1
available_on_ntnet = 1
requires_ntnet = TRUE
available_on_ntnet = TRUE
tgui_id = "NtosEmailAdministration"
required_access = access_network
category = PROG_ADMIN
var/datum/computer_file/data/email_account/current_account = null
var/datum/computer_file/data/email_message/current_message = null

View File

@@ -10,6 +10,7 @@
required_access = access_network
available_on_ntnet = TRUE
tgui_id = "NtosNetMonitor"
category = PROG_ADMIN
/datum/computer_file/program/ntnetmonitor/tgui_data(mob/user)
if(!ntnet_global)
@@ -90,4 +91,4 @@
var/nid = tgui_input_number(usr,"Enter NID of device which you want to unblock from the network:", "Enter NID")
if(nid && tgui_status(usr, state) == STATUS_INTERACTIVE)
ntnet_global.banned_nids -= nid
return TRUE
return TRUE

View File

@@ -17,11 +17,12 @@ var/warrant_uid = 0
program_icon_state = "warrant"
program_key_state = "security_key"
program_menu_icon = "star"
requires_ntnet = 1
available_on_ntnet = 1
requires_ntnet = TRUE
available_on_ntnet = TRUE
required_access = access_security
usage_flags = PROGRAM_ALL
tgui_id = "NtosDigitalWarrant"
category = PROG_SEC
var/datum/data/record/warrant/activewarrant

View File

@@ -7,6 +7,6 @@
program_menu_icon = "pin-s"
extended_desc = "Displays a ship's location in the sector."
required_access = null
requires_ntnet = 1
requires_ntnet = TRUE
network_destination = "ship position sensors"
size = 4

View File

@@ -3,33 +3,46 @@
desc = "Unknown Hardware."
icon = 'icons/obj/modular_components.dmi'
var/obj/item/modular_computer/holder2 = null
var/power_usage = 0 // If the hardware uses extra power, change this.
var/enabled = 1 // If the hardware is turned off set this to 0.
var/critical = 1 // Prevent disabling for important component, like the HDD.
var/hardware_size = 1 // Limits which devices can contain this component. 1: Tablets/Laptops/Consoles, 2: Laptops/Consoles, 3: Consoles only
var/damage = 0 // Current damage level
var/max_damage = 100 // Maximal damage level.
var/damage_malfunction = 20 // "Malfunction" threshold. When damage exceeds this value the hardware piece will semi-randomly fail and do !!FUN!! things
var/damage_failure = 50 // "Failure" threshold. When damage exceeds this value the hardware piece will not work at all.
var/malfunction_probability = 10// Chance of malfunction when the component is damaged
/obj/item/weapon/computer_hardware/attackby(var/obj/item/W as obj, var/mob/living/user as mob)
/// If the hardware uses extra power, change this.
var/power_usage = 0
/// If the hardware is turned off set this to FALSE.
var/enabled = TRUE
/// Prevent disabling for important component, like the HDD.
var/critical = 1
/// Limits which devices can contain this component. 1: All, 2: Laptops/Consoles, 3: Consoles only
var/hardware_size = 1
/// Current damage level
var/damage = 0
/// Maximal damage level.
var/max_damage = 100
/// "Malfunction" threshold. When damage exceeds this value the hardware piece will semi-randomly fail and do !!FUN!! things
var/damage_malfunction = 20
/// "Failure" threshold. When damage exceeds this value the hardware piece will not work at all.
var/damage_failure = 50
/// Chance of malfunction when the component is damaged
var/malfunction_probability = 10
var/usage_flags = PROGRAM_ALL
/// Whether attackby will be passed on it even with a closed panel
var/external_slot
/obj/item/weapon/computer_hardware/attackby(obj/item/W as obj, mob/living/user as mob)
// Multitool. Runs diagnostics
if(istype(W, /obj/item/device/multitool))
to_chat(user, "***** DIAGNOSTICS REPORT *****")
diagnostics(user)
to_chat(user, "******************************")
return 1
return TRUE
// Nanopaste. Repair all damage if present for a single unit.
var/obj/item/stack/S = W
if(istype(S, /obj/item/stack/nanopaste))
if(!damage)
to_chat(user, "\The [src] doesn't seem to require repairs.")
return 1
return TRUE
if(S.use(1))
to_chat(user, "You apply a bit of \the [W] to \the [src]. It immediately repairs all damage.")
damage = 0
return 1
return TRUE
// Cable coil. Works as repair method, but will probably require multiple applications and more cable.
if(istype(S, /obj/item/stack/cable_coil))
if(!damage)
@@ -38,11 +51,11 @@
if(S.use(1))
to_chat(user, "You patch up \the [src] with a bit of \the [W].")
take_damage(-10)
return 1
return TRUE
return ..()
// Called on multitool click, prints diagnostic information to the user.
/// Returns a list of lines containing diagnostic information for display.
/obj/item/weapon/computer_hardware/proc/diagnostics(var/mob/user)
to_chat(user, "Hardware Integrity Test... (Corruption: [damage]/[max_damage]) [damage > damage_failure ? "FAIL" : damage > damage_malfunction ? "WARN" : "PASS"]")
@@ -57,20 +70,20 @@
holder2 = null
return ..()
// Handles damage checks
/// Handles damage checks
/obj/item/weapon/computer_hardware/proc/check_functionality()
// Turned off
if(!enabled)
return 0
return FALSE
// Too damaged to work at all.
if(damage > damage_failure)
return 0
return FALSE
// Still working. Well, sometimes...
if(damage > damage_malfunction)
if(prob(malfunction_probability))
return 0
return FALSE
// Good to go.
return 1
return TRUE
/obj/item/weapon/computer_hardware/examine(var/mob/user)
. = ..()
@@ -81,8 +94,7 @@
else if(damage)
. += "It seems to be slightly damaged."
// Damages the component. Contains necessary checks. Negative damage "heals" the component.
/// Damages the component. Contains necessary checks. Negative damage "heals" the component.
/obj/item/weapon/computer_hardware/take_damage(var/amount)
damage += round(amount) // We want nice rounded numbers here.
damage = between(0, damage, max_damage) // Clamp the value.

View File

@@ -5,9 +5,13 @@
icon_state = "hdd_normal"
hardware_size = 1
origin_tech = list(TECH_DATA = 1, TECH_ENGINEERING = 1)
var/max_capacity = 128
var/used_capacity = 0
var/list/stored_files = list() // List of stored files on this drive. DO NOT MODIFY DIRECTLY!
/// List of stored files on this drive. DO NOT MODIFY DIRECTLY!
var/list/stored_files = list()
/// Whether drive is protected against changes
var/read_only = FALSE
/obj/item/weapon/computer_hardware/hard_drive/advanced
name = "advanced hard drive"
@@ -60,6 +64,7 @@
// 999 is a byond limit that is in place. It's unlikely someone will reach that many files anyway, since you would sooner run out of space.
to_chat(user, "NT-NFS File Table Status: [stored_files.len]/999")
to_chat(user, "Storage capacity: [used_capacity]/[max_capacity]GQ")
to_chat(user, "Read-only mode: [(read_only ? "ON" : "OFF")]")
// Use this proc to add file to the drive. Returns 1 on success and 0 on failure. Contains necessary sanity checks.
/obj/item/weapon/computer_hardware/hard_drive/proc/store_file(var/datum/computer_file/F)
@@ -164,4 +169,4 @@
/obj/item/weapon/computer_hardware/hard_drive/New()
install_default_programs()
..()
..()

View File

@@ -8,12 +8,20 @@ var/global/ntnet_card_uid = 1
critical = 0
icon_state = "netcard_basic"
hardware_size = 1
var/identification_id = null // Identification ID. Technically MAC address of this device. Can't be changed by user.
var/identification_string = "" // Identification string, technically nickname seen in the network. Can be set by user.
var/long_range = 0
var/ethernet = 0 // Hard-wired, therefore always on, ignores NTNet wireless checks.
malfunction_probability = 1
/// Identification ID. Technically MAC address of this device. Can't be changed by user.
var/identification_id = null
/// Identification string, technically nickname seen in the network. Can be set by user.
var/identification_string = ""
/// Long-range cards have stronger connections, letting them reach relays from connected Z-levels.
var/long_range = 0
/// Hard-wired, therefore always on, ignores NTNet wireless checks.
var/ethernet = 0
/// If set, uses the value to funnel connections through another network card.
var/proxy_id
/obj/item/weapon/computer_hardware/network_card/diagnostics(var/mob/user)
..()
to_chat(user, "NIX Unique ID: [identification_id]")