Updates Part Eleven

This commit is contained in:
Unknown
2019-04-13 19:30:30 -04:00
parent ced7e8d3b0
commit 042720823a
14 changed files with 271 additions and 28 deletions
@@ -31,6 +31,7 @@
data["ntnetlogs"] = ntnet_global.logs
data["ntnetmaxlogs"] = ntnet_global.setting_maxlogcount
data["banned_nids"] = list(ntnet_global.banned_nids)
ui = SSnanoui.try_update_ui(user, src, ui_key, ui, data, force_open)
if (!ui)
@@ -41,21 +42,19 @@
ui.open()
ui.set_auto_update(1)
/datum/nano_module/computer_ntnetmonitor/Topic(href, href_list)
/datum/nano_module/computer_ntnetmonitor/Topic(href, href_list, state)
var/mob/user = usr
if(..())
return 1
if(href_list["resetIDS"])
. = 1
if(ntnet_global)
ntnet_global.resetIDS()
return 1
if(href_list["toggleIDS"])
. = 1
if(ntnet_global)
ntnet_global.toggleIDS()
return 1
if(href_list["toggleWireless"])
. = 1
if(!ntnet_global)
return 1
@@ -65,7 +64,6 @@
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")
@@ -73,17 +71,30 @@
ntnet_global.setting_disabled = 1
return 1
if(href_list["purgelogs"])
. = 1
if(ntnet_global)
ntnet_global.purge_logs()
return 1
if(href_list["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(ntnet_global)
ntnet_global.update_max_log_count(logcount)
return 1
if(href_list["toggle_function"])
. = 1
if(!ntnet_global)
return 1
ntnet_global.toggle_function(href_list["toggle_function"])
return 1
if(href_list["ban_nid"])
if(!ntnet_global)
return 1
var/nid = input(user,"Enter NID of device which you want to block from the network:", "Enter NID") as null|num
if(nid && CanUseTopic(user, state))
ntnet_global.banned_nids |= nid
return 1
if(href_list["unban_nid"])
if(!ntnet_global)
return 1
var/nid = input(user,"Enter NID of device which you want to unblock from the network:", "Enter NID") as null|num
if(nid && CanUseTopic(user, state))
ntnet_global.banned_nids -= nid
return 1