Files
Bubberstation/code/controllers/subsystem/modular_computers.dm
SkyratBot 79bb4facfc [MIRROR] Removes networks from the game [MDB IGNORE] (#20083)
* Removes networks from the game (#74142)

## About The Pull Request

This is a continuation of
https://github.com/tgstation/tgstation/pull/74085 - I announced in the
comments there that this would be my next PR, and this is it.

Removes SSnetwork, ``/datum/ntnet``,
``/datum/component/ntnet_interface``, ``var/network_root_id``, the
network unit test, and a lot of other things related to networks.

- NTNet circuits now check for an Ntnet relay, and uses signals to
operate.
- Logs in Wirecarp is now only for PDA and Ntnet Relay things, so you
can no longer see what ruins exist using it (why should Wirecarp know
that Oldstation spawned? The flavor is that they dont know its there).
- Removed it from MULEbots entirely, I don't think it even did anything
for them? Botkeeper seems to work without it, so it's possibly there
from pre-tgui PDAs.
- Moves assigning random names to a base proc instead of being tied to
network, this is things like random-naming scrubbers/vents. The behavior
hasn't changed at all.
- Makes Ntos work for consoles when relays are down, as the comments
said they're supposed to (because they're wired). I think this was an
accidental change on my part, so this is a revert of that.

## Why It's Good For The Game

Ntnet is ancient code that hasn't given us much that we can't do with
already existing alternatives, we've been slowly moving away from it for
init times, and though a large portion of that was limited to airlocks,
I still don't think this is a system worth keeping around.
It's way too complex to expect feature coders to do anything with it,
and too old with better alternatives for anyone to want to improve any
of it.

## Changelog

🆑
fix: Computers are now properly connected to Ethernet, and can use Ntos
when Relays are down.
refactor: Removes Ntnet and Ntnet interfaces, which was only used by
Ntnet circuits (which now directly checks for a Relay to work) and
MULEbots, which did nothing with it.
balance: Wirecarp no longer tells you what ruins spawned in a round,
instead it's limited to PDA logs, and tells you the source too. This
means the RD can catch someone running illegal programs if they don't
make any attempt at hiding it.
qol: Wirecarp logs is now set to save 300 at once, instead of 100 and
being increased to 300 by the RD during the round. This is pretty
insignificant, since there's no reason to NOT want as many logs as
possible.
/🆑

---------

Co-authored-by: Zephyr <12817816+ZephyrTFA@ users.noreply.github.com>

* Removes networks from the game

---------

Co-authored-by: John Willard <53777086+JohnFulpWillard@users.noreply.github.com>
Co-authored-by: Zephyr <12817816+ZephyrTFA@ users.noreply.github.com>
2023-03-27 03:28:18 +01:00

81 lines
2.8 KiB
Plaintext

///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_NO_FIRE
///List of all ModPC logging
var/list/logs = list()
///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
/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)
///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()
logs.Add(log_string)
// We have too many logs, remove the oldest entries until we get into the limit
if(logs.len > MAX_LOG_COUNT)
logs = logs.Copy(logs.len - MAX_LOG_COUNT, 0)
/**
* Removes all station logs and leaves it with an alert that it's been wiped.
*/
/datum/controller/subsystem/modular_computers/proc/purge_logs()
logs = list()
add_log("-!- LOGS DELETED BY SYSTEM OPERATOR -!-")
#undef MAX_LOG_COUNT