mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2025-12-19 06:03:14 +00:00
* 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>
78 lines
2.7 KiB
Plaintext
78 lines
2.7 KiB
Plaintext
/datum/computer_file/program/ntnetmonitor
|
|
filename = "wirecarp"
|
|
filedesc = "WireCarp"
|
|
category = PROGRAM_CATEGORY_MISC
|
|
program_icon_state = "comm_monitor"
|
|
extended_desc = "This program monitors stationwide NTNet network, provides access to logging systems, and allows for configuration changes"
|
|
size = 12
|
|
requires_ntnet = TRUE
|
|
required_access = list(ACCESS_NETWORK) //NETWORK CONTROL IS A MORE SECURE PROGRAM.
|
|
available_on_ntnet = TRUE
|
|
tgui_id = "NtosNetMonitor"
|
|
program_icon = "network-wired"
|
|
|
|
/datum/computer_file/program/ntnetmonitor/ui_act(action, list/params, datum/tgui/ui)
|
|
. = ..()
|
|
if(.)
|
|
return
|
|
switch(action)
|
|
if("resetIDS")
|
|
SSmodular_computers.intrusion_detection_alarm = FALSE
|
|
return TRUE
|
|
if("toggleIDS")
|
|
SSmodular_computers.intrusion_detection_enabled = !SSmodular_computers.intrusion_detection_enabled
|
|
return TRUE
|
|
if("purgelogs")
|
|
SSnetworks.purge_logs()
|
|
return TRUE
|
|
if("updatemaxlogs")
|
|
var/logcount = params["new_number"]
|
|
SSnetworks.update_max_log_count(logcount)
|
|
return TRUE
|
|
if("toggle_function")
|
|
SSmodular_computers.toggle_function(text2num(params["id"]))
|
|
return TRUE
|
|
if("toggle_mass_pda")
|
|
var/obj/item/modular_computer/target_tablet = locate(params["ref"]) in GLOB.TabletMessengers
|
|
if(!istype(target_tablet))
|
|
return
|
|
for(var/datum/computer_file/program/messenger/messenger_app in target_tablet.stored_files)
|
|
messenger_app.spam_mode = !messenger_app.spam_mode
|
|
|
|
/datum/computer_file/program/ntnetmonitor/ui_data(mob/user)
|
|
var/list/data = get_header_data()
|
|
|
|
data["ntnetstatus"] = SSmodular_computers.check_function()
|
|
data["ntnetrelays"] = SSmodular_computers.ntnet_relays.len
|
|
|
|
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()
|
|
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 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)
|
|
tablet_data["enabled_spam"] += messenger_app.spam_mode
|
|
|
|
tablet_data["name"] += messenger.saved_identification
|
|
tablet_data["ref"] += REF(messenger)
|
|
|
|
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
|