mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-07-11 07:03:30 +01:00
Makes all global variables handled by the GLOB controller (#13152)
* Handlers converted, now to fix 3532 compile errors * 3532 compile fixes later, got runtimes on startup * Well the server loads now atleast * Take 2 * Oops
This commit is contained in:
@@ -21,7 +21,7 @@
|
||||
if(downloaded_file)
|
||||
return 0
|
||||
|
||||
var/datum/computer_file/program/PRG = ntnet_global.find_ntnet_file_by_name(filename)
|
||||
var/datum/computer_file/program/PRG = GLOB.ntnet_global.find_ntnet_file_by_name(filename)
|
||||
|
||||
if(!PRG || !istype(PRG))
|
||||
return 0
|
||||
@@ -37,10 +37,10 @@
|
||||
|
||||
ui_header = "downloader_running.gif"
|
||||
|
||||
if(PRG in ntnet_global.available_station_software)
|
||||
if(PRG in GLOB.ntnet_global.available_station_software)
|
||||
generate_network_log("Began downloading file [PRG.filename].[PRG.filetype] from NTNet Software Repository.")
|
||||
hacked_download = 0
|
||||
else if(PRG in ntnet_global.available_antag_software)
|
||||
else if(PRG in GLOB.ntnet_global.available_antag_software)
|
||||
generate_network_log("Began downloading file **ENCRYPTED**.[PRG.filetype] from unspecified server.")
|
||||
hacked_download = 1
|
||||
else
|
||||
@@ -135,7 +135,7 @@
|
||||
data["disk_size"] = hard_drive.max_capacity
|
||||
data["disk_used"] = hard_drive.used_capacity
|
||||
var/list/all_entries[0]
|
||||
for(var/A in ntnet_global.available_station_software)
|
||||
for(var/A in GLOB.ntnet_global.available_station_software)
|
||||
var/datum/computer_file/program/P = A
|
||||
// Only those programs our user can run will show in the list
|
||||
if(!P.can_run(user,transfer = 1))
|
||||
@@ -151,7 +151,7 @@
|
||||
data["hackedavailable"] = 0
|
||||
if(computer.emagged) // If we are running on emagged computer we have access to some "bonus" software
|
||||
var/list/hacked_programs[0]
|
||||
for(var/S in ntnet_global.available_antag_software)
|
||||
for(var/S in GLOB.ntnet_global.available_antag_software)
|
||||
var/datum/computer_file/program/P = S
|
||||
data["hackedavailable"] = 1
|
||||
hacked_programs.Add(list(list(
|
||||
|
||||
@@ -52,7 +52,7 @@
|
||||
|
||||
|
||||
/datum/computer_file/program/chatclient/ui_data(mob/user)
|
||||
if(!ntnet_global || !ntnet_global.chat_channels)
|
||||
if(!GLOB.ntnet_global || !GLOB.ntnet_global.chat_channels)
|
||||
return
|
||||
|
||||
var/list/data = get_header_data()
|
||||
@@ -78,7 +78,7 @@
|
||||
|
||||
else // Channel selection screen
|
||||
var/list/all_channels[0]
|
||||
for(var/C in ntnet_global.chat_channels)
|
||||
for(var/C in GLOB.ntnet_global.chat_channels)
|
||||
var/datum/ntnet_conversation/conv = C
|
||||
if(conv && conv.title)
|
||||
all_channels.Add(list(list(
|
||||
@@ -108,7 +108,7 @@
|
||||
if("PRG_joinchannel")
|
||||
. = 1
|
||||
var/datum/ntnet_conversation/C
|
||||
for(var/datum/ntnet_conversation/chan in ntnet_global.chat_channels)
|
||||
for(var/datum/ntnet_conversation/chan in GLOB.ntnet_global.chat_channels)
|
||||
if(chan.id == text2num(href_list["id"]))
|
||||
C = chan
|
||||
break
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
var/global/nttransfer_uid = 0
|
||||
GLOBAL_VAR_INIT(nttransfer_uid, 0)
|
||||
|
||||
/datum/computer_file/program/nttransfer
|
||||
filename = "nttransfer"
|
||||
@@ -24,8 +24,8 @@ var/global/nttransfer_uid = 0
|
||||
var/upload_menu = 0 // Whether we show the program list and upload menu
|
||||
|
||||
/datum/computer_file/program/nttransfer/New()
|
||||
unique_token = nttransfer_uid
|
||||
nttransfer_uid++
|
||||
unique_token = GLOB.nttransfer_uid
|
||||
GLOB.nttransfer_uid++
|
||||
..()
|
||||
|
||||
/datum/computer_file/program/nttransfer/process_tick()
|
||||
@@ -100,7 +100,7 @@ var/global/nttransfer_uid = 0
|
||||
return 1
|
||||
switch(href_list["action"])
|
||||
if("PRG_downloadfile")
|
||||
for(var/datum/computer_file/program/nttransfer/P in ntnet_global.fileservers)
|
||||
for(var/datum/computer_file/program/nttransfer/P in GLOB.ntnet_global.fileservers)
|
||||
if("[P.unique_token]" == href_list["id"])
|
||||
remote = P
|
||||
break
|
||||
@@ -118,8 +118,8 @@ var/global/nttransfer_uid = 0
|
||||
error = ""
|
||||
upload_menu = 0
|
||||
finalize_download()
|
||||
if(src in ntnet_global.fileservers)
|
||||
ntnet_global.fileservers.Remove(src)
|
||||
if(src in GLOB.ntnet_global.fileservers)
|
||||
GLOB.ntnet_global.fileservers.Remove(src)
|
||||
for(var/datum/computer_file/program/nttransfer/T in connected_clients)
|
||||
T.crash_download("Remote server has forcibly closed the connection")
|
||||
provided_file = null
|
||||
@@ -145,7 +145,7 @@ var/global/nttransfer_uid = 0
|
||||
if(!P.can_run(usr,transfer = 1))
|
||||
error = "Access Error: Insufficient rights to upload file."
|
||||
provided_file = F
|
||||
ntnet_global.fileservers.Add(src)
|
||||
GLOB.ntnet_global.fileservers.Add(src)
|
||||
return
|
||||
error = "I/O Error: Unable to locate file on hard drive."
|
||||
return 1
|
||||
@@ -183,7 +183,7 @@ var/global/nttransfer_uid = 0
|
||||
data["upload_filelist"] = all_files
|
||||
else
|
||||
var/list/all_servers[0]
|
||||
for(var/datum/computer_file/program/nttransfer/P in ntnet_global.fileservers)
|
||||
for(var/datum/computer_file/program/nttransfer/P in GLOB.ntnet_global.fileservers)
|
||||
all_servers.Add(list(list(
|
||||
"uid" = P.unique_token,
|
||||
"filename" = "[P.provided_file.filename].[P.provided_file.filetype]",
|
||||
|
||||
Reference in New Issue
Block a user