mirror of
https://github.com/VOREStation/VOREStation.git
synced 2026-07-19 02:56:14 +01:00
Convert some more globals (#19231)
* move ref lists from world new to ref list creation * tg styl * . * next globals * ugh * some more * pain * . * horror * . * . * . * shoe me * ye * . * eh * . * . --------- Co-authored-by: Cameron Lennox <killer65311@gmail.com>
This commit is contained in:
+5
-5
@@ -50,7 +50,7 @@
|
||||
data["messages"] = all_messages
|
||||
|
||||
var/list/all_accounts = list()
|
||||
for(var/datum/computer_file/data/email_account/account in ntnet_global.email_accounts)
|
||||
for(var/datum/computer_file/data/email_account/account in GLOB.ntnet_global.email_accounts)
|
||||
if(!account.can_login)
|
||||
continue
|
||||
all_accounts.Add(list(list(
|
||||
@@ -85,7 +85,7 @@
|
||||
return TRUE
|
||||
|
||||
current_account.suspended = !current_account.suspended
|
||||
ntnet_global.add_log_with_ids_check("EMAIL LOG: SA-EDIT Account [current_account.login] has been [current_account.suspended ? "" : "un" ]suspended by SA [I.registered_name] ([I.assignment]).")
|
||||
GLOB.ntnet_global.add_log_with_ids_check("EMAIL LOG: SA-EDIT Account [current_account.login] has been [current_account.suspended ? "" : "un" ]suspended by SA [I.registered_name] ([I.assignment]).")
|
||||
error = "Account [current_account.login] has been [current_account.suspended ? "" : "un" ]suspended."
|
||||
return TRUE
|
||||
|
||||
@@ -97,7 +97,7 @@
|
||||
if(!newpass)
|
||||
return TRUE
|
||||
current_account.password = newpass
|
||||
ntnet_global.add_log_with_ids_check("EMAIL LOG: SA-EDIT Password for account [current_account.login] has been changed by SA [I.registered_name] ([I.assignment]).")
|
||||
GLOB.ntnet_global.add_log_with_ids_check("EMAIL LOG: SA-EDIT Password for account [current_account.login] has been changed by SA [I.registered_name] ([I.assignment]).")
|
||||
return TRUE
|
||||
|
||||
if("viewmail")
|
||||
@@ -111,7 +111,7 @@
|
||||
return TRUE
|
||||
|
||||
if("viewaccount")
|
||||
for(var/datum/computer_file/data/email_account/email_account in ntnet_global.email_accounts)
|
||||
for(var/datum/computer_file/data/email_account/email_account in GLOB.ntnet_global.email_accounts)
|
||||
if(email_account.uid == text2num(params["viewaccount"]))
|
||||
current_account = email_account
|
||||
break
|
||||
@@ -126,7 +126,7 @@
|
||||
return TRUE
|
||||
|
||||
var/complete_login = "[newlogin]@[newdomain]"
|
||||
if(ntnet_global.does_email_exist(complete_login))
|
||||
if(GLOB.ntnet_global.does_email_exist(complete_login))
|
||||
error = "Error creating account: An account with same address already exists."
|
||||
return TRUE
|
||||
|
||||
|
||||
@@ -13,29 +13,29 @@
|
||||
category = PROG_ADMIN
|
||||
|
||||
/datum/computer_file/program/ntnetmonitor/tgui_data(mob/user)
|
||||
if(!ntnet_global)
|
||||
if(!GLOB.ntnet_global)
|
||||
return
|
||||
var/list/data = get_header_data()
|
||||
|
||||
data["ntnetstatus"] = ntnet_global.check_function()
|
||||
data["ntnetrelays"] = ntnet_global.relays.len
|
||||
data["idsstatus"] = ntnet_global.intrusion_detection_enabled
|
||||
data["idsalarm"] = ntnet_global.intrusion_detection_alarm
|
||||
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"] = ntnet_global.setting_softwaredownload
|
||||
data["config_peertopeer"] = ntnet_global.setting_peertopeer
|
||||
data["config_communication"] = ntnet_global.setting_communication
|
||||
data["config_systemcontrol"] = ntnet_global.setting_systemcontrol
|
||||
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()
|
||||
data["minlogs"] = MIN_NTNET_LOGS
|
||||
data["maxlogs"] = MAX_NTNET_LOGS
|
||||
|
||||
data["banned_nids"] = list(ntnet_global.banned_nids)
|
||||
data["banned_nids"] = list(GLOB.ntnet_global.banned_nids)
|
||||
|
||||
for(var/i in ntnet_global.logs)
|
||||
for(var/i in GLOB.ntnet_global.logs)
|
||||
data["ntnetlogs"] += list(list("entry" = i))
|
||||
data["ntnetmaxlogs"] = ntnet_global.setting_maxlogcount
|
||||
data["ntnetmaxlogs"] = GLOB.ntnet_global.setting_maxlogcount
|
||||
|
||||
return data
|
||||
|
||||
@@ -44,51 +44,51 @@
|
||||
return
|
||||
switch(action)
|
||||
if("resetIDS")
|
||||
if(ntnet_global)
|
||||
ntnet_global.resetIDS()
|
||||
if(GLOB.ntnet_global)
|
||||
GLOB.ntnet_global.resetIDS()
|
||||
return TRUE
|
||||
if("toggleIDS")
|
||||
if(ntnet_global)
|
||||
ntnet_global.toggleIDS()
|
||||
if(GLOB.ntnet_global)
|
||||
GLOB.ntnet_global.toggleIDS()
|
||||
return TRUE
|
||||
if("toggleWireless")
|
||||
if(!ntnet_global)
|
||||
if(!GLOB.ntnet_global)
|
||||
return
|
||||
|
||||
// NTNet is disabled. Enabling can be done without user prompt
|
||||
if(ntnet_global.setting_disabled)
|
||||
ntnet_global.setting_disabled = FALSE
|
||||
if(GLOB.ntnet_global.setting_disabled)
|
||||
GLOB.ntnet_global.setting_disabled = FALSE
|
||||
return TRUE
|
||||
|
||||
var/response = tgui_alert(ui.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", list("Yes", "No"))
|
||||
if(response == "Yes" && tgui_status(ui.user, state) == STATUS_INTERACTIVE)
|
||||
ntnet_global.setting_disabled = TRUE
|
||||
GLOB.ntnet_global.setting_disabled = TRUE
|
||||
return TRUE
|
||||
if("purgelogs")
|
||||
if(ntnet_global)
|
||||
ntnet_global.purge_logs()
|
||||
if(GLOB.ntnet_global)
|
||||
GLOB.ntnet_global.purge_logs()
|
||||
return TRUE
|
||||
if("updatemaxlogs")
|
||||
var/logcount = params["new_number"]
|
||||
if(ntnet_global)
|
||||
ntnet_global.update_max_log_count(logcount)
|
||||
if(GLOB.ntnet_global)
|
||||
GLOB.ntnet_global.update_max_log_count(logcount)
|
||||
return TRUE
|
||||
if("toggle_function")
|
||||
if(!ntnet_global)
|
||||
if(!GLOB.ntnet_global)
|
||||
return
|
||||
ntnet_global.toggle_function(text2num(params["id"]))
|
||||
GLOB.ntnet_global.toggle_function(text2num(params["id"]))
|
||||
return TRUE
|
||||
if("ban_nid")
|
||||
if(!ntnet_global)
|
||||
if(!GLOB.ntnet_global)
|
||||
return
|
||||
var/nid = tgui_input_number(ui.user,"Enter NID of device which you want to block from the network:", "Enter NID")
|
||||
if(nid && tgui_status(ui.user, state) == STATUS_INTERACTIVE)
|
||||
ntnet_global.banned_nids |= nid
|
||||
GLOB.ntnet_global.banned_nids |= nid
|
||||
return TRUE
|
||||
if("unban_nid")
|
||||
if(!ntnet_global)
|
||||
if(!GLOB.ntnet_global)
|
||||
return
|
||||
var/nid = tgui_input_number(ui.user,"Enter NID of device which you want to unblock from the network:", "Enter NID")
|
||||
if(nid && tgui_status(ui.user, state) == STATUS_INTERACTIVE)
|
||||
ntnet_global.banned_nids -= nid
|
||||
GLOB.ntnet_global.banned_nids -= nid
|
||||
return TRUE
|
||||
|
||||
Reference in New Issue
Block a user