-
-
Notifications
You must be signed in to change notification settings - Fork 451
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Ports SSnetworks killings * Update names.dm * Removes my debug message and fixes instances it caught
- Loading branch information
1 parent
7cc800a
commit 4212a5c
Showing
66 changed files
with
590 additions
and
960 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
Oops, something went wrong.