mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-07-18 19:44:58 +01:00
Removes more NTNet from Tablets and removes a ton of dead code (#74085)
## About The Pull Request Removes NtNet softwaredownload/communication because they did nothing, so this also removes the feature to shut them off from Wirecarp I removed tablets from being added to networks, Tablets already generate logs for actions they do, which is already enough for the effects it has in-game (just being visible to Wirecarp), once NtNet is deleted from everything else then we can move it to ModPCs and limit logging to only ModPC actions. Fixes shutting off ntnet relays from Wirecarp, now you can properly shut off Ntnet, and the warning that it kicks you out of the program is now true. Gives the Holodeck it's own network root define and fixes Syndicate network showing up on Wirecarp Wirecarp's PDA logs now shows the source of an action ## Why It's Good For The Game Moves ModPCs further from NTNet so we can move towards deleting it entirely Makes Wirecarp more responsible and trustworthy Removes useless stuff that never gets used, simplifying a overthought overcomplicated system. ## Changelog 🆑 balance: Wirecarp now properly shuts off NtNet remotely. balance: Wirecarp now shows the source of a PDA that does an action. fix: Wirecarp can no longer be used to see if Nukies exist through their networks. del: Removes Software downloading and communication Ntnet networks, as they were pretty worthless. /🆑
This commit is contained in:
@@ -135,7 +135,6 @@ GLOBAL_LIST_EMPTY(TabletMessengers) // a list of all active messengers, similar
|
||||
|
||||
update_appearance()
|
||||
register_context()
|
||||
init_network_id(NETWORK_TABLETS)
|
||||
Add_Messenger()
|
||||
install_default_programs()
|
||||
|
||||
@@ -468,7 +467,7 @@ GLOBAL_LIST_EMPTY(TabletMessengers) // a list of all active messengers, similar
|
||||
shutdown_computer()
|
||||
return
|
||||
|
||||
if(active_program && active_program.requires_ntnet && !get_ntnet_status(active_program.requires_ntnet_feature))
|
||||
if(active_program && active_program.requires_ntnet && !get_ntnet_status())
|
||||
active_program.event_networkfailure(FALSE) // Active program requires NTNet to run but we've just lost connection. Crash.
|
||||
|
||||
for(var/datum/computer_file/program/idle_programs as anything in idle_threads)
|
||||
@@ -476,7 +475,7 @@ GLOBAL_LIST_EMPTY(TabletMessengers) // a list of all active messengers, similar
|
||||
idle_threads.Remove(idle_programs)
|
||||
continue
|
||||
idle_programs.process_tick(delta_time)
|
||||
idle_programs.ntnet_status = get_ntnet_status(idle_programs.requires_ntnet_feature)
|
||||
idle_programs.ntnet_status = get_ntnet_status()
|
||||
if(idle_programs.requires_ntnet && !idle_programs.ntnet_status)
|
||||
idle_programs.event_networkfailure(TRUE)
|
||||
|
||||
@@ -607,7 +606,7 @@ GLOBAL_LIST_EMPTY(TabletMessengers) // a list of all active messengers, similar
|
||||
to_chat(user, span_danger("\The [src] displays a \"Maximal CPU load reached. Unable to run another program.\" error."))
|
||||
return FALSE
|
||||
|
||||
if(program.requires_ntnet && !get_ntnet_status(program.requires_ntnet_feature)) // The program requires NTNet connection, but we are not connected to NTNet.
|
||||
if(program.requires_ntnet && !get_ntnet_status()) // The program requires NTNet connection, but we are not connected to NTNet.
|
||||
to_chat(user, span_danger("\The [src]'s screen shows \"Unable to connect to NTNet. Please retry. If problem persists contact your system administrator.\" warning."))
|
||||
return FALSE
|
||||
|
||||
@@ -621,9 +620,9 @@ GLOBAL_LIST_EMPTY(TabletMessengers) // a list of all active messengers, similar
|
||||
return TRUE
|
||||
|
||||
// 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)
|
||||
/obj/item/modular_computer/proc/get_ntnet_status()
|
||||
// NTNet is down and we are not connected via wired connection. No signal.
|
||||
if(!SSmodular_computers.check_function(specific_action))
|
||||
if(!SSmodular_computers.check_relay_operation())
|
||||
return NTNET_NO_SIGNAL
|
||||
|
||||
// computers are connected through ethernet
|
||||
@@ -647,7 +646,7 @@ GLOBAL_LIST_EMPTY(TabletMessengers) // a list of all active messengers, similar
|
||||
if(!get_ntnet_status())
|
||||
return FALSE
|
||||
|
||||
return SSnetworks.add_log(text, network_id)
|
||||
return SSnetworks.add_log("[src]: [text]", network_id)
|
||||
|
||||
/obj/item/modular_computer/proc/shutdown_computer(loud = 1)
|
||||
kill_program(forced = TRUE)
|
||||
|
||||
@@ -322,7 +322,7 @@
|
||||
return ..()
|
||||
return FALSE
|
||||
|
||||
/obj/item/modular_computer/pda/silicon/get_ntnet_status(specific_action = 0)
|
||||
/obj/item/modular_computer/pda/silicon/get_ntnet_status()
|
||||
//No borg found
|
||||
if(!silicon_owner)
|
||||
return FALSE
|
||||
|
||||
@@ -21,8 +21,6 @@
|
||||
var/header_program = FALSE
|
||||
/// 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 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
|
||||
/// Bitflags (PROGRAM_CONSOLE, PROGRAM_LAPTOP, PROGRAM_TABLET combination) or PROGRAM_ALL
|
||||
@@ -52,7 +50,6 @@
|
||||
temp.filedesc = filedesc
|
||||
temp.program_icon_state = program_icon_state
|
||||
temp.requires_ntnet = requires_ntnet
|
||||
temp.requires_ntnet_feature = requires_ntnet_feature
|
||||
temp.usage_flags = usage_flags
|
||||
return temp
|
||||
|
||||
@@ -61,11 +58,11 @@
|
||||
if(computer)
|
||||
computer.update_appearance()
|
||||
|
||||
// Attempts to create a log in global ntnet datum. Returns 1 on success, 0 on fail.
|
||||
///Attempts to generate an Ntnet log, returns the log on success, FALSE otherwise.
|
||||
/datum/computer_file/program/proc/generate_network_log(text)
|
||||
if(computer)
|
||||
return computer.add_log(text)
|
||||
return 0
|
||||
return FALSE
|
||||
|
||||
/**
|
||||
*Runs when the device is used to attack an atom in non-combat mode using right click (secondary).
|
||||
@@ -153,10 +150,10 @@
|
||||
**/
|
||||
/datum/computer_file/program/proc/on_start(mob/living/user)
|
||||
SHOULD_CALL_PARENT(TRUE)
|
||||
if(can_run(user, 1))
|
||||
if(can_run(user, loud = TRUE))
|
||||
if(requires_ntnet)
|
||||
var/obj/item/card/id/ID = computer.computer_id_slot?.GetID()
|
||||
generate_network_log("Connection opened -- Program ID: [filename] User:[ID?"[ID.registered_name]":"None"]")
|
||||
generate_network_log("Connection opened -- Program ID:[filename] User:[ID?"[ID.registered_name]":"None"]")
|
||||
program_state = PROGRAM_STATE_ACTIVE
|
||||
return TRUE
|
||||
return FALSE
|
||||
|
||||
@@ -6,7 +6,6 @@
|
||||
undeletable = TRUE
|
||||
size = 4
|
||||
requires_ntnet = TRUE
|
||||
requires_ntnet_feature = NTNET_SOFTWAREDOWNLOAD
|
||||
available_on_ntnet = FALSE
|
||||
ui_header = "downloader_finished.gif"
|
||||
tgui_id = "NtosNetDownloader"
|
||||
|
||||
@@ -12,7 +12,6 @@
|
||||
extended_desc = "This program allows communication over NTNRC network"
|
||||
size = 8
|
||||
requires_ntnet = TRUE
|
||||
requires_ntnet_feature = NTNET_COMMUNICATION
|
||||
ui_header = "ntnrc_idle.gif"
|
||||
available_on_ntnet = TRUE
|
||||
tgui_id = "NtosNetChat"
|
||||
|
||||
@@ -22,6 +22,12 @@
|
||||
if("toggleIDS")
|
||||
SSmodular_computers.intrusion_detection_enabled = !SSmodular_computers.intrusion_detection_enabled
|
||||
return TRUE
|
||||
if("toggle_relay")
|
||||
var/obj/machinery/ntnet_relay/target_relay = locate(params["ref"]) in SSmodular_computers.ntnet_relays
|
||||
if(!istype(target_relay))
|
||||
return
|
||||
target_relay.set_relay_enabled(!target_relay.relay_enabled)
|
||||
return TRUE
|
||||
if("purgelogs")
|
||||
SSnetworks.purge_logs()
|
||||
return TRUE
|
||||
@@ -29,24 +35,25 @@
|
||||
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
|
||||
return TRUE
|
||||
|
||||
/datum/computer_file/program/ntnetmonitor/ui_data(mob/user)
|
||||
var/list/data = list()
|
||||
|
||||
data["ntnetstatus"] = SSmodular_computers.check_function()
|
||||
data["ntnetrelays"] = SSmodular_computers.ntnet_relays.len
|
||||
data["ntnetrelays"] = list()
|
||||
for(var/obj/machinery/ntnet_relay/relays as anything in SSmodular_computers.ntnet_relays)
|
||||
var/list/relay_data = list()
|
||||
relay_data["is_operational"] = !!relays.is_operational
|
||||
relay_data["name"] = relays.name
|
||||
relay_data["ref"] = REF(relays)
|
||||
|
||||
data["config_softwaredownload"] = SSmodular_computers.setting_softwaredownload
|
||||
data["config_communication"] = SSmodular_computers.setting_communication
|
||||
data["ntnetrelays"] += list(relay_data)
|
||||
|
||||
data["idsstatus"] = SSmodular_computers.intrusion_detection_enabled
|
||||
data["idsalarm"] = SSmodular_computers.intrusion_detection_alarm
|
||||
|
||||
Reference in New Issue
Block a user