Ports SSnetworks killings (#22104)

* Ports SSnetworks killings

* Update names.dm

* Removes my debug message and fixes instances it caught
This commit is contained in:
John Willard
2024-05-31 01:22:12 -04:00
committed by GitHub
parent 7cc800acee
commit 4212a5c805
66 changed files with 589 additions and 959 deletions

View File

@@ -1,13 +0,0 @@
// Format:
// When the signal is called: (signal arguments)
// All signals send the source datum of the signal as the first argument
//NTnet
#define COMSIG_COMPONENT_NTNET_RECEIVE "ntnet_receive" /// called on an object by its NTNET connection component on receive. (data(datum/netdata))
#define COMSIG_COMPONENT_NTNET_PORT_UPDATE "ntnet_port_update" /// called on an object by its NTNET connection component on a port update (hardware_id, port))
#define COMSIG_COMPONENT_NTNET_ACK "ntnet_ack" /// called when packet was accepted by the target (datum/netdata, error_code)
#define COMSIG_COMPONENT_NTNET_NAK "ntnet_nack" /// called when packet was not acknoledged by the target (datum/netdata, error_code)
// Some internal NTnet signals used on ports
#define COMSIG_COMPONENT_NTNET_PORT_DESTROYED "ntnet_port_destroyed" /// called on an object by its NTNET connection component on a port distruction (port, list/data))
#define COMSIG_COMPONENT_NTNET_PORT_UPDATED "ntnet_port_updated" /// called on an object by its NTNET connection component on a port distruction (port, list/data))

View File

@@ -42,64 +42,6 @@
#define RACK_CREATOR (1<<9) //For AI non-physical AI hardware. (RAM expansions) #define RACK_CREATOR (1<<9) //For AI non-physical AI hardware. (RAM expansions)
//Note: More than one of these can be added to a design but imprinter and lathe designs are incompatable. //Note: More than one of these can be added to a design but imprinter and lathe designs are incompatable.
//Modular computer/NTNet defines
//Modular computer part defines
#define MC_CPU "CPU"
#define MC_HDD "HDD"
#define MC_SDD "SDD"
#define MC_CARD "CARD"
#define MC_CARD2 "CARD2"
#define MC_NET "NET"
#define MC_PRINT "PRINT"
#define MC_CELL "CELL"
#define MC_CHARGE "CHARGE"
#define MC_AI "AI"
#define MC_SENSORS "SENSORS"
#define MC_AI_NETWORK "AINETWORK"
//NTNet stuff, for modular computers
// NTNet module-configuration values. Do not change these. If you need to add another use larger number (5..6..7 etc)
#define NTNET_SOFTWAREDOWNLOAD 1 // Downloads of software from NTNet
#define NTNET_PEERTOPEER 2 // P2P transfers of files between devices
#define NTNET_COMMUNICATION 3 // Communication (messaging)
#define NTNET_SYSTEMCONTROL 4 // Control of various systems, RCon, air alarm control, etc.
//NTNet transfer speeds, used when downloading/uploading a file/program.
#define NTNETSPEED_LOWSIGNAL 0.5 // GQ/s transfer speed when the device is wirelessly connected and on Low signal
#define NTNETSPEED_HIGHSIGNAL 1 // GQ/s transfer speed when the device is wirelessly connected and on High signal
#define NTNETSPEED_ETHERNET 3 // GQ/s transfer speed when the device is using wired connection
//Caps for NTNet logging. Less than 10 would make logging useless anyway, more than 500 may make the log browser too laggy. Defaults to 100 unless user changes it.
#define MAX_NTNET_LOGS 300
#define MIN_NTNET_LOGS 10
//Program bitflags
#define PROGRAM_ALL (~0)
#define PROGRAM_CONSOLE (1<<0)
#define PROGRAM_LAPTOP (1<<1)
#define PROGRAM_TABLET (1<<2)
#define PROGRAM_PHONE (1<<3)
#define PROGRAM_PDA (1<<4)
#define PROGRAM_TELESCREEN (1<<5)
#define PROGRAM_INTEGRATED (1<<6)
#define PROGRAM_PORTABLE PROGRAM_LAPTOP | PROGRAM_TABLET | PROGRAM_PHONE | PROGRAM_PDA
#define PROGRAM_STATIONARY PROGRAM_CONSOLE | PROGRAM_TELESCREEN
//Program states
#define PROGRAM_STATE_KILLED 0
#define PROGRAM_STATE_BACKGROUND 1
#define PROGRAM_STATE_ACTIVE 2
//Program categories
#define PROGRAM_CATEGORY_CMD "Command"
#define PROGRAM_CATEGORY_SEC "Security"
#define PROGRAM_CATEGORY_ENGI "Engineering"
#define PROGRAM_CATEGORY_SCI "Science"
#define PROGRAM_CATEGORY_MED "Medical"
#define PROGRAM_CATEGORY_SUPL "Supply"
#define PROGRAM_CATEGORY_MISC "Other"
#define FIREDOOR_OPEN 1 #define FIREDOOR_OPEN 1
#define FIREDOOR_CLOSED 2 #define FIREDOOR_CLOSED 2

View File

@@ -0,0 +1,116 @@
// Used to stringify message targets before sending the signal datum.
#define STRINGIFY_PDA_TARGET(name, job) "[name] ([job])"
/**
* program_flags
* Used by programs to tell the ModPC any special functions it has.
*/
/* //TODO: Add these back in when TG ModPCs are ported.
///If the program requires NTNet to be online for it to work.
#define PROGRAM_REQUIRES_NTNET (1<<0)
///The program can be downloaded from the default NTNet downloader store.
#define PROGRAM_ON_NTNET_STORE (1<<1)
///The program can only be downloaded from the Syndinet store, usually nukie/emagged pda.
#define PROGRAM_ON_SYNDINET_STORE (1<<2)
///The program is unique and will delete itself upon being transferred to ensure only one copy exists.
#define PROGRAM_UNIQUE_COPY (1<<3)
///The program is a header and will show up at the top of the ModPC's UI.
#define PROGRAM_HEADER (1<<4)
///The program will run despite the ModPC not having any power in it.
#define PROGRAM_RUNS_WITHOUT_POWER (1<<5)
///The circuit ports of this program can be triggered even if the program is not open
#define PROGRAM_CIRCUITS_RUN_WHEN_CLOSED (1<<6)
*/
//Program categories
#define PROGRAM_CATEGORY_DEVICE "Device Tools"
#define PROGRAM_CATEGORY_EQUIPMENT "Equipment"
#define PROGRAM_CATEGORY_GAMES "Games"
#define PROGRAM_CATEGORY_SECURITY "Security & Records"
#define PROGRAM_CATEGORY_ENGINEERING "Engineering"
#define PROGRAM_CATEGORY_SUPPLY "Supply"
#define PROGRAM_CATEGORY_SCIENCE "Science"
///The default amount a program should take in cell use.
#define PROGRAM_BASIC_CELL_USE 15
///This app grants a minor protection against being PDA bombed if installed.
///(can sometimes prevent it from being sent, while wasting a PDA bomb from the sender).
#define DETOMATIX_RESIST_MINOR 1
///This app grants a larger protection against being PDA bombed if installed.
///(can sometimes prevent it from being sent, while wasting a PDA bomb from the sender).
#define DETOMATIX_RESIST_MAJOR 2
///This app gives a diminished protection against being PDA bombed if installed.
#define DETOMATIX_RESIST_MALUS -4
/**
* NTNet transfer speeds, used when downloading/uploading a file/program.
* The define is how fast it will download an app every program's process_tick.
*/
///Used for wireless devices with low signal.
#define NTNETSPEED_LOWSIGNAL 0.5
///Used for wireless devices with high signal.
#define NTNETSPEED_HIGHSIGNAL 1
///Used for laptops with a high signal, or computers, which is connected regardless of z level.
#define NTNETSPEED_ETHERNET 2
/**
* NTNet connection signals
* Used to calculate the defines above from NTNet Downloader, this is how
* good a ModPC's signal is.
*/
///When you're away from the station/mining base and not on a console, you can't access the internet.
#define NTNET_NO_SIGNAL 0
///Low signal, so away from the station, but still connected
#define NTNET_LOW_SIGNAL 1
///On station with good signal.
#define NTNET_GOOD_SIGNAL 2
///Using a Computer or Laptop with good signal, ethernet-connected.
#define NTNET_ETHERNET_SIGNAL 3
/// The default ringtone of the Messenger app.
#define MESSENGER_RINGTONE_DEFAULT "beep"
/// The maximum length of the ringtone of the Messenger app.
#define MESSENGER_RINGTONE_MAX_LENGTH 20
//Modular computer part defines
#define MC_CPU "CPU"
#define MC_HDD "HDD"
#define MC_SDD "SDD"
#define MC_CARD "CARD"
#define MC_CARD2 "CARD2"
#define MC_NET "NET"
#define MC_PRINT "PRINT"
#define MC_CELL "CELL"
#define MC_CHARGE "CHARGE"
#define MC_AI "AI"
#define MC_SENSORS "SENSORS"
#define MC_AI_NETWORK "AINETWORK"
//NTNet stuff, for modular computers
// NTNet module-configuration values. Do not change these. If you need to add another use larger number (5..6..7 etc)
#define NTNET_SOFTWAREDOWNLOAD 1 // Downloads of software from NTNet
#define NTNET_COMMUNICATION 2 // Communication (messaging)
//Caps for NTNet logging. Less than 10 would make logging useless anyway, more than 500 may make the log browser too laggy. Defaults to 100 unless user changes it.
#define MAX_NTNET_LOGS 300
#define MIN_NTNET_LOGS 10
//Program bitflags
#define PROGRAM_ALL (~0)
#define PROGRAM_CONSOLE (1<<0)
#define PROGRAM_LAPTOP (1<<1)
#define PROGRAM_TABLET (1<<2)
#define PROGRAM_PHONE (1<<3)
#define PROGRAM_PDA (1<<4)
#define PROGRAM_TELESCREEN (1<<5)
#define PROGRAM_INTEGRATED (1<<6)
#define PROGRAM_PORTABLE PROGRAM_LAPTOP | PROGRAM_TABLET | PROGRAM_PHONE | PROGRAM_PDA
#define PROGRAM_STATIONARY PROGRAM_CONSOLE | PROGRAM_TELESCREEN
//Program states
#define PROGRAM_STATE_KILLED 0
#define PROGRAM_STATE_BACKGROUND 1
#define PROGRAM_STATE_ACTIVE 2

View File

@@ -1,3 +0,0 @@
#define HID_RESTRICTED_END 101 //the first nonrestricted ID, automatically assigned on connection creation.
#define NETWORK_BROADCAST_ID "ALL"

View File

@@ -150,7 +150,6 @@
#define INIT_ORDER_TICKER 55 #define INIT_ORDER_TICKER 55
#define INIT_ORDER_MAPPING 50 #define INIT_ORDER_MAPPING 50
#define INIT_ORDER_EARLY_ASSETS 48 #define INIT_ORDER_EARLY_ASSETS 48
#define INIT_ORDER_NETWORKS 45
#define INIT_ORDER_ECONOMY 40 #define INIT_ORDER_ECONOMY 40
#define INIT_ORDER_OUTPUTS 35 #define INIT_ORDER_OUTPUTS 35
#define INIT_ORDER_ATOMS 30 #define INIT_ORDER_ATOMS 30
@@ -199,7 +198,6 @@
#define FIRE_PRIORITY_SPACEDRIFT 30 #define FIRE_PRIORITY_SPACEDRIFT 30
#define FIRE_PRIORITY_FIELDS 30 #define FIRE_PRIORITY_FIELDS 30
#define FIRE_PRIORITY_SMOOTHING 35 #define FIRE_PRIORITY_SMOOTHING 35
#define FIRE_PRIORITY_NETWORKS 40
#define FIRE_PRIORITY_OBJ 40 #define FIRE_PRIORITY_OBJ 40
#define FIRE_PRIORITY_ACID 40 #define FIRE_PRIORITY_ACID 40
#define FIRE_PRIORITY_BURNING 40 #define FIRE_PRIORITY_BURNING 40

View File

@@ -293,3 +293,36 @@ GLOBAL_DATUM(syndicate_code_response_regex, /regex)
. += "." . += "."
else else
. += ", " . += ", "
/**
* Generate a name devices
*
* Creates a randomly generated tag or name for devices or anything really
* it keeps track of a special list that makes sure no name is used more than
* once
*
* args:
* * len (int)(Optional) Default=5 The length of the name
* * prefix (string)(Optional) static text in front of the random name
* * postfix (string)(Optional) static text in back of the random name
* Returns (string) The generated name
*/
/proc/assign_random_name(len=5, prefix="", postfix="")
//DO NOT REMOVE NAMES HERE UNLESS YOU KNOW WHAT YOU'RE DOING
//All names already used
var/static/list/used_names = list()
var/static/valid_chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"
var/list/new_name = list()
var/text
// machine id's should be fun random chars hinting at a larger world
do
new_name.Cut()
new_name += prefix
for(var/i = 1 to len)
new_name += valid_chars[rand(1,length(valid_chars))]
new_name += postfix
text = new_name.Join()
while(used_names[text])
used_names[text] = TRUE
return text

View File

@@ -0,0 +1,124 @@
///The maximum amount of logs that can be generated before they start overwriting eachother.
#define MAX_LOG_COUNT 300
SUBSYSTEM_DEF(modular_computers)
name = "Modular Computers"
flags = SS_KEEP_TIMING | SS_NO_FIRE
wait = 1 MINUTES
runlevels = RUNLEVEL_GAME
loading_points = 1 SECONDS // Yogs -- loading times
///List of all logs generated by ModPCs through the round.
///Stops at MAX_LOG_COUNT and must be purged to keep logging.
var/list/modpc_logs = list()
///Boolean on whether downloading software works.
var/setting_softwaredownload = TRUE
///Boolean on whether downloading communication apps like the Chat client works.
var/setting_communication = TRUE
///List of all programs available to download from the NTNet store.
var/list/available_station_software = list()
///List of all programs that can be downloaded from an emagged NTNet store.
var/list/available_antag_software = list()
///List of all chat channels created by Chat Client.
var/list/chat_channels = list()
///Boolean on whether the IDS warning system is enabled
var/intrusion_detection_enabled = TRUE
///Boolean to show a message warning if there's an active intrusion for Wirecarp users.
var/intrusion_detection_alarm = FALSE
var/next_picture_id = 0
/datum/controller/subsystem/modular_computers/Initialize()
build_software_lists()
initialized = TRUE
return SS_INIT_SUCCESS
///Finds all downloadable programs and adds them to their respective downloadable list.
/datum/controller/subsystem/modular_computers/proc/build_software_lists()
for(var/datum/computer_file/program/prog as anything in subtypesof(/datum/computer_file/program))
// Has no TGUI file so is not meant to be a downloadable thing.
if(!initial(prog.tgui_id) || !initial(prog.filename))
continue
prog = new prog
if(prog.available_on_ntnet)
available_station_software.Add(prog)
if(prog.available_on_syndinet)
available_antag_software.Add(prog)
///Attempts to find a new file through searching the available stores with its name.
/datum/controller/subsystem/modular_computers/proc/find_ntnet_file_by_name(filename)
for(var/datum/computer_file/program/programs as anything in available_station_software + available_antag_software)
if(filename == programs.filename)
return programs
return null
///Attempts to find a chatorom using the ID of the channel.
/datum/controller/subsystem/modular_computers/proc/get_chat_channel_by_id(id)
for(var/datum/ntnet_conversation/chan as anything in chat_channels)
if(chan.id == id)
return chan
return null
/**
* Records a message into the station logging system for the network
* Arguments:
* * log_string - The message being logged
*/
/datum/controller/subsystem/modular_computers/proc/add_log(log_string)
var/list/log_text = list()
log_text += "\[[station_time_timestamp()]\]"
log_text += "*SYSTEM* - "
log_text += log_string
log_string = log_text.Join()
modpc_logs.Add(log_string)
// We have too many logs, remove the oldest entries until we get into the limit
if(modpc_logs.len > MAX_LOG_COUNT)
modpc_logs = modpc_logs.Copy(modpc_logs.len - MAX_LOG_COUNT, 0)
/datum/controller/subsystem/modular_computers/proc/toggle_function(function)
if(!function)
return
function = text2num(function)
switch(function)
if(NTNET_SOFTWAREDOWNLOAD)
setting_softwaredownload = !setting_softwaredownload
SSmodular_computers.add_log("Configuration Updated. Wireless network firewall now [setting_softwaredownload ? "allows" : "disallows"] connection to software repositories.")
if(NTNET_COMMUNICATION)
setting_communication = !setting_communication
SSmodular_computers.add_log("Configuration Updated. Wireless network firewall now [setting_communication ? "allows" : "disallows"] instant messaging and similar communication services.")
///Checks whether NTNet is available for a specific function, checking NTNet relays and shutdowns. If none is passed, none is needed.
/datum/controller/subsystem/modular_computers/proc/check_function(specific_action = NONE)
//NTNet is down.
if(!find_functional_ntnet_relay())
return FALSE
switch(specific_action)
if(NTNET_SOFTWAREDOWNLOAD)
return setting_softwaredownload
if(NTNET_COMMUNICATION)
return setting_communication
return TRUE
/**
* Removes all station logs and leaves it with an alert that it's been wiped.
*/
/datum/controller/subsystem/modular_computers/proc/purge_logs()
modpc_logs = list()
add_log("-!- LOGS DELETED BY SYSTEM OPERATOR -!-")
/**
* Returns a name which a /datum/picture can be assigned to.
* Use this function to get asset names and to avoid cache duplicates/overwriting.
*/
/datum/controller/subsystem/modular_computers/proc/get_next_picture_name()
var/next_uid = next_picture_id
next_picture_id++
return "ntos_picture_[next_uid].png"
#undef MAX_LOG_COUNT

View File

@@ -1,51 +0,0 @@
PROCESSING_SUBSYSTEM_DEF(networks)
name = "Networks"
priority = FIRE_PRIORITY_NETWORKS
wait = 1
stat_tag = "NET"
flags = SS_KEEP_TIMING
init_order = INIT_ORDER_NETWORKS
var/datum/ntnet/station/station_network
var/assignment_hardware_id = HID_RESTRICTED_END
var/list/networks_by_id = list() //id = network
var/list/interfaces_by_id = list() //hardware id = component interface
var/resolve_collisions = TRUE
/datum/controller/subsystem/processing/networks/Initialize()
station_network = new
station_network.register_map_supremecy()
return SS_INIT_SUCCESS
/datum/controller/subsystem/processing/networks/proc/register_network(datum/ntnet/network)
if(!networks_by_id[network.network_id])
networks_by_id[network.network_id] = network
return TRUE
return FALSE
/datum/controller/subsystem/processing/networks/proc/unregister_network(datum/ntnet/network)
networks_by_id -= network.network_id
return TRUE
/datum/controller/subsystem/processing/networks/proc/register_interface(datum/component/ntnet_interface/D)
if(!interfaces_by_id[D.hardware_id])
interfaces_by_id[D.hardware_id] = D
return TRUE
return FALSE
/datum/controller/subsystem/processing/networks/proc/unregister_interface(datum/component/ntnet_interface/D)
interfaces_by_id -= D.hardware_id
return TRUE
/datum/controller/subsystem/processing/networks/proc/get_next_HID()
var/string = "[num2text(assignment_hardware_id++, 12)]"
return make_address(string)
/datum/controller/subsystem/processing/networks/proc/make_address(string)
if(!string)
return resolve_collisions? make_address("[num2text(rand(HID_RESTRICTED_END, 999999999), 12)]"):null
var/hex = md5(string)
if(!hex)
return //errored
. = "[copytext_char(hex, 1, 9)]" //16 ^ 8 possibilities I think.
if(interfaces_by_id[.])
return resolve_collisions? make_address("[num2text(rand(HID_RESTRICTED_END, 999999999), 12)]"):null

View File

@@ -316,6 +316,7 @@
var/datum/component/component_type = original_type var/datum/component/component_type = original_type
if(QDELING(src)) if(QDELING(src))
CRASH("Attempted to add a new component of type \[[component_type]\] to a qdeleting parent of type \[[type]\]!") CRASH("Attempted to add a new component of type \[[component_type]\] to a qdeleting parent of type \[[type]\]!")
var/datum/component/new_component var/datum/component/new_component

View File

@@ -1,66 +0,0 @@
//Thing meant for allowing datums and objects to access a NTnet network datum.
/datum/proc/ntnet_receive(datum/netdata/data)
return
/datum/proc/ntnet_receive_broadcast(datum/netdata/data)
return
/datum/proc/ntnet_send(datum/netdata/data, netid)
var/datum/component/ntnet_interface/NIC = GetComponent(/datum/component/ntnet_interface)
if(!NIC)
return FALSE
return NIC.__network_send(data, netid)
/datum/component/ntnet_interface
var/hardware_id //text. this is the true ID. do not change this. stuff like ID forgery can be done manually.
var/network_name = "" //text
var/list/networks_connected_by_id = list() //id = datum/ntnet
var/differentiate_broadcast = TRUE //If false, broadcasts go to ntnet_receive. NOT RECOMMENDED.
/datum/component/ntnet_interface/Initialize(force_name = "NTNet Device", autoconnect_station_network = TRUE) //Don't force ID unless you know what you're doing!
hardware_id = "[SSnetworks.get_next_HID()]"
network_name = force_name
if(!SSnetworks.register_interface(src))
. = COMPONENT_INCOMPATIBLE
CRASH("Unable to register NTNet interface. Interface deleted.")
if(autoconnect_station_network)
register_connection(SSnetworks.station_network)
/datum/component/ntnet_interface/Destroy()
unregister_all_connections()
SSnetworks.unregister_interface(src)
return ..()
/datum/component/ntnet_interface/proc/__network_receive(datum/netdata/data) //Do not directly proccall!
SEND_SIGNAL(parent, COMSIG_COMPONENT_NTNET_RECEIVE, data)
if(differentiate_broadcast && data.broadcast)
parent.ntnet_receive_broadcast(data)
else
parent.ntnet_receive(data)
/datum/component/ntnet_interface/proc/__network_send(datum/netdata/data, netid) //Do not directly proccall!
if(netid)
if(networks_connected_by_id[netid])
var/datum/ntnet/net = networks_connected_by_id[netid]
return net.process_data_transmit(src, data)
return FALSE
for(var/i in networks_connected_by_id)
var/datum/ntnet/net = networks_connected_by_id[i]
net.process_data_transmit(src, data)
return TRUE
/datum/component/ntnet_interface/proc/register_connection(datum/ntnet/net)
if(net.interface_connect(src))
networks_connected_by_id[net.network_id] = net
return TRUE
/datum/component/ntnet_interface/proc/unregister_all_connections()
for(var/i in networks_connected_by_id)
unregister_connection(networks_connected_by_id[i])
return TRUE
/datum/component/ntnet_interface/proc/unregister_connection(datum/ntnet/net)
net.interface_disconnect(src)
networks_connected_by_id -= net.network_id
return TRUE

View File

@@ -2,6 +2,7 @@
// This code allows for airlocks to be controlled externally by setting an id_tag and comm frequency (disables ID access) // This code allows for airlocks to be controlled externally by setting an id_tag and comm frequency (disables ID access)
/obj/machinery/door/airlock /obj/machinery/door/airlock
opens_with_door_remote = TRUE
/// The current state of the airlock, used to construct the airlock overlays /// The current state of the airlock, used to construct the airlock overlays
var/airlock_state var/airlock_state
var/id_tag var/id_tag

View File

@@ -62,6 +62,7 @@
secondsElectrified = MACHINE_NOT_ELECTRIFIED //How many seconds remain until the door is no longer electrified. -1/MACHINE_ELECTRIFIED_PERMANENT = permanently electrified until someone fixes it. secondsElectrified = MACHINE_NOT_ELECTRIFIED //How many seconds remain until the door is no longer electrified. -1/MACHINE_ELECTRIFIED_PERMANENT = permanently electrified until someone fixes it.
assemblytype = /obj/structure/door_assembly assemblytype = /obj/structure/door_assembly
normalspeed = TRUE normalspeed = TRUE
opens_with_door_remote = TRUE
explosion_block = 1 explosion_block = 1
hud_possible = list(DIAG_AIRLOCK_HUD) hud_possible = list(DIAG_AIRLOCK_HUD)
smoothing_groups = SMOOTH_GROUP_AIRLOCK smoothing_groups = SMOOTH_GROUP_AIRLOCK
@@ -181,7 +182,6 @@
diag_hud_set_electrified() diag_hud_set_electrified()
rebuild_parts() rebuild_parts()
AddComponent(/datum/component/ntnet_interface)
return INITIALIZE_HINT_LATELOAD return INITIALIZE_HINT_LATELOAD
@@ -337,56 +337,6 @@
if ("cyclelinkeddir") if ("cyclelinkeddir")
cyclelinkairlock() cyclelinkairlock()
/obj/machinery/door/airlock/check_access_ntnet(datum/netdata/data)
return !requiresID() || ..()
/obj/machinery/door/airlock/ntnet_receive(datum/netdata/data)
// Check if the airlock is powered and can accept control packets.
if(!hasPower() || !canAIControl())
return
// Check packet access level.
if(!check_access_ntnet(data))
return
// Handle received packet.
var/command = lowertext(data.data["data"])
var/command_value = lowertext(data.data["data_secondary"])
switch(command)
if("open")
if(command_value == "on" && !density)
return
if(command_value == "off" && density)
return
if(density)
INVOKE_ASYNC(src, PROC_REF(open))
else
INVOKE_ASYNC(src, PROC_REF(close))
if("bolt")
if(command_value == "on" && locked)
return
if(command_value == "off" && !locked)
return
if(locked)
unbolt()
else
bolt()
if("emergency")
if(command_value == "on" && emergency)
return
if(command_value == "off" && !emergency)
return
emergency = !emergency
update_appearance(UPDATE_ICON)
/obj/machinery/door/airlock/lock() /obj/machinery/door/airlock/lock()
bolt() bolt()

View File

@@ -17,6 +17,8 @@
interaction_flags_atom = INTERACT_ATOM_UI_INTERACT interaction_flags_atom = INTERACT_ATOM_UI_INTERACT
blocks_emissive = EMISSIVE_BLOCK_UNIQUE blocks_emissive = EMISSIVE_BLOCK_UNIQUE
/// Door remote allow control
var/opens_with_door_remote = FALSE
/// TRUE means density will be set as soon as the door begins to close /// TRUE means density will be set as soon as the door begins to close
var/air_tight = FALSE var/air_tight = FALSE
/// How long is this door electrified for /// How long is this door electrified for

View File

@@ -16,6 +16,7 @@
opacity = FALSE opacity = FALSE
can_atmos_pass = ATMOS_PASS_PROC can_atmos_pass = ATMOS_PASS_PROC
interaction_flags_machine = INTERACT_MACHINE_WIRES_IF_OPEN | INTERACT_MACHINE_ALLOW_SILICON | INTERACT_MACHINE_OPEN_SILICON | INTERACT_MACHINE_REQUIRES_SILICON | INTERACT_MACHINE_OPEN interaction_flags_machine = INTERACT_MACHINE_WIRES_IF_OPEN | INTERACT_MACHINE_ALLOW_SILICON | INTERACT_MACHINE_OPEN_SILICON | INTERACT_MACHINE_REQUIRES_SILICON | INTERACT_MACHINE_OPEN
opens_with_door_remote = TRUE
var/obj/item/electronics/airlock/electronics = null var/obj/item/electronics/airlock/electronics = null
var/reinf = 0 var/reinf = 0
var/shards = 2 var/shards = 2
@@ -25,7 +26,6 @@
/obj/machinery/door/window/Initialize(mapload, set_dir, unres_sides) /obj/machinery/door/window/Initialize(mapload, set_dir, unres_sides)
. = ..() . = ..()
AddComponent(/datum/component/ntnet_interface)
if(set_dir) if(set_dir)
setDir(set_dir) setDir(set_dir)
if(LAZYLEN(req_access)) if(LAZYLEN(req_access))
@@ -362,36 +362,6 @@
if("deny") if("deny")
flick("[base_state]deny", src) flick("[base_state]deny", src)
/obj/machinery/door/window/check_access_ntnet(datum/netdata/data)
return !requiresID() || ..()
/obj/machinery/door/window/ntnet_receive(datum/netdata/data)
// Check if the airlock is powered.
if(!hasPower())
return
// Check packet access level.
if(!check_access_ntnet(data))
return
// Handle received packet.
var/command = lowertext(data.data["data"])
var/command_value = lowertext(data.data["data_secondary"])
switch(command)
if("open")
if(command_value == "on" && !density)
return
if(command_value == "off" && density)
return
if(density)
INVOKE_ASYNC(src, PROC_REF(open))
else
INVOKE_ASYNC(src, PROC_REF(close))
if("touch")
INVOKE_ASYNC(src, PROC_REF(open_and_close))
/obj/machinery/door/window/rcd_vals(mob/user, obj/item/construction/rcd/the_rcd) /obj/machinery/door/window/rcd_vals(mob/user, obj/item/construction/rcd/the_rcd)
switch(the_rcd.construction_mode) switch(the_rcd.construction_mode)
if(RCD_DECONSTRUCT) if(RCD_DECONSTRUCT)

View File

@@ -0,0 +1,129 @@
///Checks whether NTNet is available by ensuring at least one relay exists and is operational.
/proc/find_functional_ntnet_relay()
// Check all relays. If we have at least one working relay, ntos is up.
for(var/obj/machinery/ntnet_relay/relays as anything in SSmachines.get_machines_by_type(/obj/machinery/ntnet_relay))
if(!relays.is_operational())
continue
return TRUE
return FALSE
// Relays don't handle any actual communication. Global NTNet datum does that, relays only tell the datum if it should or shouldn't work.
/obj/machinery/ntnet_relay
name = "NTNet Quantum Relay"
desc = "A very complex router and transmitter capable of connecting electronic devices together. Looks fragile."
use_power = ACTIVE_POWER_USE
active_power_usage = 10000 //10kW, apropriate for machine that keeps massive cross-Zlevel wireless network operational. Used to be 20 but that actually drained the smes one round
idle_power_usage = 100
icon = 'icons/obj/machines/telecomms.dmi'
icon_state = "bus"
density = TRUE
circuit = /obj/item/circuitboard/machine/ntnet_relay
///On / off status for the relay machine, toggleable by the user.
var/relay_enabled = TRUE
///(D)DoS-attack-related failure causing it not to be operational any longer.
var/dos_failure = FALSE
var/list/dos_sources = list() // Backwards reference for qdel() stuff
var/uid
var/static/gl_uid = 1
// Denial of Service attack variables
var/dos_overload = 0 // Amount of DoS "packets" in this relay's buffer
var/dos_capacity = 500 // Amount of DoS "packets" in buffer required to crash the relay
var/dos_dissipate = 0.5 // Amount of DoS "packets" dissipated over time.
/obj/machinery/ntnet_relay/Initialize(mapload)
. = ..()
uid = gl_uid++
var/list/current_machines = SSmachines.get_machines_by_type(/obj/machinery/ntnet_relay)
SSmodular_computers.add_log("New quantum relay activated. Current amount of linked relays: [current_machines.len]")
/obj/machinery/ntnet_relay/Destroy()
. = ..()
var/list/machines_left = SSmachines.get_machines_by_type(/obj/machinery/ntnet_relay)
SSmodular_computers.add_log("Quantum relay connection severed. Current amount of linked relays: [machines_left.len]")
for(var/datum/computer_file/program/ntnet_dos/D in dos_sources)
D.target = null
D.error = "Connection to quantum relay severed"
// TODO: Implement more logic here. For now it's only a placeholder.
/obj/machinery/ntnet_relay/is_operational()
if(stat & (BROKEN | NOPOWER | EMPED))
return FALSE
if(dos_failure)
return FALSE
if(!relay_enabled)
return FALSE
return TRUE
///Proc called to change the value of the `relay_enabled` variable and append behavior related to its change.
/obj/machinery/ntnet_relay/proc/set_relay_enabled(new_value)
if(new_value == relay_enabled)
return
. = relay_enabled
relay_enabled = new_value
///Proc called to change the value of the `dos_failure` variable and append behavior related to its change.
/obj/machinery/ntnet_relay/proc/set_dos_failure(new_value)
if(new_value == dos_failure)
return
. = dos_failure
dos_failure = new_value
/obj/machinery/ntnet_relay/update_icon_state()
icon_state = "bus[is_operational() ? null : "_off"]"
return ..()
/obj/machinery/ntnet_relay/process(seconds_per_tick)
if(is_operational())
use_power = ACTIVE_POWER_USE
else
use_power = IDLE_POWER_USE
update_appearance()
if(dos_overload > 0)
dos_overload = max(0, dos_overload - dos_dissipate * seconds_per_tick)
// If DoS traffic exceeded capacity, crash.
if((dos_overload > dos_capacity) && !dos_failure)
set_dos_failure(TRUE)
update_appearance()
SSmodular_computers.add_log("Quantum relay switched from normal operation mode to overload recovery mode.")
// If the DoS buffer reaches 0 again, restart.
if((dos_overload == 0) && dos_failure)
set_dos_failure(FALSE)
update_appearance()
SSmodular_computers.add_log("Quantum relay switched from overload recovery mode to normal operation mode.")
return TRUE
/obj/machinery/ntnet_relay/ui_interact(mob/user, datum/tgui/ui)
ui = SStgui.try_update_ui(user, src, ui)
if(!ui)
ui = new(user, src, "NtnetRelay")
ui.open()
/obj/machinery/ntnet_relay/ui_data(mob/user)
var/list/data = list()
data["enabled"] = relay_enabled
data["dos_capacity"] = dos_capacity
data["dos_overload"] = dos_overload
data["dos_crashed"] = dos_failure
return data
/obj/machinery/ntnet_relay/ui_act(action, params)
. = ..()
if(.)
return
switch(action)
if("restart")
dos_overload = 0
set_dos_failure(FALSE)
update_appearance()
SSmodular_computers.add_log("Quantum relay manually restarted from overload recovery mode to normal operation mode.")
return TRUE
if("toggle")
set_relay_enabled(!relay_enabled)
SSmodular_computers.add_log("Quantum relay manually [relay_enabled ? "enabled" : "disabled"].")
update_appearance()
return TRUE

View File

@@ -19,7 +19,6 @@
. = ..() . = ..()
for(var/i in region_access) for(var/i in region_access)
access_list += get_region_accesses(i) access_list += get_region_accesses(i)
AddComponent(/datum/component/ntnet_interface)
/obj/item/door_remote/attack_self(mob/user) /obj/item/door_remote/attack_self(mob/user)
switch(mode) switch(mode)
@@ -32,29 +31,54 @@
to_chat(user, "Now in mode: [mode].") to_chat(user, "Now in mode: [mode].")
// Airlock remote works by sending NTNet packets to whatever it's pointed at. // Airlock remote works by sending NTNet packets to whatever it's pointed at.
/obj/item/door_remote/afterattack(atom/A, mob/user) /obj/item/door_remote/afterattack(atom/target, mob/user, proximity_flag, click_parameters)
. = ..() . = ..()
var/datum/component/ntnet_interface/target_interface = A.GetComponent(/datum/component/ntnet_interface) var/obj/machinery/door/door
if(istype(target, /obj/machinery/door))
if(!target_interface) door = target
if(!door.opens_with_door_remote)
return
else
for (var/obj/machinery/door/door_on_turf in get_turf(target))
if(door_on_turf.opens_with_door_remote)
door = door_on_turf
break
if(isnull(door))
return
if(!door.check_access_list(access_list) || !door.requiresID())
target.balloon_alert(user, "can't access!")
return return
// Generate a control packet. var/obj/machinery/door/airlock/airlock = door
var/datum/netdata/data = new
data.recipient_ids = list(target_interface.hardware_id) if(!door.hasPower() || (istype(airlock) && !airlock.canAIControl()))
target.balloon_alert(user, mode == WAND_OPEN ? "it won't budge!" : "nothing happens!")
return
switch(mode) switch(mode)
if(WAND_OPEN) if(WAND_OPEN)
data.data["data"] = "open" if(door.density)
door.open()
else
door.close()
if(WAND_BOLT) if(WAND_BOLT)
data.data["data"] = "bolt" if(!istype(airlock))
target.balloon_alert(user, "only airlocks!")
return
if(airlock.locked)
airlock.unbolt()
log_combat(user, airlock, "unbolted", src)
else
airlock.bolt()
log_combat(user, airlock, "bolted", src)
if(WAND_EMERGENCY) if(WAND_EMERGENCY)
data.data["data"] = "emergency" if(!istype(airlock))
target.balloon_alert(user, "only airlocks!")
return
data.data["data_secondary"] = "toggle" airlock.emergency = !airlock.emergency
data.passkey = access_list airlock.update_appearance(UPDATE_ICON)
ntnet_send(data)
/obj/item/door_remote/omni /obj/item/door_remote/omni

View File

@@ -1,44 +0,0 @@
/datum/netdata //this requires some thought later on but for now it's fine.
var/network_id
var/autopasskey = TRUE
var/list/recipient_ids = list()
var/sender_id
var/broadcast = FALSE //Whether this is a broadcast packet.
var/list/data = list()
var/list/passkey
/datum/netdata/proc/standard_format_data(primary, secondary, passkey)
data["data"] = primary
data["data_secondary"] = secondary
data["encrypted_passkey"] = passkey
/datum/netdata/proc/json_to_data(json)
data = json_decode(json)
/datum/netdata/proc/json_append_to_data(json)
data |= json_decode(json)
/datum/netdata/proc/data_to_json()
return json_encode(data)
/datum/netdata/proc/json_list_generation_admin() //for admin logs and such.
. = list()
. |= json_list_generation()
/datum/netdata/proc/json_list_generation()
. = list()
. |= json_list_generation_netlog()
.["network_id"] = network_id
/datum/netdata/proc/json_list_generation_netlog()
. = list()
.["recipient_ids"] = recipient_ids
.["sender_id"] = sender_id
.["data_list"] = data
/datum/netdata/proc/generate_netlog()
return "[json_encode(json_list_generation_netlog())]"

View File

@@ -1,256 +0,0 @@
/datum/ntnet
var/network_id = "Network"
var/list/connected_interfaces_by_id = list() //id = datum/component/ntnet_interface
var/list/services_by_path = list() //type = datum/ntnet_service
var/list/services_by_id = list() //id = datum/ntnet_service
var/list/autoinit_service_paths = list() //typepaths
var/list/relays = list()
var/list/logs = list()
var/list/available_station_software = list()
var/list/available_antag_software = list()
var/list/chat_channels = list()
var/list/fileservers = 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.
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 = TRUE
var/setting_peertopeer = TRUE
var/setting_communication = TRUE
var/setting_systemcontrol = TRUE
var/setting_disabled = FALSE // Setting to 1 will disable all wireless, independently on relays status.
var/intrusion_detection_enabled = TRUE // Whether the IDS warning system is enabled
var/intrusion_detection_alarm = FALSE // Set when there is an IDS warning due to malicious (antag) software.
// If new NTNet datum is spawned, it replaces the old one.
/datum/ntnet/New(_netid)
build_software_lists()
add_log("NTNet logging system activated.")
if(_netid)
network_id = _netid
if(!SSnetworks.register_network(src))
stack_trace("Network [type] with ID [network_id] failed to register and has been deleted.")
qdel(src)
/datum/ntnet/Destroy()
for(var/i in connected_interfaces_by_id)
var/datum/component/ntnet_interface/I = i
I.unregister_connection(src)
for(var/i in services_by_id)
var/datum/ntnet_service/S = i
S.disconnect(src, TRUE)
return ..()
/datum/ntnet/proc/interface_connect(datum/component/ntnet_interface/I)
if(connected_interfaces_by_id[I.hardware_id])
return FALSE
connected_interfaces_by_id[I.hardware_id] = I
return TRUE
/datum/ntnet/proc/interface_disconnect(datum/component/ntnet_interface/I)
connected_interfaces_by_id -= I.hardware_id
return TRUE
/datum/ntnet/proc/find_interface_id(id)
return connected_interfaces_by_id[id]
/datum/ntnet/proc/find_service_id(id)
return services_by_id[id]
/datum/ntnet/proc/find_service_path(path)
return services_by_path[path]
/datum/ntnet/proc/register_service(datum/ntnet_service/S)
if(!istype(S))
return FALSE
if(services_by_path[S.type] || services_by_id[S.id])
return FALSE
services_by_path[S.type] = S
services_by_id[S.id] = S
return TRUE
/datum/ntnet/proc/unregister_service(datum/ntnet_service/S)
if(!istype(S))
return FALSE
services_by_path -= S.type
services_by_id -= S.id
return TRUE
/datum/ntnet/proc/create_service(type)
var/datum/ntnet_service/S = new type
if(!istype(S))
return FALSE
. = S.connect(src)
if(!.)
qdel(S)
/datum/ntnet/proc/destroy_service(type)
var/datum/ntnet_service/S = find_service_path(type)
if(!istype(S))
return FALSE
. = S.disconnect(src)
if(.)
qdel(src)
/datum/ntnet/proc/process_data_transmit(datum/component/ntnet_interface/sender, datum/netdata/data)
if(!check_relay_operation())
return FALSE
data.network_id = src
log_data_transfer(data)
var/list/datum/component/ntnet_interface/receiving = list()
if((length(data.recipient_ids == 1) && data.recipient_ids[1] == NETWORK_BROADCAST_ID) || data.recipient_ids == NETWORK_BROADCAST_ID)
data.broadcast = TRUE
for(var/i in connected_interfaces_by_id)
receiving |= connected_interfaces_by_id[i]
else
for(var/i in data.recipient_ids)
var/datum/component/ntnet_interface/receiver = find_interface_id(i)
receiving |= receiver
for(var/i in receiving)
var/datum/component/ntnet_interface/receiver = i
if(receiver)
receiver.__network_receive(data)
for(var/i in services_by_id)
var/datum/ntnet_service/serv = services_by_id[i]
serv.ntnet_intercept(data, src, sender)
return TRUE
/datum/ntnet/proc/check_relay_operation(zlevel) //can be expanded later but right now it's true/false.
for(var/i in relays)
var/obj/machinery/ntnet_relay/n = i
if(zlevel && n.z != zlevel)
continue
if(n.is_operational())
return TRUE
return FALSE
/datum/ntnet/proc/log_data_transfer(datum/netdata/data)
logs += "[station_time_timestamp()] - [data.generate_netlog()]"
if(logs.len > setting_maxlogcount)
logs = logs.Copy(logs.len - setting_maxlogcount, 0)
return
// Simplified logging: Adds a log. log_string is mandatory parameter, source is optional.
/datum/ntnet/proc/add_log(log_string, obj/item/computer_hardware/network_card/source = null)
var/log_text = "[station_time_timestamp()] - "
if(source)
log_text += "[source.get_network_tag()] - "
else
log_text += "*SYSTEM* - "
log_text += log_string
logs.Add(log_text)
// We have too many logs, remove the oldest entries until we get into the limit
if(logs.len > setting_maxlogcount)
logs = logs.Copy(logs.len-setting_maxlogcount,0)
// Checks whether NTNet operates. If parameter is passed checks whether specific function is enabled.
/datum/ntnet/proc/check_function(specific_action = 0)
if(!relays || !relays.len) // No relays found. NTNet is down
return FALSE
// Check all relays. If we have at least one working relay, network is up.
if(!check_relay_operation())
return FALSE
if(setting_disabled)
return FALSE
switch(specific_action)
if(NTNET_SOFTWAREDOWNLOAD)
return setting_softwaredownload
if(NTNET_PEERTOPEER)
return setting_peertopeer
if(NTNET_COMMUNICATION)
return setting_communication
if(NTNET_SYSTEMCONTROL)
return setting_systemcontrol
return TRUE
// Builds lists that contain downloadable software.
/datum/ntnet/proc/build_software_lists()
available_station_software = list()
available_antag_software = list()
for(var/F in typesof(/datum/computer_file/program))
var/datum/computer_file/program/prog = new F
// Invalid type (shouldn't be possible but just in case), invalid filetype (not executable program) or invalid filename (unset program)
if(!prog || prog.filename == "UnknownProgram" || prog.filetype != "PRG")
continue
// Check whether the program should be available for station/antag download, if yes, add it to lists.
if(prog.available_on_ntnet)
available_station_software.Add(prog)
if(prog.available_on_syndinet)
available_antag_software.Add(prog)
// Attempts to find a downloadable file according to filename var
/datum/ntnet/proc/find_ntnet_file_by_name(filename)
for(var/N in available_station_software)
var/datum/computer_file/program/P = N
if(filename == P.filename)
return P
for(var/N in available_antag_software)
var/datum/computer_file/program/P = N
if(filename == P.filename)
return P
/datum/ntnet/proc/get_chat_channel_by_id(id)
for(var/datum/ntnet_conversation/chan in chat_channels)
if(chan.id == id)
return chan
// Resets the IDS alarm
/datum/ntnet/proc/resetIDS()
intrusion_detection_alarm = FALSE
/datum/ntnet/proc/toggleIDS()
resetIDS()
intrusion_detection_enabled = !intrusion_detection_enabled
// Removes all logs
/datum/ntnet/proc/purge_logs()
logs = list()
add_log("-!- LOGS DELETED BY SYSTEM OPERATOR -!-")
// Updates maximal amount of stored logs. Use this instead of setting the number, it performs required checks.
/datum/ntnet/proc/update_max_log_count(lognumber)
if(!lognumber)
return FALSE
// Trim the value if necessary
lognumber = max(MIN_NTNET_LOGS, min(lognumber, MAX_NTNET_LOGS))
setting_maxlogcount = lognumber
add_log("Configuration Updated. Now keeping [setting_maxlogcount] logs in system memory.")
/datum/ntnet/proc/toggle_function(function)
if(!function)
return
function = text2num(function)
switch(function)
if(NTNET_SOFTWAREDOWNLOAD)
setting_softwaredownload = !setting_softwaredownload
add_log("Configuration Updated. Wireless network firewall now [setting_softwaredownload ? "allows" : "disallows"] connection to software repositories.")
if(NTNET_PEERTOPEER)
setting_peertopeer = !setting_peertopeer
add_log("Configuration Updated. Wireless network firewall now [setting_peertopeer ? "allows" : "disallows"] peer to peer network traffic.")
if(NTNET_COMMUNICATION)
setting_communication = !setting_communication
add_log("Configuration Updated. Wireless network firewall now [setting_communication ? "allows" : "disallows"] instant messaging and similar communication services.")
if(NTNET_SYSTEMCONTROL)
setting_systemcontrol = !setting_systemcontrol
add_log("Configuration Updated. Wireless network firewall now [setting_systemcontrol ? "allows" : "disallows"] remote control of station's systems.")
/datum/ntnet/station
network_id = "SS13-NTNET"
/datum/ntnet/station/proc/register_map_supremecy() //called at map init to make this what station networks use.
for(var/obj/machinery/ntnet_relay/R in GLOB.machines)
relays.Add(R)
R.NTNet = src

View File

@@ -1,124 +0,0 @@
// Relays don't handle any actual communication. Global NTNet datum does that, relays only tell the datum if it should or shouldn't work.
/obj/machinery/ntnet_relay
name = "NTNet Quantum Relay"
desc = "A very complex router and transmitter capable of connecting electronic devices together. Looks fragile."
use_power = ACTIVE_POWER_USE
active_power_usage = 10000 //10kW, apropriate for machine that keeps massive cross-Zlevel wireless network operational. Used to be 20 but that actually drained the smes one round
idle_power_usage = 100
icon = 'icons/obj/machines/telecomms.dmi'
icon_state = "bus"
density = TRUE
circuit = /obj/item/circuitboard/machine/ntnet_relay
var/datum/ntnet/NTNet = null // This is mostly for backwards reference and to allow varedit modifications from ingame.
var/enabled = 1 // Set to 0 if the relay was turned off
var/dos_failure = 0 // Set to 1 if the relay failed due to (D)DoS attack
var/list/dos_sources = list() // Backwards reference for qdel() stuff
var/uid
var/static/gl_uid = 1
// Denial of Service attack variables
var/dos_overload = 0 // Amount of DoS "packets" in this relay's buffer
var/dos_capacity = 500 // Amount of DoS "packets" in buffer required to crash the relay
var/dos_dissipate = 0.5 // Amount of DoS "packets" dissipated over time.
// TODO: Implement more logic here. For now it's only a placeholder.
/obj/machinery/ntnet_relay/is_operational()
if(stat & (BROKEN | NOPOWER | EMPED))
return FALSE
if(dos_failure)
return FALSE
if(!enabled)
return FALSE
return TRUE
/obj/machinery/ntnet_relay/update_overlays()
. = ..()
if(is_operational())
var/mutable_appearance/on_overlay = mutable_appearance(icon, "[initial(icon_state)]_on")
. += on_overlay
/obj/machinery/ntnet_relay/update_icon_state()
. = ..()
if(panel_open)
icon_state = "[initial(icon_state)]_o"
else
icon_state = initial(icon_state)
icon_state = "bus"
/obj/machinery/ntnet_relay/process(delta_time)
if(is_operational())
use_power = ACTIVE_POWER_USE
else
use_power = IDLE_POWER_USE
update_appearance(UPDATE_ICON)
if(dos_overload > 0)
dos_overload = max(0, dos_overload - dos_dissipate * delta_time)
// If DoS traffic exceeded capacity, crash.
if((dos_overload > dos_capacity) && !dos_failure)
dos_failure = 1
update_appearance(UPDATE_ICON)
SSnetworks.station_network.add_log("Quantum relay switched from normal operation mode to overload recovery mode.")
// If the DoS buffer reaches 0 again, restart.
if((dos_overload == 0) && dos_failure)
dos_failure = 0
update_appearance(UPDATE_ICON)
SSnetworks.station_network.add_log("Quantum relay switched from overload recovery mode to normal operation mode.")
..()
/obj/machinery/ntnet_relay/ui_interact(mob/user, datum/tgui/ui)
ui = SStgui.try_update_ui(user, src, ui)
if(!ui)
ui = new(user, src, "NtnetRelay")
ui.open()
/obj/machinery/ntnet_relay/ui_data(mob/user)
var/list/data = list()
data["enabled"] = enabled
data["dos_capacity"] = dos_capacity
data["dos_overload"] = dos_overload
data["dos_crashed"] = dos_failure
return data
/obj/machinery/ntnet_relay/ui_act(action, params)
if(..())
return
switch(action)
if("restart")
dos_overload = 0
dos_failure = 0
update_appearance(UPDATE_ICON)
SSnetworks.station_network.add_log("Quantum relay manually restarted from overload recovery mode to normal operation mode.")
return TRUE
if("toggle")
enabled = !enabled
SSnetworks.station_network.add_log("Quantum relay manually [enabled ? "enabled" : "disabled"].")
update_appearance(UPDATE_ICON)
return TRUE
/obj/machinery/ntnet_relay/Initialize(mapload)
uid = gl_uid++
component_parts = list()
if(SSnetworks.station_network)
SSnetworks.station_network.relays.Add(src)
NTNet = SSnetworks.station_network
SSnetworks.station_network.add_log("New quantum relay activated. Current amount of linked relays: [NTNet.relays.len]")
. = ..()
/obj/machinery/ntnet_relay/Destroy()
if(SSnetworks.station_network)
SSnetworks.station_network.relays.Remove(src)
SSnetworks.station_network.add_log("Quantum relay connection severed. Current amount of linked relays: [NTNet.relays.len]")
NTNet = null
for(var/datum/computer_file/program/ntnet_dos/D in dos_sources)
D.target = null
D.error = "Connection to quantum relay severed"
return ..()

View File

@@ -1,38 +0,0 @@
/datum/ntnet_service
var/name = "Unidentified Network Service"
var/id
var/list/networks_by_id = list() //Yes we support multinetwork services!
/datum/ntnet_service/New()
var/datum/component/ntnet_interface/N = AddComponent(/datum/component/ntnet_interface, id, name, FALSE)
id = N.hardware_id
/datum/ntnet_service/Destroy()
for(var/i in networks_by_id)
var/datum/ntnet/N = i
disconnect(N, TRUE)
networks_by_id = null
return ..()
/datum/ntnet_service/proc/connect(datum/ntnet/net)
if(!istype(net))
return FALSE
var/datum/component/ntnet_interface/interface = GetComponent(/datum/component/ntnet_interface)
if(!interface.register_connection(net))
return FALSE
if(!net.register_service(src))
interface.unregister_connection(net)
return FALSE
networks_by_id[net.network_id] = net
return TRUE
/datum/ntnet_service/proc/disconnect(datum/ntnet/net, force = FALSE)
if(!istype(net) || (!net.unregister_service(src) && !force))
return FALSE
var/datum/component/ntnet_interface/interface = GetComponent(/datum/component/ntnet_interface)
interface.unregister_connection(net)
networks_by_id -= net.network_id
return TRUE
/datum/ntnet_service/proc/ntnet_intercept(datum/netdata/data, datum/ntnet/net, datum/component/ntnet_interface/sender)
return

View File

@@ -96,10 +96,6 @@
return FALSE return FALSE
return TRUE return TRUE
/// Checks ntnet access
/obj/proc/check_access_ntnet(datum/netdata/data)
return check_access_list(data.passkey)
/// Get access for centcom job /// Get access for centcom job
/proc/get_centcom_access(job) /proc/get_centcom_access(job)
switch(job) switch(job)

View File

@@ -65,7 +65,6 @@
mulebot_count += 1 mulebot_count += 1
set_id(suffix || id || "#[mulebot_count]") set_id(suffix || id || "#[mulebot_count]")
suffix = null suffix = null
AddComponent(/datum/component/ntnet_interface)
/mob/living/simple_animal/bot/mulebot/Destroy() /mob/living/simple_animal/bot/mulebot/Destroy()
unload(0) unload(0)

View File

@@ -15,13 +15,13 @@
qdel(src) qdel(src)
return return
ntnrc_uid = id ntnrc_uid = id
if(SSnetworks.station_network) if(SSmodular_computers)
SSnetworks.station_network.chat_channels.Add(src) SSmodular_computers.chat_channels += src
..() ..()
/datum/ntnet_conversation/Destroy() /datum/ntnet_conversation/Destroy()
if(SSnetworks.station_network) if(SSmodular_computers)
SSnetworks.station_network.chat_channels.Remove(src) SSmodular_computers.chat_channels.Remove(src)
return ..() return ..()
/datum/ntnet_conversation/proc/add_message(message, username) /datum/ntnet_conversation/proc/add_message(message, username)

View File

@@ -511,7 +511,7 @@
if(!get_ntnet_status()) if(!get_ntnet_status())
return FALSE return FALSE
var/obj/item/computer_hardware/network_card/network_card = all_components[MC_NET] var/obj/item/computer_hardware/network_card/network_card = all_components[MC_NET]
return SSnetworks.station_network.add_log(text, network_card) return SSmodular_computers.add_log(text, network_card)
/obj/item/modular_computer/proc/shutdown_computer(loud = TRUE) /obj/item/modular_computer/proc/shutdown_computer(loud = TRUE)
kill_program(forced = TRUE) kill_program(forced = TRUE)

View File

@@ -16,12 +16,12 @@
/// Short description of this program's function. /// Short description of this program's function.
var/extended_desc = "N/A" var/extended_desc = "N/A"
/// Category in the NTDownloader. /// Category in the NTDownloader.
var/category = PROGRAM_CATEGORY_MISC var/category
/// Program-specific screen icon state /// Program-specific screen icon state
var/program_icon_state = null var/program_icon_state = null
/// Set to 1 for program to require nonstop NTNet connection to run. If NTNet connection is lost program crashes. /// Set to 1 for program to require nonstop NTNet connection to run. If NTNet connection is lost program crashes.
var/requires_ntnet = FALSE var/requires_ntnet = FALSE
/// Optional, if above is set to 1 checks for specific function of NTNet (currently NTNET_SOFTWAREDOWNLOAD, NTNET_PEERTOPEER, NTNET_SYSTEMCONTROL and NTNET_COMMUNICATION) /// Optional, if above is set to 1 checks for specific function of NTNet (currently NTNET_SOFTWAREDOWNLOAD and NTNET_COMMUNICATION)
var/requires_ntnet_feature = 0 var/requires_ntnet_feature = 0
/// 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. /// 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/ntnet_status = 1 var/ntnet_status = 1

View File

@@ -1,7 +1,7 @@
/datum/computer_file/program/ai /datum/computer_file/program/ai
filename = "DEBUG" filename = "DEBUG"
filedesc = "DEBUG" filedesc = "DEBUG"
category = PROGRAM_CATEGORY_ENGI category = PROGRAM_CATEGORY_ENGINEERING
program_icon_state = "power_monitor" program_icon_state = "power_monitor"
extended_desc = "This program connects to a local AI network to allow for administrative access" extended_desc = "This program connects to a local AI network to allow for administrative access"
ui_header = "power_norm.gif" ui_header = "power_norm.gif"

View File

@@ -3,7 +3,7 @@ GLOBAL_LIST_EMPTY(PDABombCodes)
/datum/computer_file/program/bomberman /datum/computer_file/program/bomberman
filename = "bomberman" filename = "bomberman"
filedesc = "BomberMan" filedesc = "BomberMan"
category = PROGRAM_CATEGORY_MISC category = PROGRAM_CATEGORY_EQUIPMENT
program_icon_state = "hostile" program_icon_state = "hostile"
extended_desc = "A new-age version of the classic 'Detomatix' program run on legacy PDAs. Can be used to attempt detonation of any PDA on the messaging list." extended_desc = "A new-age version of the classic 'Detomatix' program run on legacy PDAs. Can be used to attempt detonation of any PDA on the messaging list."
size = 5 size = 5

View File

@@ -1,7 +1,7 @@
/datum/computer_file/program/contract_uplink /datum/computer_file/program/contract_uplink
filename = "contractor uplink" filename = "contractor uplink"
filedesc = "Syndicate Contractor Uplink" filedesc = "Syndicate Contractor Uplink"
category = PROGRAM_CATEGORY_MISC category = PROGRAM_CATEGORY_EQUIPMENT
program_icon_state = "assign" program_icon_state = "assign"
extended_desc = "A standard, Syndicate issued system for handling important contracts while on the field." extended_desc = "A standard, Syndicate issued system for handling important contracts while on the field."
size = 10 size = 10

View File

@@ -1,7 +1,7 @@
/datum/computer_file/program/ntnet_dos /datum/computer_file/program/ntnet_dos
filename = "ntn_dos" filename = "ntn_dos"
filedesc = "DoS Traffic Generator" filedesc = "DoS Traffic Generator"
category = PROGRAM_CATEGORY_MISC category = PROGRAM_CATEGORY_EQUIPMENT
program_icon_state = "hostile" program_icon_state = "hostile"
extended_desc = "This advanced script can perform denial of service attacks against NTNet quantum relays. The system administrator will probably notice this. Multiple devices can run this program together against the same relay for increased effect" extended_desc = "This advanced script can perform denial of service attacks against NTNet quantum relays. The system administrator will probably notice this. Multiple devices can run this program together against the same relay for increased effect"
size = 20 size = 20
@@ -46,7 +46,7 @@
computer.play_interact_sound() computer.play_interact_sound()
switch(action) switch(action)
if("PRG_target_relay") if("PRG_target_relay")
for(var/obj/machinery/ntnet_relay/R in SSnetworks.station_network.relays) for(var/obj/machinery/ntnet_relay/R as anything in SSmachines.get_machines_by_type(/obj/machinery/ntnet_relay))
if(R.uid == text2num(params["targid"])) if(R.uid == text2num(params["targid"]))
target = R target = R
break break
@@ -62,14 +62,14 @@
if(target) if(target)
executed = TRUE executed = TRUE
target.dos_sources.Add(src) target.dos_sources.Add(src)
if(SSnetworks.station_network.intrusion_detection_enabled) if(SSmodular_computers.intrusion_detection_enabled)
var/obj/item/computer_hardware/network_card/network_card = computer.all_components[MC_NET] var/obj/item/computer_hardware/network_card/network_card = computer.all_components[MC_NET]
SSnetworks.station_network.add_log("IDS WARNING - Excess traffic flood targeting relay [target.uid] detected from device: [network_card.get_network_tag()]") SSmodular_computers.add_log("IDS WARNING - Excess traffic flood targeting relay [target.uid] detected from device: [network_card.get_network_tag()]")
SSnetworks.station_network.intrusion_detection_alarm = TRUE SSmodular_computers.intrusion_detection_alarm = TRUE
return TRUE return TRUE
/datum/computer_file/program/ntnet_dos/ui_data(mob/user) /datum/computer_file/program/ntnet_dos/ui_data(mob/user)
if(!SSnetworks.station_network) if(!SSmodular_computers)
return return
var/list/data = get_header_data() var/list/data = get_header_data()
@@ -84,7 +84,7 @@
else else
data["target"] = FALSE data["target"] = FALSE
data["relays"] = list() data["relays"] = list()
for(var/obj/machinery/ntnet_relay/R in SSnetworks.station_network.relays) for(var/obj/machinery/ntnet_relay/R as anything in SSmachines.get_machines_by_type(/obj/machinery/ntnet_relay))
data["relays"] += list(list("id" = R.uid)) data["relays"] += list(list("id" = R.uid))
data["focus"] = target ? target.uid : null data["focus"] = target ? target.uid : null

View File

@@ -3,7 +3,7 @@ GLOBAL_LIST_EMPTY(PDAFrameCodes)
/datum/computer_file/program/frame /datum/computer_file/program/frame
filename = "frame" filename = "frame"
filedesc = "F.R.A.M.E." filedesc = "F.R.A.M.E."
category = PROGRAM_CATEGORY_MISC category = PROGRAM_CATEGORY_EQUIPMENT
program_icon_state = "hostile" program_icon_state = "hostile"
extended_desc = "A new-age version of the classic 'F.R.A.M.E.' program run on legacy PDAs. Can be used to silently open an uplink on any PDA on the messaging list." extended_desc = "A new-age version of the classic 'F.R.A.M.E.' program run on legacy PDAs. Can be used to silently open an uplink on any PDA on the messaging list."
size = 5 size = 5

View File

@@ -1,7 +1,7 @@
/datum/computer_file/program/revelation /datum/computer_file/program/revelation
filename = "revelation" filename = "revelation"
filedesc = "Revelation" filedesc = "Revelation"
category = PROGRAM_CATEGORY_MISC category = PROGRAM_CATEGORY_EQUIPMENT
program_icon_state = "hostile" program_icon_state = "hostile"
extended_desc = "This virus can destroy hard drive of system it is executed on. It may be obfuscated to look like another non-malicious program. Once armed, it will destroy the system upon next execution." extended_desc = "This virus can destroy hard drive of system it is executed on. It may be obfuscated to look like another non-malicious program. Once armed, it will destroy the system upon next execution."
size = 13 size = 13

View File

@@ -8,6 +8,7 @@
size = 6 size = 6
tgui_id = "NtosArcade" tgui_id = "NtosArcade"
program_icon = "gamepad" program_icon = "gamepad"
category = PROGRAM_CATEGORY_GAMES
var/game_active = TRUE //Checks to see if a game is in progress. var/game_active = TRUE //Checks to see if a game is in progress.
var/pause_state = FALSE //This disables buttons in order to prevent multiple actions before the opponent's actions. var/pause_state = FALSE //This disables buttons in order to prevent multiple actions before the opponent's actions.

View File

@@ -16,6 +16,7 @@
program_icon_state = "arcade" program_icon_state = "arcade"
extended_desc = "Nanotrasen does not permit anyone under the age of 21 to partake in gambling. Requires an NTNet connection." extended_desc = "Nanotrasen does not permit anyone under the age of 21 to partake in gambling. Requires an NTNet connection."
requires_ntnet = TRUE requires_ntnet = TRUE
category = PROGRAM_CATEGORY_GAMES
network_destination = "arcade network" network_destination = "arcade network"
size = 4 size = 4
tgui_id = "NtosBlackjack" tgui_id = "NtosBlackjack"

View File

@@ -1,7 +1,7 @@
/datum/computer_file/program/budget_monitor /datum/computer_file/program/budget_monitor
filename = "budgetmonitor" filename = "budgetmonitor"
filedesc = "Budget Monitor" filedesc = "Budget Monitor"
category = PROGRAM_CATEGORY_CMD category = PROGRAM_CATEGORY_SUPPLY
program_icon_state = "id" program_icon_state = "id"
extended_desc = "This program will allow you to view the financial status of your department(s)." extended_desc = "This program will allow you to view the financial status of your department(s)."
transfer_access = ACCESS_HEADS transfer_access = ACCESS_HEADS

View File

@@ -9,7 +9,7 @@
/datum/computer_file/program/card_mod /datum/computer_file/program/card_mod
filename = "cardmod" filename = "cardmod"
filedesc = "ID Card Modification" filedesc = "ID Card Modification"
category = PROGRAM_CATEGORY_CMD category = PROGRAM_CATEGORY_EQUIPMENT
program_icon_state = "id" program_icon_state = "id"
extended_desc = "Program for programming employee ID cards to access parts of the station." extended_desc = "Program for programming employee ID cards to access parts of the station."
transfer_access = ACCESS_HEADS transfer_access = ACCESS_HEADS

View File

@@ -1,7 +1,7 @@
/datum/computer_file/program/crew_manifest /datum/computer_file/program/crew_manifest
filename = "crewmani" filename = "crewmani"
filedesc = "Crew Manifest" filedesc = "Crew Manifest"
category = PROGRAM_CATEGORY_CMD category = PROGRAM_CATEGORY_SECURITY
program_icon_state = "id" program_icon_state = "id"
extended_desc = "Program for viewing and printing the current crew manifest." extended_desc = "Program for viewing and printing the current crew manifest."
requires_ntnet = FALSE requires_ntnet = FALSE

View File

@@ -1,7 +1,7 @@
/datum/computer_file/program/job_management /datum/computer_file/program/job_management
filename = "job_manage" filename = "job_manage"
filedesc = "Job Manager" filedesc = "Job Manager"
category = PROGRAM_CATEGORY_CMD category = PROGRAM_CATEGORY_EQUIPMENT
program_icon_state = "id" program_icon_state = "id"
extended_desc = "Program for viewing and changing job slot availability." extended_desc = "Program for viewing and changing job slot availability."
transfer_access = ACCESS_HEADS transfer_access = ACCESS_HEADS

View File

@@ -9,7 +9,7 @@ GLOBAL_LIST_INIT(granted_synthetic_access, list())
/datum/computer_file/program/synth_requester /datum/computer_file/program/synth_requester
filename = "synth_req" filename = "synth_req"
filedesc = "Synthetic Manager" filedesc = "Synthetic Manager"
category = PROGRAM_CATEGORY_CMD category = PROGRAM_CATEGORY_EQUIPMENT
program_icon_state = "id" program_icon_state = "id"
extended_desc = "Program for requesting synthetic assistance and granting departmental access." extended_desc = "Program for requesting synthetic assistance and granting departmental access."
transfer_access = ACCESS_HEADS transfer_access = ACCESS_HEADS

View File

@@ -1,7 +1,7 @@
/datum/computer_file/program/alarm_monitor /datum/computer_file/program/alarm_monitor
filename = "alarmmonitor" filename = "alarmmonitor"
filedesc = "Alarm Monitor" filedesc = "Alarm Monitor"
category = PROGRAM_CATEGORY_ENGI category = PROGRAM_CATEGORY_ENGINEERING
ui_header = "alarm_green.gif" ui_header = "alarm_green.gif"
program_icon_state = "alert-green" program_icon_state = "alert-green"
extended_desc = "This program provides visual interface for station's alarm system." extended_desc = "This program provides visual interface for station's alarm system."

View File

@@ -1,7 +1,7 @@
/datum/computer_file/program/atmosscan /datum/computer_file/program/atmosscan
filename = "atmosscan" filename = "atmosscan"
filedesc = "Atmospheric Scanner" filedesc = "Atmospheric Scanner"
category = PROGRAM_CATEGORY_ENGI category = PROGRAM_CATEGORY_ENGINEERING
program_icon_state = "air" program_icon_state = "air"
extended_desc = "A small built-in sensor reads out the atmospheric conditions around the device." extended_desc = "A small built-in sensor reads out the atmospheric conditions around the device."
network_destination = "atmos scan" network_destination = "atmos scan"

View File

@@ -2,7 +2,7 @@
/datum/computer_file/program/energy_harvester_control /datum/computer_file/program/energy_harvester_control
filename = "energy_harvester_control" filename = "energy_harvester_control"
filedesc = "Energy Harvester Control" filedesc = "Energy Harvester Control"
category = PROGRAM_CATEGORY_ENGI category = PROGRAM_CATEGORY_ENGINEERING
ui_header = "energy_harvester_null.gif" ui_header = "energy_harvester_null.gif"
program_icon_state = "energy_harvester_null" program_icon_state = "energy_harvester_null"
extended_desc = "This program connects remotely to the onboard energy harvester, allowing a chief engineer to control the input rates and check for cashflow." extended_desc = "This program connects remotely to the onboard energy harvester, allowing a chief engineer to control the input rates and check for cashflow."

View File

@@ -1,7 +1,7 @@
/datum/computer_file/program/ntnetmonitor /datum/computer_file/program/ntnetmonitor
filename = "ntmonitor" filename = "ntmonitor"
filedesc = "NTNet Diagnostics and Monitoring" filedesc = "NTNet Diagnostics and Monitoring"
category = PROGRAM_CATEGORY_ENGI category = PROGRAM_CATEGORY_ENGINEERING
program_icon_state = "comm_monitor" program_icon_state = "comm_monitor"
extended_desc = "This program monitors stationwide NTNet network, provides access to logging systems, and allows for configuration changes." extended_desc = "This program monitors stationwide NTNet network, provides access to logging systems, and allows for configuration changes."
size = 12 size = 12
@@ -18,60 +18,41 @@
computer.play_interact_sound() computer.play_interact_sound()
switch(action) switch(action)
if("resetIDS") if("resetIDS")
if(SSnetworks.station_network) SSmodular_computers.intrusion_detection_alarm = FALSE
SSnetworks.station_network.resetIDS()
return TRUE return TRUE
if("toggleIDS") if("toggleIDS")
if(SSnetworks.station_network) SSmodular_computers.intrusion_detection_enabled = !SSmodular_computers.intrusion_detection_enabled
SSnetworks.station_network.toggleIDS()
return TRUE
if("toggleWireless")
if(!SSnetworks.station_network)
return
// NTNet is disabled. Enabling can be done without user prompt
if(SSnetworks.station_network.setting_disabled)
SSnetworks.station_network.setting_disabled = FALSE
return TRUE
SSnetworks.station_network.setting_disabled = TRUE
return TRUE return TRUE
if("purgelogs") if("purgelogs")
if(SSnetworks.station_network) SSmodular_computers.purge_logs()
SSnetworks.station_network.purge_logs()
return TRUE
if("updatemaxlogs")
var/logcount = params["new_number"]
if(SSnetworks.station_network)
SSnetworks.station_network.update_max_log_count(logcount)
return TRUE return TRUE
if("toggle_function") if("toggle_function")
if(!SSnetworks.station_network) SSmodular_computers.toggle_function(text2num(params["id"]))
return
SSnetworks.station_network.toggle_function(text2num(params["id"]))
return TRUE return TRUE
/datum/computer_file/program/ntnetmonitor/ui_data(mob/user) /datum/computer_file/program/ntnetmonitor/ui_data(mob/user)
if(!SSnetworks.station_network) if(!SSmodular_computers)
return return
var/list/data = get_header_data() var/list/data = get_header_data()
data["ntnetstatus"] = SSnetworks.station_network.check_function() data["ntnetstatus"] = SSmodular_computers.check_function()
data["ntnetrelays"] = SSnetworks.station_network.relays.len data["idsstatus"] = SSmodular_computers.intrusion_detection_enabled
data["idsstatus"] = SSnetworks.station_network.intrusion_detection_enabled data["idsalarm"] = SSmodular_computers.intrusion_detection_alarm
data["idsalarm"] = SSnetworks.station_network.intrusion_detection_alarm
data["config_softwaredownload"] = SSnetworks.station_network.setting_softwaredownload data["ntnetrelays"] = list()
data["config_peertopeer"] = SSnetworks.station_network.setting_peertopeer for(var/obj/machinery/ntnet_relay/relays as anything in SSmachines.get_machines_by_type(/obj/machinery/ntnet_relay))
data["config_communication"] = SSnetworks.station_network.setting_communication var/list/relay_data = list()
data["config_systemcontrol"] = SSnetworks.station_network.setting_systemcontrol relay_data["is_operational"] = relays.is_operational()
relay_data["name"] = relays.name
relay_data["ref"] = REF(relays)
data["ntnetrelays"] += list(relay_data)
data["config_softwaredownload"] = SSmodular_computers.setting_softwaredownload
data["config_communication"] = SSmodular_computers.setting_communication
data["ntnetlogs"] = list() data["ntnetlogs"] = list()
data["minlogs"] = MIN_NTNET_LOGS for(var/i in SSmodular_computers.modpc_logs)
data["maxlogs"] = MAX_NTNET_LOGS
for(var/i in SSnetworks.station_network.logs)
data["ntnetlogs"] += list(list("entry" = i)) data["ntnetlogs"] += list(list("entry" = i))
data["ntnetmaxlogs"] = SSnetworks.station_network.setting_maxlogcount
return data return data

View File

@@ -3,7 +3,7 @@
/datum/computer_file/program/power_monitor /datum/computer_file/program/power_monitor
filename = "powermonitor" filename = "powermonitor"
filedesc = "Power Monitor" filedesc = "Power Monitor"
category = PROGRAM_CATEGORY_ENGI category = PROGRAM_CATEGORY_ENGINEERING
program_icon_state = "power_monitor" program_icon_state = "power_monitor"
extended_desc = "This program connects to sensors around the station to provide information about electrical systems." extended_desc = "This program connects to sensors around the station to provide information about electrical systems."
ui_header = "power_norm.gif" ui_header = "power_norm.gif"

View File

@@ -2,7 +2,7 @@
/datum/computer_file/program/nuclear_monitor /datum/computer_file/program/nuclear_monitor
filename = "agcnrmonitor" filename = "agcnrmonitor"
filedesc = "Nuclear Reactor Monitoring" filedesc = "Nuclear Reactor Monitoring"
category = PROGRAM_CATEGORY_ENGI category = PROGRAM_CATEGORY_ENGINEERING
ui_header = "smmon_0.gif" ui_header = "smmon_0.gif"
program_icon_state = "smmon_0" program_icon_state = "smmon_0"
extended_desc = "This program connects to specially calibrated sensors to provide information on the status of nuclear reactors." extended_desc = "This program connects to specially calibrated sensors to provide information on the status of nuclear reactors."

View File

@@ -1,7 +1,7 @@
/datum/computer_file/program/supermatter_monitor /datum/computer_file/program/supermatter_monitor
filename = "smmonitor" filename = "smmonitor"
filedesc = "Supermatter Monitoring" filedesc = "Supermatter Monitoring"
category = PROGRAM_CATEGORY_ENGI category = PROGRAM_CATEGORY_ENGINEERING
ui_header = "smmon_0.gif" ui_header = "smmon_0.gif"
program_icon_state = "smmon_0" program_icon_state = "smmon_0"
extended_desc = "This program connects to specially calibrated supermatter sensors to provide information on the status of supermatter-based engines." extended_desc = "This program connects to specially calibrated supermatter sensors to provide information on the status of supermatter-based engines."

View File

@@ -1,7 +1,7 @@
/datum/computer_file/program/chemscan /datum/computer_file/program/chemscan
filename = "chemscan" filename = "chemscan"
filedesc = "Chemical Scanner" filedesc = "Chemical Scanner"
category = PROGRAM_CATEGORY_MED category = PROGRAM_CATEGORY_DEVICE
program_icon_state = "air" program_icon_state = "air"
extended_desc = "A small built-in sensor reads out the chemicals in an item." extended_desc = "A small built-in sensor reads out the chemicals in an item."
network_destination = "chem scan" network_destination = "chem scan"

View File

@@ -2,7 +2,7 @@
filename = "crewmon" filename = "crewmon"
filedesc = "Crew Suit Sensor Monitor" filedesc = "Crew Suit Sensor Monitor"
extended_desc = "This program allows for viewing of crew members vitals via their suit sensors." extended_desc = "This program allows for viewing of crew members vitals via their suit sensors."
category = PROGRAM_CATEGORY_MED category = PROGRAM_CATEGORY_EQUIPMENT
ui_header = "health_green.gif" ui_header = "health_green.gif"
program_icon_state = "crew" program_icon_state = "crew"
requires_ntnet = FALSE requires_ntnet = FALSE

View File

@@ -14,6 +14,7 @@
program_icon_state = "arcade" program_icon_state = "arcade"
extended_desc = "A port of the classic game 'Minesweeper', redesigned to run on tablets." extended_desc = "A port of the classic game 'Minesweeper', redesigned to run on tablets."
requires_ntnet = FALSE requires_ntnet = FALSE
category = PROGRAM_CATEGORY_GAMES
network_destination = "arcade network" network_destination = "arcade network"
size = 6 size = 6
tgui_id = "NtosMinesweeper" tgui_id = "NtosMinesweeper"

View File

@@ -21,25 +21,18 @@
var/downloaderror = "" var/downloaderror = ""
var/obj/item/modular_computer/my_computer = null var/obj/item/modular_computer/my_computer = null
var/emagged = FALSE var/emagged = FALSE
var/list/main_repo
var/list/antag_repo
var/list/show_categories = list( ///The list of categories to display in the UI, in order of which they appear.
PROGRAM_CATEGORY_CMD, var/static/list/show_categories = list(
PROGRAM_CATEGORY_SEC, PROGRAM_CATEGORY_DEVICE,
PROGRAM_CATEGORY_ENGI, PROGRAM_CATEGORY_EQUIPMENT,
PROGRAM_CATEGORY_SCI, PROGRAM_CATEGORY_GAMES,
PROGRAM_CATEGORY_MED, PROGRAM_CATEGORY_SECURITY,
PROGRAM_CATEGORY_SUPL, PROGRAM_CATEGORY_ENGINEERING,
PROGRAM_CATEGORY_MISC, PROGRAM_CATEGORY_SUPPLY,
PROGRAM_CATEGORY_SCIENCE,
) )
/datum/computer_file/program/ntnetdownload/run_program()
. = ..()
main_repo = SSnetworks.station_network.available_station_software
antag_repo = SSnetworks.station_network.available_antag_software
/datum/computer_file/program/ntnetdownload/run_emag() /datum/computer_file/program/ntnetdownload/run_emag()
if(emagged) if(emagged)
return FALSE return FALSE
@@ -49,7 +42,7 @@
if(downloaded_file) if(downloaded_file)
return FALSE return FALSE
var/datum/computer_file/program/PRG = SSnetworks.station_network.find_ntnet_file_by_name(filename) var/datum/computer_file/program/PRG = SSmodular_computers.find_ntnet_file_by_name(filename)
if(!PRG || !istype(PRG)) if(!PRG || !istype(PRG))
return FALSE return FALSE
@@ -65,10 +58,10 @@
ui_header = "downloader_running.gif" ui_header = "downloader_running.gif"
if(PRG in main_repo) if(PRG in SSmodular_computers.available_station_software)
generate_network_log("Began downloading file [PRG.filename].[PRG.filetype] from NTNet Software Repository.") generate_network_log("Began downloading file [PRG.filename].[PRG.filetype] from NTNet Software Repository.")
hacked_download = FALSE hacked_download = FALSE
else if(PRG in antag_repo) else if(PRG in SSmodular_computers.available_antag_software)
generate_network_log("Began downloading file **ENCRYPTED**.[PRG.filetype] from unspecified server.") generate_network_log("Began downloading file **ENCRYPTED**.[PRG.filetype] from unspecified server.")
hacked_download = TRUE hacked_download = TRUE
else else
@@ -123,7 +116,7 @@
if(ntnet_status != 3) // Ethernet unaffected by distance if(ntnet_status != 3) // Ethernet unaffected by distance
var/dist = 100 var/dist = 100
// Loop through every ntnet relay, find the closest one and use that // Loop through every ntnet relay, find the closest one and use that
for(var/obj/machinery/ntnet_relay/n in SSnetworks.station_network.relays) for(var/obj/machinery/ntnet_relay/n as anything in SSmachines.get_machines_by_type(/obj/machinery/ntnet_relay))
var/cur_dist = get_dist_euclidian(n, computer) var/cur_dist = get_dist_euclidian(n, computer)
if(n.is_operational() && cur_dist <= dist) if(n.is_operational() && cur_dist <= dist)
dist = cur_dist dist = cur_dist
@@ -151,15 +144,14 @@
return FALSE return FALSE
/datum/computer_file/program/ntnetdownload/ui_data(mob/user) /datum/computer_file/program/ntnetdownload/ui_data(mob/user)
var/list/data = get_header_data()
my_computer = computer my_computer = computer
if(!istype(my_computer)) if(!istype(my_computer))
return return data
var/obj/item/computer_hardware/card_slot/card_slot = computer.all_components[MC_CARD] var/obj/item/computer_hardware/card_slot/card_slot = computer.all_components[MC_CARD]
var/list/access = card_slot?.GetAccess() var/list/access = card_slot?.GetAccess()
var/list/data = get_header_data()
data["downloading"] = !!downloaded_file data["downloading"] = !!downloaded_file
data["error"] = downloaderror || FALSE data["error"] = downloaderror || FALSE
@@ -176,34 +168,31 @@
data["disk_used"] = hard_drive.used_capacity data["disk_used"] = hard_drive.used_capacity
data["emagged"] = emagged data["emagged"] = emagged
var/list/repo = antag_repo | main_repo var/list/repo = SSmodular_computers.available_antag_software | SSmodular_computers.available_station_software
var/list/program_categories = list()
for(var/I in repo) data["programs"] = list()
var/datum/computer_file/program/P = I for(var/datum/computer_file/program/programs as anything in repo)
if(!(P.category in program_categories))
program_categories.Add(P.category)
data["programs"] += list(list( data["programs"] += list(list(
"icon" = P.program_icon, "icon" = programs.program_icon,
"filename" = P.filename, "filename" = programs.filename,
"filedesc" = P.filedesc, "filedesc" = programs.filedesc,
"fileinfo" = P.extended_desc, "fileinfo" = programs.extended_desc,
"category" = P.category, "category" = programs.category,
"installed" = !!hard_drive.find_file_by_name(P.filename), "installed" = !!hard_drive.find_file_by_name(programs.filename),
"compatible" = check_compatibility(P), "compatible" = check_compatibility(programs),
"size" = P.size, "size" = programs.size,
"access" = emagged ? TRUE : P.can_run(user,transfer = 1, access = access), "access" = programs.can_run(user, transfer = TRUE, access = access),
"verifiedsource" = P.available_on_ntnet, "verifiedsource" = programs.available_on_ntnet,
)) ))
data["categories"] = show_categories & program_categories data["categories"] = show_categories
return data return data
/datum/computer_file/program/ntnetdownload/proc/check_compatibility(datum/computer_file/program/P) /datum/computer_file/program/ntnetdownload/proc/check_compatibility(datum/computer_file/program/P)
var/hardflag = computer.hardware_flag var/hardflag = computer.hardware_flag
if(P && P.is_supported_by_hardware(hardflag,0)) if(P && P.is_supported_by_hardware(hardflag, 0))
return TRUE return TRUE
return FALSE return FALSE
@@ -230,8 +219,3 @@
ui_header = "downloader_finished.gif" ui_header = "downloader_finished.gif"
tgui_id = "NtosNetDownloader" tgui_id = "NtosNetDownloader"
emagged = TRUE emagged = TRUE
/datum/computer_file/program/ntnetdownload/syndicate/run_program()
. = ..()
main_repo = SSnetworks.station_network.available_antag_software
antag_repo = null

View File

@@ -1,7 +1,7 @@
/datum/computer_file/program/chatclient /datum/computer_file/program/chatclient
filename = "ntnrc_client" filename = "ntnrc_client"
filedesc = "Chat Client" filedesc = "Chat Client"
category = PROGRAM_CATEGORY_MISC category = PROGRAM_CATEGORY_DEVICE
program_icon_state = "command" program_icon_state = "command"
extended_desc = "This program allows communication over NTNRC network" extended_desc = "This program allows communication over NTNRC network"
size = 8 size = 8
@@ -27,7 +27,7 @@
if(..()) if(..())
return return
var/datum/ntnet_conversation/channel = SSnetworks.station_network.get_chat_channel_by_id(active_channel) var/datum/ntnet_conversation/channel = SSmodular_computers.get_chat_channel_by_id(active_channel)
var/authed = FALSE var/authed = FALSE
computer.play_interact_sound() computer.play_interact_sound()
if(channel && ((channel.operator == src) || netadmin_mode)) if(channel && ((channel.operator == src) || netadmin_mode))
@@ -69,7 +69,7 @@
return TRUE return TRUE
active_channel = new_target active_channel = new_target
channel = SSnetworks.station_network.get_chat_channel_by_id(new_target) channel = SSmodular_computers.get_chat_channel_by_id(new_target)
if(!(src in channel.clients) && !channel.password) if(!(src in channel.clients) && !channel.password)
channel.add_client(src) channel.add_client(src)
return TRUE return TRUE
@@ -107,7 +107,7 @@
return TRUE return TRUE
var/mob/living/user = usr var/mob/living/user = usr
if(can_run(user, TRUE, ACCESS_NETWORK)) if(can_run(user, TRUE, ACCESS_NETWORK))
for(var/C in SSnetworks.station_network.chat_channels) for(var/C in SSmodular_computers.chat_channels)
var/datum/ntnet_conversation/chan = C var/datum/ntnet_conversation/chan = C
chan.remove_client(src) chan.remove_client(src)
netadmin_mode = TRUE netadmin_mode = TRUE
@@ -127,7 +127,7 @@
log_say(log_message) log_say(log_message)
return return
//yogs end //yogs end
for(var/C in SSnetworks.station_network.chat_channels) for(var/C in SSmodular_computers.chat_channels)
var/datum/ntnet_conversation/chan = C var/datum/ntnet_conversation/chan = C
if(src in chan.clients) if(src in chan.clients)
chan.add_status_message("[username] is now known as [newname].") chan.add_status_message("[username] is now known as [newname].")
@@ -206,7 +206,7 @@
/datum/computer_file/program/chatclient/process_tick() /datum/computer_file/program/chatclient/process_tick()
. = ..() . = ..()
var/datum/ntnet_conversation/channel = SSnetworks.station_network.get_chat_channel_by_id(active_channel) var/datum/ntnet_conversation/channel = SSmodular_computers.get_chat_channel_by_id(active_channel)
if(program_state != PROGRAM_STATE_KILLED) if(program_state != PROGRAM_STATE_KILLED)
ui_header = "ntnrc_idle.gif" ui_header = "ntnrc_idle.gif"
if(channel) if(channel)
@@ -221,7 +221,7 @@
ui_header = "ntnrc_idle.gif" ui_header = "ntnrc_idle.gif"
/datum/computer_file/program/chatclient/kill_program(forced = FALSE) /datum/computer_file/program/chatclient/kill_program(forced = FALSE)
for(var/C in SSnetworks.station_network.chat_channels) for(var/C in SSmodular_computers.chat_channels)
var/datum/ntnet_conversation/channel = C var/datum/ntnet_conversation/channel = C
channel.remove_client(src) channel.remove_client(src)
..() ..()
@@ -232,7 +232,7 @@
return data return data
/datum/computer_file/program/chatclient/ui_data(mob/user) /datum/computer_file/program/chatclient/ui_data(mob/user)
if(!SSnetworks.station_network || !SSnetworks.station_network.chat_channels) if(!SSmodular_computers || !SSmodular_computers.chat_channels)
return list() return list()
var/list/data = list() var/list/data = list()
@@ -240,7 +240,7 @@
data = get_header_data() data = get_header_data()
var/list/all_channels = list() var/list/all_channels = list()
for(var/C in SSnetworks.station_network.chat_channels) for(var/C in SSmodular_computers.chat_channels)
var/datum/ntnet_conversation/conv = C var/datum/ntnet_conversation/conv = C
if(conv && conv.title) if(conv && conv.title)
all_channels.Add(list(list( all_channels.Add(list(list(
@@ -252,7 +252,7 @@
data["active_channel"] = active_channel data["active_channel"] = active_channel
data["username"] = username data["username"] = username
data["adminmode"] = netadmin_mode data["adminmode"] = netadmin_mode
var/datum/ntnet_conversation/channel = SSnetworks.station_network.get_chat_channel_by_id(active_channel) var/datum/ntnet_conversation/channel = SSmodular_computers.get_chat_channel_by_id(active_channel)
if(channel) if(channel)
data["title"] = channel.title data["title"] = channel.title
var/authed = FALSE var/authed = FALSE

View File

@@ -7,7 +7,7 @@ GLOBAL_LIST_EMPTY(NTPDAMessages)
/datum/computer_file/program/pdamessager /datum/computer_file/program/pdamessager
filename = "pda_client" filename = "pda_client"
filedesc = "PDA Messaging" filedesc = "PDA Messaging"
category = PROGRAM_CATEGORY_MISC category = PROGRAM_CATEGORY_DEVICE
program_icon_state = "command" program_icon_state = "command"
extended_desc = "This program allows for direct messaging with other modular computers" extended_desc = "This program allows for direct messaging with other modular computers"
size = 3 size = 3

View File

@@ -2,7 +2,7 @@
/datum/computer_file/program/paperwork_printer /datum/computer_file/program/paperwork_printer
filename = "ppwrkprnt" filename = "ppwrkprnt"
filedesc = "Paperwork Printing" filedesc = "Paperwork Printing"
category = PROGRAM_CATEGORY_MISC category = PROGRAM_CATEGORY_EQUIPMENT
program_icon_state = "id" program_icon_state = "id"
extended_desc = "Program for dispensing paperwork." extended_desc = "Program for dispensing paperwork."
requires_ntnet = FALSE requires_ntnet = FALSE

View File

@@ -15,6 +15,7 @@
extended_desc = "This program connects to a Spinward Sector community art site for viewing and printing art." extended_desc = "This program connects to a Spinward Sector community art site for viewing and printing art."
transfer_access = ACCESS_LIBRARY transfer_access = ACCESS_LIBRARY
usage_flags = PROGRAM_CONSOLE | PROGRAM_TELESCREEN usage_flags = PROGRAM_CONSOLE | PROGRAM_TELESCREEN
category = PROGRAM_CATEGORY_EQUIPMENT
requires_ntnet = TRUE requires_ntnet = TRUE
size = 9 size = 9
tgui_id = "NtosPortraitPrinter" tgui_id = "NtosPortraitPrinter"

View File

@@ -219,7 +219,7 @@
requires_ntnet = FALSE //Tracking should not require NTNET, as sensors are not on the network at all, and the program is downloaded locally. requires_ntnet = FALSE //Tracking should not require NTNET, as sensors are not on the network at all, and the program is downloaded locally.
transfer_access = ACCESS_MEDICAL transfer_access = ACCESS_MEDICAL
available_on_ntnet = TRUE available_on_ntnet = TRUE
category = PROGRAM_CATEGORY_MED category = PROGRAM_CATEGORY_EQUIPMENT
program_icon = "street-view" program_icon = "street-view"
/datum/computer_file/program/radar/lifeline/find_atom() /datum/computer_file/program/radar/lifeline/find_atom()
@@ -275,7 +275,7 @@
/datum/computer_file/program/radar/fission360 /datum/computer_file/program/radar/fission360
filename = "Fission360" filename = "Fission360"
filedesc = "Fission360" filedesc = "Fission360"
category = PROGRAM_CATEGORY_MISC category = PROGRAM_CATEGORY_EQUIPMENT
program_icon_state = "radarsyndicate" program_icon_state = "radarsyndicate"
extended_desc = "This program allows for tracking of nuclear authorization disks and warheads." extended_desc = "This program allows for tracking of nuclear authorization disks and warheads."
requires_ntnet = FALSE requires_ntnet = FALSE
@@ -321,7 +321,7 @@
/datum/computer_file/program/radar/implant /datum/computer_file/program/radar/implant
filename = "implanttracker" filename = "implanttracker"
filedesc = "Implant Tracker" filedesc = "Implant Tracker"
category = PROGRAM_CATEGORY_SEC category = PROGRAM_CATEGORY_SECURITY
extended_desc = "This program allows for tracking those implanted with tracking implants." extended_desc = "This program allows for tracking those implanted with tracking implants."
requires_ntnet = FALSE //Same as Lifeline. requires_ntnet = FALSE //Same as Lifeline.
transfer_access = ACCESS_BRIG transfer_access = ACCESS_BRIG

View File

@@ -4,6 +4,7 @@
extended_desc = "A built-in app for cyborg self-management and diagnostics." extended_desc = "A built-in app for cyborg self-management and diagnostics."
ui_header = "robotact.gif" //DEBUG -- new icon before PR ui_header = "robotact.gif" //DEBUG -- new icon before PR
program_icon_state = "command" program_icon_state = "command"
category = PROGRAM_CATEGORY_SCIENCE
requires_ntnet = FALSE requires_ntnet = FALSE
transfer_access = null transfer_access = null
available_on_ntnet = FALSE available_on_ntnet = FALSE

View File

@@ -1,7 +1,7 @@
/datum/computer_file/program/aidiag /datum/computer_file/program/aidiag
filename = "aidiag" filename = "aidiag"
filedesc = "AI Integrity Restorer" filedesc = "AI Integrity Restorer"
category = PROGRAM_CATEGORY_SCI category = PROGRAM_CATEGORY_SCIENCE
program_icon_state = "generic" program_icon_state = "generic"
extended_desc = "This program is capable of reconstructing damaged AI systems. Requires direct AI connection via intellicard slot." extended_desc = "This program is capable of reconstructing damaged AI systems. Requires direct AI connection via intellicard slot."
size = 12 size = 12

View File

@@ -1,7 +1,7 @@
/datum/computer_file/program/borg_monitor /datum/computer_file/program/borg_monitor
filename = "cyborgmonitor" filename = "cyborgmonitor"
filedesc = "Cyborg Remote Monitoring" filedesc = "Cyborg Remote Monitoring"
category = PROGRAM_CATEGORY_SCI category = PROGRAM_CATEGORY_SCIENCE
ui_header = "borg_mon.gif" ui_header = "borg_mon.gif"
program_icon_state = "generic" program_icon_state = "generic"
extended_desc = "This program allows for remote monitoring of station cyborgs." extended_desc = "This program allows for remote monitoring of station cyborgs."
@@ -166,7 +166,7 @@
/datum/computer_file/program/borg_monitor/syndicate /datum/computer_file/program/borg_monitor/syndicate
filename = "scyborgmonitor" filename = "scyborgmonitor"
filedesc = "Mission-Specific Cyborg Remote Monitoring" filedesc = "Mission-Specific Cyborg Remote Monitoring"
category = PROGRAM_CATEGORY_SCI category = PROGRAM_CATEGORY_SCIENCE
ui_header = "borg_mon.gif" ui_header = "borg_mon.gif"
program_icon_state = "generic" program_icon_state = "generic"
extended_desc = "This program allows for remote monitoring of mission-assigned cyborgs." extended_desc = "This program allows for remote monitoring of mission-assigned cyborgs."

View File

@@ -2,7 +2,7 @@
/datum/computer_file/program/robocontrol /datum/computer_file/program/robocontrol
filename = "robocontrol" filename = "robocontrol"
filedesc = "Bot Remote Controller" filedesc = "Bot Remote Controller"
category = PROGRAM_CATEGORY_SCI category = PROGRAM_CATEGORY_SCIENCE
program_icon_state = "robot" program_icon_state = "robot"
extended_desc = "A remote controller used for giving basic commands to non-sentient robots." extended_desc = "A remote controller used for giving basic commands to non-sentient robots."
requires_ntnet = TRUE requires_ntnet = TRUE

View File

@@ -4,7 +4,7 @@
/datum/computer_file/program/secureye /datum/computer_file/program/secureye
filename = "secureye" filename = "secureye"
filedesc = "SecurEye" filedesc = "SecurEye"
category = PROGRAM_CATEGORY_SEC category = PROGRAM_CATEGORY_SECURITY
ui_header = "borg_mon.gif" ui_header = "borg_mon.gif"
program_icon_state = "generic" program_icon_state = "generic"
extended_desc = "This program allows access to standard security camera networks." extended_desc = "This program allows access to standard security camera networks."
@@ -186,7 +186,7 @@
/datum/computer_file/program/secureye/mining /datum/computer_file/program/secureye/mining
filename = "overwatch" filename = "overwatch"
filedesc = "OverWatch" filedesc = "OverWatch"
category = PROGRAM_CATEGORY_SUPL category = PROGRAM_CATEGORY_SUPPLY
extended_desc = "This program allows access to the mining base camera network." extended_desc = "This program allows access to the mining base camera network."
transfer_access = ACCESS_MINING transfer_access = ACCESS_MINING
size = 5 size = 5

View File

@@ -1,7 +1,7 @@
/datum/computer_file/program/bounty_board /datum/computer_file/program/bounty_board
filename = "bountyboard" filename = "bountyboard"
filedesc = "Bounty Board Request Network" filedesc = "Bounty Board Request Network"
category = PROGRAM_CATEGORY_SUPL category = PROGRAM_CATEGORY_SUPPLY
program_icon_state = "bountyboard" program_icon_state = "bountyboard"
extended_desc = "A multi-platform network for placing requests across the station, with payment across the network being possible." extended_desc = "A multi-platform network for placing requests across the station, with payment across the network being possible."
requires_ntnet = TRUE requires_ntnet = TRUE

View File

@@ -1,7 +1,7 @@
/datum/computer_file/program/budgetorders /datum/computer_file/program/budgetorders
filename = "orderapp" filename = "orderapp"
filedesc = "NT IRN" filedesc = "NT IRN"
category = PROGRAM_CATEGORY_SUPL category = PROGRAM_CATEGORY_SUPPLY
program_icon_state = "bountyboard" program_icon_state = "bountyboard"
extended_desc = "Nanotrasen Internal Requisition Network interface for supply purchasing using a department budget account." extended_desc = "Nanotrasen Internal Requisition Network interface for supply purchasing using a department budget account."
requires_ntnet = TRUE requires_ntnet = TRUE

View File

@@ -1,7 +1,7 @@
/datum/computer_file/program/cargobounty /datum/computer_file/program/cargobounty
filename = "bounty" filename = "bounty"
filedesc = "Nanotrasen Bounty Hunter" filedesc = "Nanotrasen Bounty Hunter"
category = PROGRAM_CATEGORY_SUPL category = PROGRAM_CATEGORY_SUPPLY
program_icon_state = "bountyboard" program_icon_state = "bountyboard"
extended_desc = "A basic interface for supply personnel to check and claim bounties." extended_desc = "A basic interface for supply personnel to check and claim bounties."
requires_ntnet = TRUE requires_ntnet = TRUE

View File

@@ -8,6 +8,7 @@
size = 2 size = 2
available_on_ntnet = TRUE available_on_ntnet = TRUE
requires_ntnet = FALSE requires_ntnet = FALSE
category = PROGRAM_CATEGORY_DEVICE
tgui_id = "NtosThemeConfigure" tgui_id = "NtosThemeConfigure"
program_icon="paint-roller" program_icon="paint-roller"

View File

@@ -33,16 +33,16 @@
// 0 - No signal, 1 - Low signal, 2 - High signal. 3 - Wired Connection // 0 - No signal, 1 - Low signal, 2 - High signal. 3 - Wired Connection
/obj/item/computer_hardware/network_card/proc/get_signal(specific_action = 0) /obj/item/computer_hardware/network_card/proc/get_signal(specific_action = 0)
if(!holder) // Hardware is not installed in anything. No signal. How did this even get called? if(!holder) // Hardware is not installed in anything. No signal. How did this even get called?
return 0 return NTNET_NO_SIGNAL
if(!check_functionality()) if(!check_functionality())
return 0 return NTNET_NO_SIGNAL
if(ethernet) // Computer is connected via wired connection. if(ethernet) // Computer is connected via wired connection.
return 3 return NTNET_ETHERNET_SIGNAL
if(!SSnetworks.station_network || !SSnetworks.station_network.check_function(specific_action)) // NTNet is down and we are not connected via wired connection. No signal. if(!SSmodular_computers || !SSmodular_computers.check_function(specific_action)) // NTNet is down and we are not connected via wired connection. No signal.
return 0 return NTNET_NO_SIGNAL
if(holder) if(holder)
@@ -50,14 +50,14 @@
if((T && istype(T)) && (is_station_level(T.z) || is_mining_level(T.z))) if((T && istype(T)) && (is_station_level(T.z) || is_mining_level(T.z)))
// Computer is on station. Low/High signal depending on what type of network card you have // Computer is on station. Low/High signal depending on what type of network card you have
if(long_range) if(long_range)
return 2 return NTNET_GOOD_SIGNAL
else else
return 1 return NTNET_LOW_SIGNAL
if(long_range) // Computer is not on station, but it has upgraded network card. Low signal. if(long_range) // Computer is not on station, but it has upgraded network card. Low signal.
return 1 return NTNET_LOW_SIGNAL
return 0 // Computer is not on station and does not have upgraded network card. No signal. return NTNET_NO_SIGNAL // Computer is not on station and does not have upgraded network card. No signal.
/obj/item/computer_hardware/network_card/advanced /obj/item/computer_hardware/network_card/advanced

View File

@@ -8,14 +8,9 @@ export const NtosNetMonitor = (props, context) => {
ntnetrelays, ntnetrelays,
ntnetstatus, ntnetstatus,
config_softwaredownload, config_softwaredownload,
config_peertopeer,
config_communication, config_communication,
config_systemcontrol,
idsalarm, idsalarm,
idsstatus, idsstatus,
ntnetmaxlogs,
maxlogs,
minlogs,
ntnetlogs = [], ntnetlogs = [],
} = data; } = data;
return ( return (
@@ -34,13 +29,23 @@ export const NtosNetMonitor = (props, context) => {
selected={ntnetstatus} selected={ntnetstatus}
onClick={() => act('toggleWireless')} /> onClick={() => act('toggleWireless')} />
)}> )}>
{ntnetrelays ? ( {ntnetrelays.map((relay) => (
<LabeledList> <Section
<LabeledList.Item label="Active NTNet Relays"> key={relay.ref}
{ntnetrelays} title={relay.name}
</LabeledList.Item> buttons={
</LabeledList> <Button.Confirm
) : "No Relays Connected"} color={relay.is_operational ? 'good' : 'bad'}
content={relay.is_operational ? 'ENABLED' : 'DISABLED'}
onClick={() =>
act('toggle_relay', {
ref: relay.ref,
})
}
/>
}
/>
))}
</Section> </Section>
<Section title="Firewall Configuration"> <Section title="Firewall Configuration">
<LabeledList> <LabeledList>
@@ -53,15 +58,6 @@ export const NtosNetMonitor = (props, context) => {
selected={config_softwaredownload} selected={config_softwaredownload}
onClick={() => act('toggle_function', { id: "1" })} /> onClick={() => act('toggle_function', { id: "1" })} />
)} /> )} />
<LabeledList.Item
label="Peer to Peer Traffic"
buttons={(
<Button
icon={config_peertopeer ? 'power-off' : 'times'}
content={config_peertopeer ? 'ENABLED' : 'DISABLED'}
selected={config_peertopeer}
onClick={() => act('toggle_function', { id: "2" })} />
)} />
<LabeledList.Item <LabeledList.Item
label="Communication Systems" label="Communication Systems"
buttons={( buttons={(
@@ -71,15 +67,6 @@ export const NtosNetMonitor = (props, context) => {
selected={config_communication} selected={config_communication}
onClick={() => act('toggle_function', { id: "3" })} /> onClick={() => act('toggle_function', { id: "3" })} />
)} /> )} />
<LabeledList.Item
label="Remote System Control"
buttons={(
<Button
icon={config_systemcontrol ? 'power-off' : 'times'}
content={config_systemcontrol ? 'ENABLED' : 'DISABLED'}
selected={config_systemcontrol}
onClick={() => act('toggle_function', { id: "4" })} />
)} />
</LabeledList> </LabeledList>
</Section> </Section>
<Section title="Security Systems"> <Section title="Security Systems">
@@ -111,19 +98,6 @@ export const NtosNetMonitor = (props, context) => {
onClick={() => act('resetIDS')} /> onClick={() => act('resetIDS')} />
</> </>
)} /> )} />
<LabeledList.Item
label="Max Log Count"
buttons={(
<NumberInput
value={ntnetmaxlogs}
minValue={minlogs}
maxValue={maxlogs}
width="39px"
onChange={(e, value) => act('updatemaxlogs', {
new_number: value,
})}
/>
)} />
</LabeledList> </LabeledList>
<Section <Section
title="System Log" title="System Log"

View File

@@ -105,13 +105,13 @@
#include "code\__DEFINES\misc.dm" #include "code\__DEFINES\misc.dm"
#include "code\__DEFINES\mobfactions.dm" #include "code\__DEFINES\mobfactions.dm"
#include "code\__DEFINES\mobs.dm" #include "code\__DEFINES\mobs.dm"
#include "code\__DEFINES\modular_computer.dm"
#include "code\__DEFINES\monkeys.dm" #include "code\__DEFINES\monkeys.dm"
#include "code\__DEFINES\move_force.dm" #include "code\__DEFINES\move_force.dm"
#include "code\__DEFINES\movement.dm" #include "code\__DEFINES\movement.dm"
#include "code\__DEFINES\movespeed_modification.dm" #include "code\__DEFINES\movespeed_modification.dm"
#include "code\__DEFINES\multiz.dm" #include "code\__DEFINES\multiz.dm"
#include "code\__DEFINES\nanites.dm" #include "code\__DEFINES\nanites.dm"
#include "code\__DEFINES\networks.dm"
#include "code\__DEFINES\obj_flags.dm" #include "code\__DEFINES\obj_flags.dm"
#include "code\__DEFINES\particles.dm" #include "code\__DEFINES\particles.dm"
#include "code\__DEFINES\pinpointers.dm" #include "code\__DEFINES\pinpointers.dm"
@@ -195,7 +195,6 @@
#include "code\__DEFINES\dcs\signals\signals_moveloop.dm" #include "code\__DEFINES\dcs\signals\signals_moveloop.dm"
#include "code\__DEFINES\dcs\signals\signals_movetype.dm" #include "code\__DEFINES\dcs\signals\signals_movetype.dm"
#include "code\__DEFINES\dcs\signals\signals_nanite.dm" #include "code\__DEFINES\dcs\signals\signals_nanite.dm"
#include "code\__DEFINES\dcs\signals\signals_ntnet.dm"
#include "code\__DEFINES\dcs\signals\signals_object.dm" #include "code\__DEFINES\dcs\signals\signals_object.dm"
#include "code\__DEFINES\dcs\signals\signals_song.dm" #include "code\__DEFINES\dcs\signals\signals_song.dm"
#include "code\__DEFINES\dcs\signals\signals_spell.dm" #include "code\__DEFINES\dcs\signals\signals_spell.dm"
@@ -441,6 +440,7 @@
#include "code\controllers\subsystem\metrics.dm" #include "code\controllers\subsystem\metrics.dm"
#include "code\controllers\subsystem\minor_mapping.dm" #include "code\controllers\subsystem\minor_mapping.dm"
#include "code\controllers\subsystem\mobs.dm" #include "code\controllers\subsystem\mobs.dm"
#include "code\controllers\subsystem\modular_computers.dm"
#include "code\controllers\subsystem\moods.dm" #include "code\controllers\subsystem\moods.dm"
#include "code\controllers\subsystem\nightshift.dm" #include "code\controllers\subsystem\nightshift.dm"
#include "code\controllers\subsystem\npcpool.dm" #include "code\controllers\subsystem\npcpool.dm"
@@ -481,7 +481,6 @@
#include "code\controllers\subsystem\processing\greyscale.dm" #include "code\controllers\subsystem\processing\greyscale.dm"
#include "code\controllers\subsystem\processing\instruments.dm" #include "code\controllers\subsystem\processing\instruments.dm"
#include "code\controllers\subsystem\processing\nanites.dm" #include "code\controllers\subsystem\processing\nanites.dm"
#include "code\controllers\subsystem\processing\networks.dm"
#include "code\controllers\subsystem\processing\obj.dm" #include "code\controllers\subsystem\processing\obj.dm"
#include "code\controllers\subsystem\processing\plumbing.dm" #include "code\controllers\subsystem\processing\plumbing.dm"
#include "code\controllers\subsystem\processing\processing.dm" #include "code\controllers\subsystem\processing\processing.dm"
@@ -623,7 +622,6 @@
#include "code\datums\components\mirage_border.dm" #include "code\datums\components\mirage_border.dm"
#include "code\datums\components\mood.dm" #include "code\datums\components\mood.dm"
#include "code\datums\components\nanites.dm" #include "code\datums\components\nanites.dm"
#include "code\datums\components\ntnet_interface.dm"
#include "code\datums\components\orbiter.dm" #include "code\datums\components\orbiter.dm"
#include "code\datums\components\overlay_lighting.dm" #include "code\datums\components\overlay_lighting.dm"
#include "code\datums\components\paintable.dm" #include "code\datums\components\paintable.dm"
@@ -1137,6 +1135,7 @@
#include "code\game\machinery\shuttle\shuttle_heater.dm" #include "code\game\machinery\shuttle\shuttle_heater.dm"
#include "code\game\machinery\telecomms\broadcasting.dm" #include "code\game\machinery\telecomms\broadcasting.dm"
#include "code\game\machinery\telecomms\machine_interactions.dm" #include "code\game\machinery\telecomms\machine_interactions.dm"
#include "code\game\machinery\telecomms\ntnet_relay.dm"
#include "code\game\machinery\telecomms\telecomunications.dm" #include "code\game\machinery\telecomms\telecomunications.dm"
#include "code\game\machinery\telecomms\computers\logbrowser.dm" #include "code\game\machinery\telecomms\computers\logbrowser.dm"
#include "code\game\machinery\telecomms\computers\message.dm" #include "code\game\machinery\telecomms\computers\message.dm"
@@ -3292,10 +3291,6 @@
#include "code\modules\ninja\suit\n_suit_verbs\ninja_stars.dm" #include "code\modules\ninja\suit\n_suit_verbs\ninja_stars.dm"
#include "code\modules\ninja\suit\n_suit_verbs\ninja_stealth.dm" #include "code\modules\ninja\suit\n_suit_verbs\ninja_stealth.dm"
#include "code\modules\ninja\suit\n_suit_verbs\ninja_sword_recall.dm" #include "code\modules\ninja\suit\n_suit_verbs\ninja_sword_recall.dm"
#include "code\modules\NTNet\netdata.dm"
#include "code\modules\NTNet\network.dm"
#include "code\modules\NTNet\relays.dm"
#include "code\modules\NTNet\services\_service.dm"
#include "code\modules\paperwork\carbonpaper.dm" #include "code\modules\paperwork\carbonpaper.dm"
#include "code\modules\paperwork\clipboard.dm" #include "code\modules\paperwork\clipboard.dm"
#include "code\modules\paperwork\contract.dm" #include "code\modules\paperwork\contract.dm"