mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2025-12-27 01:51:50 +00:00
* Add the system for managed global variables * Travis ban old globals * So you CAN inline proccall, that's neat * Fix that * master.dm * Remove the hack procs * Move InitGlobals to the proper spot * configuration.dm * Fix the missing pre-slash * clockcult.dm * This is probably for the best * Doy * Fix shit * Rest of the DEFINES tree * Fix * Use global. for access * Update find_references_in_globals Always hated that proc Whoever made it must've bee a r e a l idiot... * __HELPERS tree * Move global initialization to master. Fix the declaration * database.dm * Dat newline * I said DECLARATIVE order! * Here's something you can chew on @Iamgoofball * game_modes.dm * Fix this * genetics.dm * flavor_misc.dm * More stuff * Do it mso's way. Keep the controllers as global * Make master actually see it * Fix * Finish _globalvars/lists * Finish the rest of the _globalvars tree * This is weird * Migrate the controllers * SLOTH -> GLOB * Lighting globals * round_start_time -> ticker * PAI card list -> pai SS * record_id_num -> static * Diseases list -> SSdisease * More disease globals to the SS * More disease stuff * Emote list * Better and better * Bluh * So much stuff * Ahh * Wires * dview * station_areas * Teleportlocs * blood_splatter_icons * Stuff and such * More stuff * RAD IO * More stuff and such * Blob shit * Changeling stuff * Add "Balance" to changelogs * Balance for changelog compiler + Auto Tagging * Update the PR template * hivemind_bank * Bip * sacrificed * Good shit * Better define * More cult shit * Devil shit * Gang shit * > borers Fix shit * Rename the define * Nuke * Objectives * Sandbox * Multiverse sword * Announce systems * Stuff and such * TC con * Airlock * doppllllerrrrrr * holopads * Shut up byond you inconsistent fuck * Sneaky fuck * Burp * Bip * Fixnshit * Port without regard * askdlfjs; * asdfjasoidojfi * Protected globals and more * SO MANY * ajsimkvahsaoisd * akfdsiaopwimfeoiwafaw * gsdfigjosidjfgiosdg * AHHHHHHHHHHHHHHHHHHHHHHH!!!!! * facerolll * ASDFASDFASDF * Removes the unused parts of dmm_suite * WIP * Fix quote * asdfjauwfnkjs * afwlunhskjfda * asfjlaiwuefhaf * SO CLOSE * wwwweeeeeewwwww * agdgmoewranwg * HOLY MOTHER OF FUCK AND THATS JUST HALF THE JOB?!? * Fix syntax errors * 100 errors * Another 100 * So many... * Ugh * More shit * kilme * Stuuuuuufffff * ajrgmrlshio;djfa;sdkl * jkbhkhjbmjvjmh * soi soi soi * butt * TODAY WE LEARNED THAT GLOBAL AND STATIC ARE THE EXACT SAME FUCKING THING * lllllllllllllllllllllllllllllllllllllllllll * afsdijfiawhnflnjhnwsdfs * yugykihlugk,kj * time to go * STUFFF!!! * AAAAAAAAAAAAAAAAAHHHHHHHHHHHHHHHHHHHHHHHHHHH!!!!!!!!!!!!!!!!!!!!!!! * ngoaijdjlfkamsdlkf * Break time * aufjsdklfalsjfi * CONTROL KAY AND PRAY * IT COMPILEELEELELAKLJFKLDAFJLKFDJLADKJHFLJKAJGAHIEJALDFJ!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! * Goteem * Fix testing mode * This does not belong in this PR * Convert it to a controller * Eh, fuck this option * Revert controllerization Ill do it some other time * Fix * Working controllerization * FOR THE LOVE OF CHRIST PROTECT THE LOGS * Protect admins and deadmins * Use the inbuilt proc
94 lines
3.3 KiB
Plaintext
94 lines
3.3 KiB
Plaintext
/datum/computer_file/program/ntnetmonitor
|
|
filename = "ntmonitor"
|
|
filedesc = "NTNet Diagnostics and Monitoring"
|
|
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 = 1
|
|
required_access = GLOB.access_network //Network control is a more secure program.
|
|
available_on_ntnet = 1
|
|
|
|
/datum/computer_file/program/ntnetmonitor/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = 0, datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state)
|
|
|
|
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
|
|
if (!ui)
|
|
|
|
var/datum/asset/assets = get_asset_datum(/datum/asset/simple/headers)
|
|
assets.send(user)
|
|
|
|
|
|
ui = new(user, src, ui_key, "ntnet_monitor", "NTNet Diagnostics and Monitoring Tool", 575, 700, state = state)
|
|
ui.open()
|
|
ui.set_autoupdate(state = 1)
|
|
|
|
|
|
/datum/computer_file/program/ntnetmonitor/ui_act(action, params)
|
|
if(..())
|
|
return 1
|
|
switch(action)
|
|
if("resetIDS")
|
|
. = 1
|
|
if(GLOB.ntnet_global)
|
|
GLOB.ntnet_global.resetIDS()
|
|
return 1
|
|
if("toggleIDS")
|
|
. = 1
|
|
if(GLOB.ntnet_global)
|
|
GLOB.ntnet_global.toggleIDS()
|
|
return 1
|
|
if("toggleWireless")
|
|
. = 1
|
|
if(!GLOB.ntnet_global)
|
|
return 1
|
|
|
|
// NTNet is disabled. Enabling can be done without user prompt
|
|
if(GLOB.ntnet_global.setting_disabled)
|
|
GLOB.ntnet_global.setting_disabled = 0
|
|
return 1
|
|
|
|
// NTNet is enabled and user is about to shut it down. Let's ask them if they really want to do it, as wirelessly connected computers won't connect without NTNet being enabled (which may prevent people from turning it back on)
|
|
var/mob/user = usr
|
|
if(!user)
|
|
return 1
|
|
var/response = alert(user, "Really disable NTNet wireless? If your computer is connected wirelessly you won't be able to turn it back on! This will affect all connected wireless devices.", "NTNet shutdown", "Yes", "No")
|
|
if(response == "Yes")
|
|
GLOB.ntnet_global.setting_disabled = 1
|
|
return 1
|
|
if("purgelogs")
|
|
. = 1
|
|
if(GLOB.ntnet_global)
|
|
GLOB.ntnet_global.purge_logs()
|
|
if("updatemaxlogs")
|
|
. = 1
|
|
var/mob/user = usr
|
|
var/logcount = text2num(input(user,"Enter amount of logs to keep in memory ([MIN_NTNET_LOGS]-[MAX_NTNET_LOGS]):"))
|
|
if(GLOB.ntnet_global)
|
|
GLOB.ntnet_global.update_max_log_count(logcount)
|
|
if("toggle_function")
|
|
. = 1
|
|
if(!GLOB.ntnet_global)
|
|
return 1
|
|
GLOB.ntnet_global.toggle_function(text2num(params["id"]))
|
|
|
|
/datum/computer_file/program/ntnetmonitor/ui_data(mob/user)
|
|
if(!GLOB.ntnet_global)
|
|
return
|
|
var/list/data = get_header_data()
|
|
|
|
data["ntnetstatus"] = GLOB.ntnet_global.check_function()
|
|
data["ntnetrelays"] = GLOB.ntnet_global.relays.len
|
|
data["idsstatus"] = GLOB.ntnet_global.intrusion_detection_enabled
|
|
data["idsalarm"] = GLOB.ntnet_global.intrusion_detection_alarm
|
|
|
|
data["config_softwaredownload"] = GLOB.ntnet_global.setting_softwaredownload
|
|
data["config_peertopeer"] = GLOB.ntnet_global.setting_peertopeer
|
|
data["config_communication"] = GLOB.ntnet_global.setting_communication
|
|
data["config_systemcontrol"] = GLOB.ntnet_global.setting_systemcontrol
|
|
|
|
data["ntnetlogs"] = list()
|
|
|
|
for(var/i in GLOB.ntnet_global.logs)
|
|
data["ntnetlogs"] += list(list("entry" = i))
|
|
data["ntnetmaxlogs"] = GLOB.ntnet_global.setting_maxlogcount
|
|
|
|
return data |