mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-24 21:48:39 +01:00
[MIRROR] Adds a modular computer subsystem to shift modPCs away from radios [MDB IGNORE] (#17942)
* Adds a modular computer subsystem to shift modPCs away from radios (#71732) ## About The Pull Request Adds the modular computer subsystem which is meant to replace mod PC's reliance on networks and radios, specifically the network subsystem, the ntnet interface, and /datum/ntnet. This PR removes station_root ntnets entirely, but I tried to keep it small. This PR also removes a ton of unused vars and defines, such as NTNet channels that were unused (peer2peer and systemcontrol), atmos networks (as they were removed a while ago) and NTNet var on relays (its stated purpose is so admins can see it through varedits, but that's useless now that it's a subsystem) I also removed ``setting_disabled`` as a thing the RD can do, it turned off ALL ntnet systems. However, this was when there were 4 different ones, now that there's only 2 I thought it was redundant and he could just click 2 buttons to close them. ## Why It's Good For The Game ``/datum/ntnet``, ``/datum/component/ntnet_interface``, and ``/datum/controller/subsystem/networks`` are all old-code messes that depend on eachother and is hard for people to understand what exactly it adds to the game. 90% of its features is allowing the Wirecarp app to see all the ruins that spawned in-game, which I don't think is something that we even WANT (why does the RD need to know that oldstation spawned? Why should they know this anyway??) This hopefully starts to simplify networks/ntnet to make it easier to remove in the future, because surely there are better alternatives than **this** ## Changelog 🆑 refactor: Modular computers NTnet and applications run on its own subsystem, please report any new bugs you may find. /🆑 * Adds a modular computer subsystem to shift modPCs away from radios * Fixed contractor uplink Co-authored-by: John Willard <53777086+JohnFulpWillard@users.noreply.github.com> Co-authored-by: tastyfish <crazychris32@gmail.com>
This commit is contained in:
co-authored by
John Willard
tastyfish
parent
919b1bc253
commit
86e811f782
@@ -1,9 +1,7 @@
|
||||
//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.
|
||||
#define NTNET_COMMUNICATION 2 // Communication (messaging)
|
||||
|
||||
//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
|
||||
|
||||
@@ -25,9 +25,6 @@
|
||||
#define __NETWORK_REMOTES "REMOTES"
|
||||
#define __NETWORK_AIRLOCKS "AIRLOCKS"
|
||||
#define __NETWORK_DOORS "DOORS"
|
||||
#define __NETWORK_ATMOS "ATMOS"
|
||||
#define __NETWORK_SCUBBERS "AIRLOCKS"
|
||||
#define __NETWORK_AIRALARMS "AIRALARMS"
|
||||
#define __NETWORK_CONTROL "CONTROL"
|
||||
#define __NETWORK_STORAGE "STORAGE"
|
||||
#define __NETWORK_CARGO "CARGO"
|
||||
@@ -39,8 +36,6 @@
|
||||
/// Various combined subnetworks
|
||||
#define NETWORK_DOOR_REMOTES NETWORK_NAME_COMBINE(__NETWORK_DOORS, __NETWORK_REMOTES)
|
||||
#define NETWORK_DOOR_AIRLOCKS NETWORK_NAME_COMBINE(__NETWORK_DOORS, __NETWORK_AIRLOCKS)
|
||||
#define NETWORK_ATMOS_AIRALARMS NETWORK_NAME_COMBINE(__NETWORK_ATMOS, __NETWORK_AIRALARMS)
|
||||
#define NETWORK_ATMOS_SCUBBERS NETWORK_NAME_COMBINE(__NETWORK_ATMOS, __NETWORK_SCUBBERS)
|
||||
#define NETWORK_TABLETS NETWORK_NAME_COMBINE(__NETWORK_COMPUTER, __NETWORK_TABLETS)
|
||||
#define NETWORK_BOTS_CARGO NETWORK_NAME_COMBINE(__NETWORK_CARGO, __NETWORK_BOTS)
|
||||
|
||||
|
||||
@@ -0,0 +1,89 @@
|
||||
SUBSYSTEM_DEF(modular_computers)
|
||||
name = "Modular Computers"
|
||||
flags = SS_NO_FIRE
|
||||
|
||||
///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 downloading software works.
|
||||
var/setting_softwaredownload = TRUE
|
||||
///Boolean on whether downloading communication apps like the Chat client works.
|
||||
var/setting_communication = TRUE
|
||||
|
||||
///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
|
||||
|
||||
///List of all available NTNet relays.
|
||||
var/list/obj/machinery/ntnet_relay/ntnet_relays = list()
|
||||
|
||||
/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))
|
||||
continue
|
||||
prog = new prog
|
||||
|
||||
if(prog.available_on_ntnet)
|
||||
available_station_software.Add(prog)
|
||||
if(prog.available_on_syndinet)
|
||||
available_antag_software.Add(prog)
|
||||
|
||||
///Checks if at least one ntnet relay is functional.
|
||||
/datum/controller/subsystem/modular_computers/proc/check_relay_operation()
|
||||
for(var/obj/machinery/ntnet_relay/relays as anything in ntnet_relays)
|
||||
if(!relays.is_operational)
|
||||
continue
|
||||
return TRUE
|
||||
return FALSE
|
||||
|
||||
/datum/controller/subsystem/modular_computers/proc/toggle_function(function)
|
||||
if(!function)
|
||||
return
|
||||
function = text2num(function)
|
||||
switch(function)
|
||||
if(NTNET_SOFTWAREDOWNLOAD)
|
||||
setting_softwaredownload = !setting_softwaredownload
|
||||
SSnetworks.add_log("Configuration Updated. Wireless network firewall now [setting_softwaredownload ? "allows" : "disallows"] connection to software repositories.")
|
||||
if(NTNET_COMMUNICATION)
|
||||
setting_communication = !setting_communication
|
||||
SSnetworks.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)
|
||||
// No relays found. NTNet is down
|
||||
if(!length(ntnet_relays))
|
||||
return FALSE
|
||||
// Check all relays. If we have at least one working relay, network is up.
|
||||
if(!check_relay_operation())
|
||||
return FALSE
|
||||
|
||||
switch(specific_action)
|
||||
if(NTNET_SOFTWAREDOWNLOAD)
|
||||
return setting_softwaredownload
|
||||
if(NTNET_COMMUNICATION)
|
||||
return setting_communication
|
||||
return TRUE
|
||||
|
||||
///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
|
||||
|
||||
///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
|
||||
@@ -5,20 +5,9 @@ SUBSYSTEM_DEF(networks)
|
||||
flags = SS_KEEP_TIMING
|
||||
init_order = INIT_ORDER_NETWORKS
|
||||
|
||||
var/list/relays = list()
|
||||
/// Legacy ntnet lookup for software. Should be changed latter so don't rely on this
|
||||
/// being here.
|
||||
var/datum/ntnet/station_root/station_network
|
||||
var/datum/ntnet/station_root/syndie_network
|
||||
var/list/network_initialize_queue = list()
|
||||
/// all interfaces by their hardware address.
|
||||
/// Do NOT use to verify a reciver_id is valid, use the network.root_devices for that
|
||||
var/list/interfaces_by_hardware_id = list()
|
||||
/// Area to network, network to area list
|
||||
/// This is an associated list to quickly find an area using either its id or network
|
||||
/// Used mainly to make sure all area id's are unique even if a mapper uses the same
|
||||
/// area many times
|
||||
var/list/area_network_lookup = list()
|
||||
|
||||
/// List of networks using their fully qualified network name. Used for quick lookups
|
||||
/// of networks for sending packets
|
||||
@@ -27,8 +16,6 @@ SUBSYSTEM_DEF(networks)
|
||||
/// network tress
|
||||
var/list/root_networks = list()
|
||||
|
||||
|
||||
|
||||
// Why not list? Because its a Copy() every time we add a packet, and thats stupid.
|
||||
var/datum/netdata/first = null // start of the queue. Pulled off in fire.
|
||||
var/datum/netdata/last = null // end of the queue. pushed on by transmit
|
||||
@@ -36,7 +23,6 @@ SUBSYSTEM_DEF(networks)
|
||||
// packet stats
|
||||
var/count_broadcasts_packets = 0 // count of broadcast packets sent
|
||||
var/count_failed_packets = 0 // count of message fails
|
||||
var/count_good_packets = 0
|
||||
// Logs moved here
|
||||
// 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.
|
||||
@@ -53,8 +39,8 @@ SUBSYSTEM_DEF(networks)
|
||||
/datum/controller/subsystem/networks/PreInit()
|
||||
/// Limbo network needs to be made at boot up for all error devices
|
||||
new/datum/ntnet(LIMBO_NETWORK_ROOT)
|
||||
station_network = new(STATION_NETWORK_ROOT)
|
||||
syndie_network = new(SYNDICATE_NETWORK_ROOT)
|
||||
new/datum/ntnet(STATION_NETWORK_ROOT)
|
||||
new/datum/ntnet(SYNDICATE_NETWORK_ROOT)
|
||||
/// As well as the station network incase something funny goes during startup
|
||||
new/datum/ntnet(CENTCOM_NETWORK_ROOT)
|
||||
|
||||
@@ -64,12 +50,7 @@ SUBSYSTEM_DEF(networks)
|
||||
return ..()
|
||||
|
||||
/datum/controller/subsystem/networks/Initialize()
|
||||
station_network.register_map_supremecy() // sigh
|
||||
assign_areas_root_ids(get_sorted_areas()) // setup area names before Initialize
|
||||
station_network.build_software_lists()
|
||||
syndie_network.build_software_lists()
|
||||
|
||||
// At round start, fix the network_id's so the station root is on them
|
||||
initialized = TRUE
|
||||
// Now when the objects Initialize they will join the right network
|
||||
return SS_INIT_SUCCESS
|
||||
@@ -127,7 +108,6 @@ SUBSYSTEM_DEF(networks)
|
||||
// All is good, send the packet then send an ACK to the sender
|
||||
if(!QDELETED(sending_interface))
|
||||
SEND_SIGNAL(sending_interface.parent, COMSIG_COMPONENT_NTNET_ACK, data)
|
||||
count_good_packets++
|
||||
|
||||
/// Helper define to make sure we pop the packet and qdel it
|
||||
#define POP_PACKET(CURRENT) first = CURRENT.next; packet_count--; if(!first) { last = null; packet_count = 0; }; qdel(CURRENT);
|
||||
@@ -188,21 +168,6 @@ SUBSYSTEM_DEF(networks)
|
||||
// We do error checking when the packet is sent
|
||||
return NETWORK_ERROR_OK
|
||||
|
||||
|
||||
/datum/controller/subsystem/networks/proc/check_relay_operation(zlevel=0) //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/controller/subsystem/networks/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)
|
||||
|
||||
/**
|
||||
* Records a message into the station logging system for the network
|
||||
*
|
||||
@@ -239,7 +204,6 @@ SUBSYSTEM_DEF(networks)
|
||||
if(logs.len > setting_maxlogcount)
|
||||
logs = logs.Copy(logs.len-setting_maxlogcount,0)
|
||||
|
||||
|
||||
/**
|
||||
* Removes all station logs for the current game
|
||||
*/
|
||||
@@ -247,7 +211,10 @@ SUBSYSTEM_DEF(networks)
|
||||
logs = list()
|
||||
add_log("-!- LOGS DELETED BY SYSTEM OPERATOR -!-")
|
||||
|
||||
|
||||
/datum/controller/subsystem/networks/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)
|
||||
|
||||
/**
|
||||
* Updates the maximum amount of logs and purges those that go beyond that number
|
||||
@@ -324,9 +291,9 @@ SUBSYSTEM_DEF(networks)
|
||||
if(!(A.area_flags & UNIQUE_AREA)) // if we aren't a unique area, make sure our name is different
|
||||
A.network_area_id = SSnetworks.assign_random_name(5, A.network_area_id + "_") // tack on some garbage incase there are two area types
|
||||
|
||||
/datum/controller/subsystem/networks/proc/assign_areas_root_ids(list/areas, datum/map_template/M=null)
|
||||
for(var/area/A in areas)
|
||||
assign_area_network_id(A, M)
|
||||
/datum/controller/subsystem/networks/proc/assign_areas_root_ids(list/areas, datum/map_template/map_template)
|
||||
for(var/area/area as anything in areas)
|
||||
assign_area_network_id(area, map_template)
|
||||
|
||||
/**
|
||||
* Converts a list of string's into a full network_id
|
||||
|
||||
@@ -130,8 +130,6 @@
|
||||
/datum/component/ntnet_interface/proc/connect_port(port)
|
||||
return registered_sockets[port]
|
||||
|
||||
|
||||
|
||||
/datum/component/ntnet_interface/Destroy()
|
||||
network.remove_interface(src, TRUE)
|
||||
SSnetworks.interfaces_by_hardware_id.Remove(hardware_id)
|
||||
|
||||
@@ -33,7 +33,6 @@
|
||||
/// Parrnt of the network. If this is null, we are a oot network
|
||||
var/datum/ntnet/parent
|
||||
|
||||
|
||||
/*
|
||||
* Creates a new network
|
||||
*
|
||||
@@ -72,7 +71,7 @@
|
||||
|
||||
/// A network should NEVER be deleted. If you don't want to show it exists just check if its
|
||||
/// empty
|
||||
/datum/ntnet/Destroy()
|
||||
/datum/ntnet/Destroy(force)
|
||||
networks -= network_id
|
||||
if(children.len > 0 || linked_devices.len > 0)
|
||||
CRASH("Trying to delete a network with devices still in them")
|
||||
@@ -120,17 +119,6 @@
|
||||
return devices
|
||||
|
||||
|
||||
/*
|
||||
* Find if an interface exists on this network
|
||||
*
|
||||
* Used to look up a device on the network.
|
||||
*
|
||||
* Arguments:
|
||||
* * tag_or_hid - Ither the hardware id or the id_tag
|
||||
*/
|
||||
/datum/ntnet/proc/find_interface(tag_or_hid)
|
||||
return root_devices[tag_or_hid]
|
||||
|
||||
/**
|
||||
* Add this interface to this branch of the network.
|
||||
*
|
||||
@@ -221,177 +209,3 @@
|
||||
target.linked_devices[interface.hardware_id] = interface
|
||||
interface.alias.Remove(net.network_id)
|
||||
interface.alias[target.network_id] = target
|
||||
|
||||
|
||||
|
||||
/datum/ntnet/station_root
|
||||
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/available_station_software = list()
|
||||
var/list/available_antag_software = list()
|
||||
var/list/chat_channels = list()
|
||||
var/list/fileservers = list()
|
||||
|
||||
// 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/station_root/New(root_name)
|
||||
. = ..()
|
||||
SSnetworks.add_log("NTNet logging system activated for [root_name]")
|
||||
|
||||
|
||||
|
||||
|
||||
#ifdef NTNET_SERVICE
|
||||
/datum/ntnet/station_root/Destroy()
|
||||
for(var/i in services_by_id)
|
||||
var/S = i
|
||||
S.disconnect(src, TRUE)
|
||||
return ..()
|
||||
|
||||
|
||||
/datum/ntnet/station_root/proc/find_service_id(id)
|
||||
return services_by_id[id]
|
||||
|
||||
/datum/ntnet/station_root/proc/find_service_path(path)
|
||||
return services_by_path[path]
|
||||
|
||||
/datum/ntnet/station_root/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/station_root/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/station_root/proc/create_service(type)
|
||||
var/datum/ntnet_service/S = new type
|
||||
if(!istype(S))
|
||||
return FALSE
|
||||
. = S.connect(src)
|
||||
if(!.)
|
||||
qdel(S)
|
||||
|
||||
/datum/ntnet/station_root/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/station_root/proc/process_data_transmit(datum/component/ntnet_interface/sender, datum/netdata/data)
|
||||
if(..())
|
||||
for(var/i in services_by_id)
|
||||
var/datum/ntnet_service/serv = services_by_id[i]
|
||||
serv.ntnet_intercept(data, src, sender)
|
||||
return TRUE
|
||||
#endif
|
||||
|
||||
// Checks whether NTNet operates. If parameter is passed checks whether specific function is enabled.
|
||||
/datum/ntnet/station_root/proc/check_function(specific_action = 0)
|
||||
if(!SSnetworks.relays || !SSnetworks.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(!SSnetworks.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/station_root/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/station_root/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/station_root/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/station_root/proc/resetIDS()
|
||||
intrusion_detection_alarm = FALSE
|
||||
|
||||
/datum/ntnet/station_root/proc/toggleIDS()
|
||||
resetIDS()
|
||||
intrusion_detection_enabled = !intrusion_detection_enabled
|
||||
|
||||
|
||||
/datum/ntnet/station_root/proc/toggle_function(function)
|
||||
if(!function)
|
||||
return
|
||||
function = text2num(function)
|
||||
switch(function)
|
||||
if(NTNET_SOFTWAREDOWNLOAD)
|
||||
setting_softwaredownload = !setting_softwaredownload
|
||||
SSnetworks.add_log("Configuration Updated. Wireless network firewall now [setting_softwaredownload ? "allows" : "disallows"] connection to software repositories.")
|
||||
if(NTNET_PEERTOPEER)
|
||||
setting_peertopeer = !setting_peertopeer
|
||||
SSnetworks.add_log("Configuration Updated. Wireless network firewall now [setting_peertopeer ? "allows" : "disallows"] peer to peer network traffic.")
|
||||
if(NTNET_COMMUNICATION)
|
||||
setting_communication = !setting_communication
|
||||
SSnetworks.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
|
||||
SSnetworks.add_log("Configuration Updated. Wireless network firewall now [setting_systemcontrol ? "allows" : "disallows"] remote control of station's systems.")
|
||||
|
||||
|
||||
|
||||
/datum/ntnet/station_root/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)
|
||||
SSnetworks.relays.Add(R)
|
||||
R.NTNet = src
|
||||
|
||||
@@ -9,7 +9,6 @@
|
||||
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.
|
||||
///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.
|
||||
@@ -116,17 +115,13 @@
|
||||
uid = gl_uid++
|
||||
component_parts = list()
|
||||
|
||||
if(SSnetworks.station_network)
|
||||
SSnetworks.relays.Add(src)
|
||||
NTNet = SSnetworks.station_network
|
||||
SSnetworks.add_log("New quantum relay activated. Current amount of linked relays: [SSnetworks.relays.len]")
|
||||
. = ..()
|
||||
SSmodular_computers.ntnet_relays.Add(src)
|
||||
SSnetworks.add_log("New quantum relay activated. Current amount of linked relays: [SSmodular_computers.ntnet_relays.len]")
|
||||
return ..()
|
||||
|
||||
/obj/machinery/ntnet_relay/Destroy()
|
||||
if(SSnetworks.station_network)
|
||||
SSnetworks.relays.Remove(src)
|
||||
SSnetworks.add_log("Quantum relay connection severed. Current amount of linked relays: [SSnetworks.relays.len]")
|
||||
NTNet = null
|
||||
SSmodular_computers.ntnet_relays.Remove(src)
|
||||
SSnetworks.add_log("Quantum relay connection severed. Current amount of linked relays: [SSmodular_computers.ntnet_relays.len]")
|
||||
|
||||
for(var/datum/computer_file/program/ntnet_dos/D in dos_sources)
|
||||
D.target = null
|
||||
|
||||
@@ -34,13 +34,11 @@
|
||||
if(id > MAX_CHANNELS)
|
||||
qdel(src)
|
||||
return
|
||||
if(SSnetworks.station_network)
|
||||
SSnetworks.station_network.chat_channels.Add(src)
|
||||
SSmodular_computers.chat_channels.Add(src)
|
||||
return ..()
|
||||
|
||||
/datum/ntnet_conversation/Destroy()
|
||||
if(SSnetworks.station_network)
|
||||
SSnetworks.station_network.chat_channels.Remove(src)
|
||||
SSmodular_computers.chat_channels.Remove(src)
|
||||
for(var/datum/computer_file/program/chatclient/chatterbox as anything in (active_clients | offline_clients))
|
||||
purge_client(chatterbox)
|
||||
return ..()
|
||||
|
||||
@@ -628,7 +628,8 @@ GLOBAL_LIST_EMPTY(TabletMessengers) // a list of all active messengers, similar
|
||||
|
||||
// Returns 0 for No Signal, 1 for Low Signal and 2 for Good Signal. 3 is for wired connection (always-on)
|
||||
/obj/item/modular_computer/proc/get_ntnet_status(specific_action = 0)
|
||||
if(!SSnetworks.station_network || !SSnetworks.station_network.check_function(specific_action)) // NTNet is down and we are not connected via wired connection. No signal.
|
||||
// NTNet is down and we are not connected via wired connection. No signal.
|
||||
if(!SSmodular_computers.check_function(specific_action))
|
||||
return NTNET_NO_SIGNAL
|
||||
|
||||
// computers are connected through ethernet
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
var/program_icon_state = null
|
||||
/// Set to 1 for program to require nonstop NTNet connection to run. If NTNet connection is lost program crashes.
|
||||
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
|
||||
/// 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
|
||||
|
||||
@@ -46,9 +46,9 @@
|
||||
return
|
||||
switch(action)
|
||||
if("PRG_target_relay")
|
||||
for(var/obj/machinery/ntnet_relay/R in SSnetworks.relays)
|
||||
if(R.uid == params["targid"])
|
||||
target = R
|
||||
for(var/obj/machinery/ntnet_relay/relays as anything in SSmodular_computers.ntnet_relays)
|
||||
if(relays.uid == params["targid"])
|
||||
target = relays
|
||||
break
|
||||
return TRUE
|
||||
if("PRG_reset")
|
||||
@@ -62,15 +62,12 @@
|
||||
if(target)
|
||||
executed = TRUE
|
||||
target.dos_sources.Add(src)
|
||||
if(SSnetworks.station_network.intrusion_detection_enabled)
|
||||
if(SSmodular_computers.intrusion_detection_enabled)
|
||||
SSnetworks.add_log("IDS WARNING - Excess traffic flood targeting relay [target.uid] detected from device: [computer.name]")
|
||||
SSnetworks.station_network.intrusion_detection_alarm = TRUE
|
||||
SSmodular_computers.intrusion_detection_alarm = TRUE
|
||||
return TRUE
|
||||
|
||||
/datum/computer_file/program/ntnet_dos/ui_data(mob/user)
|
||||
if(!SSnetworks.station_network)
|
||||
return
|
||||
|
||||
var/list/data = get_header_data()
|
||||
|
||||
data["error"] = error
|
||||
@@ -83,8 +80,8 @@
|
||||
else
|
||||
data["target"] = FALSE
|
||||
data["relays"] = list()
|
||||
for(var/obj/machinery/ntnet_relay/R in SSnetworks.relays)
|
||||
data["relays"] += list(list("id" = R.uid))
|
||||
for(var/obj/machinery/ntnet_relay/relays as anything in SSmodular_computers.ntnet_relays)
|
||||
data["relays"] += list(list("id" = relays.uid))
|
||||
data["focus"] = target ? target.uid : null
|
||||
|
||||
return data
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
var/emagged = FALSE
|
||||
var/list/main_repo
|
||||
var/list/antag_repo
|
||||
|
||||
var/list/show_categories = list(
|
||||
PROGRAM_CATEGORY_CREW,
|
||||
PROGRAM_CATEGORY_ENGI,
|
||||
@@ -30,8 +31,8 @@
|
||||
|
||||
/datum/computer_file/program/ntnetdownload/on_start()
|
||||
. = ..()
|
||||
main_repo = SSnetworks.station_network.available_station_software
|
||||
antag_repo = SSnetworks.station_network.available_antag_software
|
||||
main_repo = SSmodular_computers.available_station_software
|
||||
antag_repo = SSmodular_computers.available_antag_software
|
||||
|
||||
/datum/computer_file/program/ntnetdownload/run_emag()
|
||||
if(emagged)
|
||||
@@ -44,7 +45,7 @@
|
||||
if(downloaded_file)
|
||||
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))
|
||||
return FALSE
|
||||
@@ -158,7 +159,7 @@
|
||||
"installed" = !!computer.find_file_by_name(programs.filename),
|
||||
"compatible" = check_compatibility(programs),
|
||||
"size" = programs.size,
|
||||
"access" = emagged && programs.available_on_syndinet ? TRUE : programs.can_run(user,transfer = 1, access = access),
|
||||
"access" = emagged && programs.available_on_syndinet ? TRUE : programs.can_run(user,transfer = TRUE, access = access),
|
||||
"verifiedsource" = programs.available_on_ntnet,
|
||||
))
|
||||
|
||||
@@ -195,5 +196,5 @@
|
||||
|
||||
/datum/computer_file/program/ntnetdownload/syndicate/on_start()
|
||||
. = ..()
|
||||
main_repo = SSnetworks.station_network.available_antag_software
|
||||
main_repo = SSmodular_computers.available_antag_software
|
||||
antag_repo = null
|
||||
|
||||
@@ -53,7 +53,7 @@
|
||||
if(.)
|
||||
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
|
||||
if(channel && ((channel.channel_operator == src) || netadmin_mode))
|
||||
authed = TRUE
|
||||
@@ -84,7 +84,7 @@
|
||||
return TRUE
|
||||
|
||||
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.active_clients) && !(src in channel.offline_clients)) && !channel.password)
|
||||
channel.add_client(src)
|
||||
return TRUE
|
||||
@@ -106,7 +106,7 @@
|
||||
return UI_UPDATE
|
||||
var/mob/living/user = usr
|
||||
if(can_run(user, TRUE, ACCESS_NETWORK))
|
||||
for(var/datum/ntnet_conversation/channels as anything in SSnetworks.station_network.chat_channels)
|
||||
for(var/datum/ntnet_conversation/channels as anything in SSmodular_computers.chat_channels)
|
||||
channels.remove_client(src)
|
||||
netadmin_mode = TRUE
|
||||
return UI_UPDATE
|
||||
@@ -115,7 +115,7 @@
|
||||
newname = replacetext(newname, " ", "_")
|
||||
if(!newname || newname == username)
|
||||
return
|
||||
for(var/datum/ntnet_conversation/anychannel as anything in SSnetworks.station_network.chat_channels)
|
||||
for(var/datum/ntnet_conversation/anychannel as anything in SSmodular_computers.chat_channels)
|
||||
if(src in anychannel.active_clients)
|
||||
anychannel.add_status_message("[username] is now known as [newname].")
|
||||
username = newname
|
||||
@@ -180,7 +180,7 @@
|
||||
|
||||
/datum/computer_file/program/chatclient/process_tick(delta_time)
|
||||
. = ..()
|
||||
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)
|
||||
ui_header = "ntnrc_idle.gif"
|
||||
if(channel)
|
||||
@@ -198,13 +198,13 @@
|
||||
. = ..()
|
||||
if(!.)
|
||||
return
|
||||
for(var/datum/ntnet_conversation/channel as anything in SSnetworks.station_network.chat_channels)
|
||||
for(var/datum/ntnet_conversation/channel as anything in SSmodular_computers.chat_channels)
|
||||
if(src in channel.offline_clients)
|
||||
channel.offline_clients.Remove(src)
|
||||
channel.active_clients.Add(src)
|
||||
|
||||
/datum/computer_file/program/chatclient/kill_program(forced = FALSE)
|
||||
for(var/datum/ntnet_conversation/channel as anything in SSnetworks.station_network.chat_channels)
|
||||
for(var/datum/ntnet_conversation/channel as anything in SSmodular_computers.chat_channels)
|
||||
channel.go_offline(src)
|
||||
active_channel = null
|
||||
return ..()
|
||||
@@ -219,11 +219,11 @@
|
||||
|
||||
/datum/computer_file/program/chatclient/ui_data(mob/user)
|
||||
var/list/data = get_header_data()
|
||||
if(!SSnetworks.station_network || !SSnetworks.station_network.chat_channels)
|
||||
if(!SSmodular_computers.chat_channels)
|
||||
return data
|
||||
|
||||
var/list/all_channels = list()
|
||||
for(var/datum/ntnet_conversation/conversations as anything in SSnetworks.station_network.chat_channels)
|
||||
for(var/datum/ntnet_conversation/conversations as anything in SSmodular_computers.chat_channels)
|
||||
if(conversations.title)
|
||||
all_channels.Add(list(list(
|
||||
"chan" = conversations.title,
|
||||
@@ -232,7 +232,7 @@
|
||||
data["all_channels"] = all_channels
|
||||
data["active_channel"] = active_channel
|
||||
|
||||
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
|
||||
data["clients"] = list()
|
||||
data["messages"] = list()
|
||||
|
||||
@@ -17,42 +17,22 @@
|
||||
return
|
||||
switch(action)
|
||||
if("resetIDS")
|
||||
if(SSnetworks.station_network)
|
||||
SSnetworks.station_network.resetIDS()
|
||||
SSmodular_computers.intrusion_detection_alarm = FALSE
|
||||
return TRUE
|
||||
if("toggleIDS")
|
||||
if(SSnetworks.station_network)
|
||||
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
|
||||
SSmodular_computers.intrusion_detection_enabled = !SSmodular_computers.intrusion_detection_enabled
|
||||
return TRUE
|
||||
if("purgelogs")
|
||||
if(SSnetworks.station_network)
|
||||
SSnetworks.purge_logs()
|
||||
SSnetworks.purge_logs()
|
||||
return TRUE
|
||||
if("updatemaxlogs")
|
||||
var/logcount = params["new_number"]
|
||||
if(SSnetworks.station_network)
|
||||
SSnetworks.update_max_log_count(logcount)
|
||||
SSnetworks.update_max_log_count(logcount)
|
||||
return TRUE
|
||||
if("toggle_function")
|
||||
if(!SSnetworks.station_network)
|
||||
return
|
||||
SSnetworks.station_network.toggle_function(text2num(params["id"]))
|
||||
SSmodular_computers.toggle_function(text2num(params["id"]))
|
||||
return TRUE
|
||||
if("toggle_mass_pda")
|
||||
if(!SSnetworks.station_network)
|
||||
return
|
||||
|
||||
var/obj/item/modular_computer/target_tablet = locate(params["ref"]) in GLOB.TabletMessengers
|
||||
if(!istype(target_tablet))
|
||||
return
|
||||
@@ -60,30 +40,24 @@
|
||||
messenger_app.spam_mode = !messenger_app.spam_mode
|
||||
|
||||
/datum/computer_file/program/ntnetmonitor/ui_data(mob/user)
|
||||
if(!SSnetworks.station_network)
|
||||
return
|
||||
var/list/data = get_header_data()
|
||||
|
||||
data["ntnetstatus"] = SSnetworks.station_network.check_function()
|
||||
data["ntnetrelays"] = SSnetworks.relays.len
|
||||
data["idsstatus"] = SSnetworks.station_network.intrusion_detection_enabled
|
||||
data["idsalarm"] = SSnetworks.station_network.intrusion_detection_alarm
|
||||
data["ntnetstatus"] = SSmodular_computers.check_function()
|
||||
data["ntnetrelays"] = SSmodular_computers.ntnet_relays.len
|
||||
|
||||
data["config_softwaredownload"] = SSnetworks.station_network.setting_softwaredownload
|
||||
data["config_peertopeer"] = SSnetworks.station_network.setting_peertopeer
|
||||
data["config_communication"] = SSnetworks.station_network.setting_communication
|
||||
data["config_systemcontrol"] = SSnetworks.station_network.setting_systemcontrol
|
||||
data["config_softwaredownload"] = SSmodular_computers.setting_softwaredownload
|
||||
data["config_communication"] = SSmodular_computers.setting_communication
|
||||
|
||||
data["idsstatus"] = SSmodular_computers.intrusion_detection_enabled
|
||||
data["idsalarm"] = SSmodular_computers.intrusion_detection_alarm
|
||||
|
||||
data["ntnetlogs"] = list()
|
||||
data["minlogs"] = MIN_NTNET_LOGS
|
||||
data["maxlogs"] = MAX_NTNET_LOGS
|
||||
|
||||
for(var/i in SSnetworks.logs)
|
||||
data["ntnetlogs"] += list(list("entry" = i))
|
||||
data["ntnetmaxlogs"] = SSnetworks.setting_maxlogcount
|
||||
|
||||
data["tablets"] = list()
|
||||
for(var/obj/item/modular_computer/messenger in GetViewableDevices())
|
||||
for(var/obj/item/modular_computer/messenger as anything in GetViewableDevices())
|
||||
var/list/tablet_data = list()
|
||||
if(messenger.saved_identification)
|
||||
for(var/datum/computer_file/program/messenger/messenger_app in computer.stored_files)
|
||||
@@ -95,3 +69,9 @@
|
||||
data["tablets"] += list(tablet_data)
|
||||
|
||||
return data
|
||||
|
||||
/datum/computer_file/program/ntnetmonitor/ui_static_data(mob/user)
|
||||
var/list/data = ..()
|
||||
data["minlogs"] = MIN_NTNET_LOGS
|
||||
data["maxlogs"] = MAX_NTNET_LOGS
|
||||
return data
|
||||
|
||||
@@ -1,22 +1,54 @@
|
||||
/datum/unit_test/ntnetwork
|
||||
var/list/valid_network_names = list("SS13.ATMOS.SCRUBBERS.SM", "DEEPSPACE.HYDRO.PLANT", "SINDIE.STINKS.BUTT")
|
||||
var/list/valid_network_names = list(
|
||||
"SS13.ATMOS.SCRUBBERS.SM",
|
||||
"DEEPSPACE.HYDRO.PLANT",
|
||||
"SINDIE.STINKS.BUTT",
|
||||
)
|
||||
|
||||
var/list/invalid_network_names = list(".SS13.BOB", "SS13.OHMAN.", "SS13.HAS A SPACE" )
|
||||
var/list/invalid_network_names = list(
|
||||
".SS13.BOB",
|
||||
"SS13.OHMAN.",
|
||||
"SS13.HAS A SPACE",
|
||||
)
|
||||
|
||||
var/list/valid_network_trees = list(list("SS13","ATMOS","SCRUBBERS","SM"),list("DEEPSPACE","HYDRO","PLANT"), list("SINDIE","STINKS","BUTT"))
|
||||
var/list/valid_network_trees = list(
|
||||
list(
|
||||
"SS13",
|
||||
"ATMOS",
|
||||
"SCRUBBERS",
|
||||
"SM",
|
||||
),
|
||||
list(
|
||||
"DEEPSPACE",
|
||||
"HYDRO",
|
||||
"PLANT",
|
||||
),
|
||||
list(
|
||||
"SINDIE",
|
||||
"STINKS",
|
||||
"BUTT",
|
||||
),
|
||||
)
|
||||
|
||||
var/list/network_roots = list(
|
||||
__STATION_NETWORK_ROOT,
|
||||
__CENTCOM_NETWORK_ROOT,
|
||||
__SYNDICATE_NETWORK_ROOT,
|
||||
__LIMBO_NETWORK_ROOT)
|
||||
__STATION_NETWORK_ROOT,
|
||||
__CENTCOM_NETWORK_ROOT,
|
||||
__SYNDICATE_NETWORK_ROOT,
|
||||
__LIMBO_NETWORK_ROOT,
|
||||
)
|
||||
|
||||
var/list/random_words_for_testing = list(
|
||||
__NETWORK_TOOLS, __NETWORK_REMOTES, __NETWORK_AIRLOCKS,
|
||||
__NETWORK_DOORS, __NETWORK_ATMOS, __NETWORK_SCUBBERS,
|
||||
__NETWORK_AIRALARMS, __NETWORK_CONTROL, __NETWORK_STORAGE,
|
||||
__NETWORK_CARGO, __NETWORK_BOTS, __NETWORK_COMPUTER,
|
||||
__NETWORK_TABLETS)
|
||||
__NETWORK_TOOLS,
|
||||
__NETWORK_REMOTES,
|
||||
__NETWORK_AIRLOCKS,
|
||||
__NETWORK_DOORS,
|
||||
__NETWORK_CONTROL,
|
||||
__NETWORK_STORAGE,
|
||||
__NETWORK_CARGO,
|
||||
__NETWORK_BOTS,
|
||||
__NETWORK_COMPUTER,
|
||||
__NETWORK_TABLETS,
|
||||
)
|
||||
|
||||
var/number_of_names_to_test = 50
|
||||
var/length_of_test_network = 5
|
||||
|
||||
@@ -2,6 +2,12 @@
|
||||
name = "contract PDA"
|
||||
icon = 'icons/obj/contractor_tablet.dmi'
|
||||
icon_state = "tablet"
|
||||
icon_state_unpowered = "tablet"
|
||||
icon_state_powered = "tablet"
|
||||
icon_state_menu = "assign"
|
||||
greyscale_config = null
|
||||
greyscale_colors = null
|
||||
comp_light_luminosity = 6.3
|
||||
saved_identification = "John Doe"
|
||||
saved_job = "Citizen"
|
||||
device_theme = "syndicate"
|
||||
|
||||
@@ -617,6 +617,7 @@
|
||||
#include "code\controllers\subsystem\materials.dm"
|
||||
#include "code\controllers\subsystem\minor_mapping.dm"
|
||||
#include "code\controllers\subsystem\mobs.dm"
|
||||
#include "code\controllers\subsystem\modular_computers.dm"
|
||||
#include "code\controllers\subsystem\moods.dm"
|
||||
#include "code\controllers\subsystem\mouse_entered.dm"
|
||||
#include "code\controllers\subsystem\nightshift.dm"
|
||||
|
||||
@@ -9,9 +9,7 @@ export const NtosNetMonitor = (props, context) => {
|
||||
ntnetrelays,
|
||||
ntnetstatus,
|
||||
config_softwaredownload,
|
||||
config_peertopeer,
|
||||
config_communication,
|
||||
config_systemcontrol,
|
||||
idsalarm,
|
||||
idsstatus,
|
||||
ntnetmaxlogs,
|
||||
@@ -47,9 +45,7 @@ export const NtosNetMonitor = (props, context) => {
|
||||
ntnetrelays={ntnetrelays}
|
||||
ntnetstatus={ntnetstatus}
|
||||
config_softwaredownload={config_softwaredownload}
|
||||
config_peertopeer={config_peertopeer}
|
||||
config_communication={config_communication}
|
||||
config_systemcontrol={config_systemcontrol}
|
||||
idsalarm={idsalarm}
|
||||
idsstatus={idsstatus}
|
||||
ntnetmaxlogs={ntnetmaxlogs}
|
||||
@@ -74,9 +70,7 @@ const MainPage = (props, context) => {
|
||||
ntnetrelays,
|
||||
ntnetstatus,
|
||||
config_softwaredownload,
|
||||
config_peertopeer,
|
||||
config_communication,
|
||||
config_systemcontrol,
|
||||
idsalarm,
|
||||
idsstatus,
|
||||
ntnetmaxlogs,
|
||||
@@ -91,16 +85,7 @@ const MainPage = (props, context) => {
|
||||
WARNING: Disabling wireless transmitters when using a wireless device
|
||||
may prevent you from reenabling them!
|
||||
</NoticeBox>
|
||||
<Section
|
||||
title="Wireless Connectivity"
|
||||
buttons={
|
||||
<Button.Confirm
|
||||
icon={ntnetstatus ? 'power-off' : 'times'}
|
||||
content={ntnetstatus ? 'ENABLED' : 'DISABLED'}
|
||||
selected={ntnetstatus}
|
||||
onClick={() => act('toggleWireless')}
|
||||
/>
|
||||
}>
|
||||
<Section title="Wireless Connectivity">
|
||||
{ntnetrelays ? (
|
||||
<LabeledList>
|
||||
<LabeledList.Item label="Active NTNet Relays">
|
||||
@@ -124,17 +109,6 @@ const MainPage = (props, context) => {
|
||||
/>
|
||||
}
|
||||
/>
|
||||
<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
|
||||
label="Communication Systems"
|
||||
buttons={
|
||||
@@ -142,18 +116,7 @@ const MainPage = (props, context) => {
|
||||
icon={config_communication ? 'power-off' : 'times'}
|
||||
content={config_communication ? 'ENABLED' : 'DISABLED'}
|
||||
selected={config_communication}
|
||||
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' })}
|
||||
onClick={() => act('toggle_function', { id: '2' })}
|
||||
/>
|
||||
}
|
||||
/>
|
||||
|
||||
Reference in New Issue
Block a user