Merge pull request #11873 from PsiOmegaDelta/160102-Yona

Tweaks and fixes.
This commit is contained in:
Ccomp5950
2016-01-12 10:28:30 -05:00
44 changed files with 112 additions and 6699 deletions

View File

@@ -82,4 +82,4 @@
network_destination = "RCON remote control system"
requires_ntnet_feature = NTNET_SYSTEMCONTROL
usage_flags = PROGRAM_LAPTOP | PROGRAM_CONSOLE
size = 19
size = 19

View File

@@ -7,4 +7,4 @@
required_access = access_medical
requires_ntnet = 1
network_destination = "crew lifesigns monitoring system"
size = 11
size = 11

View File

@@ -87,13 +87,13 @@
for(var/obj/machinery/ntnet_relay/R in ntnet_global.relays)
if("[R.uid]" == href_list["PRG_target_relay"])
target = R
return
return 1
if(href_list["PRG_reset"])
target.dos_sources.Remove(src)
target = null
executed = 0
error = ""
return
return 1
if(href_list["PRG_execute"])
if(target)
executed = 1
@@ -101,4 +101,4 @@
if(ntnet_global.intrusion_detection_enabled)
ntnet_global.add_log("IDS WARNING - Excess traffic flood targeting relay [target.uid] detected from device: [computer.network_card.get_network_tag()]")
ntnet_global.intrusion_detection_alarm = 1
return
return 1

View File

@@ -49,6 +49,7 @@
if(!newname)
return
filedesc = newname
return 1
/datum/computer_file/program/revelation/clone()
var/datum/computer_file/program/revelation/temp = ..()

View File

@@ -107,7 +107,10 @@
/datum/computer_file/program/card_mod/Topic(href, href_list)
var/mob/living/user = usr
if(..())
return 1
var/mob/user = usr
var/obj/item/weapon/card/id/user_id_card = user.GetIdCard()
var/obj/item/weapon/card/id/id_card = computer.card_slot.stored_card
var/datum/nano_module/card_mod/module = NM
@@ -214,5 +217,4 @@
id_card.name = text("[id_card.registered_name]'s ID Card ([id_card.assignment])")
nanomanager.update_uis(NM)
..(href, href_list)
return 1
return 1

View File

@@ -12,66 +12,77 @@
var/error
/datum/computer_file/program/filemanager/Topic(href, href_list)
if(..())
return 1
if(href_list["PRG_openfile"])
. = 1
open_file = href_list["PRG_openfile"]
if(href_list["PRG_newtextfile"])
. = 1
var/newname = sanitize(input(usr, "Enter file name or leave blank to cancel:", "File rename"))
if(!newname)
return
return 1
var/obj/item/weapon/computer_hardware/hard_drive/HDD = computer.hard_drive
if(!HDD)
return
return 1
var/datum/computer_file/data/F = new/datum/computer_file/data()
F.filename = newname
F.filetype = "TXT"
HDD.store_file(F)
if(href_list["PRG_deletefile"])
. = 1
var/obj/item/weapon/computer_hardware/hard_drive/HDD = computer.hard_drive
if(!HDD)
return
return 1
var/datum/computer_file/file = HDD.find_file_by_name(href_list["PRG_deletefile"])
if(!file || file.undeletable)
return
return 1
HDD.remove_file(file)
if(href_list["PRG_usbdeletefile"])
. = 1
var/obj/item/weapon/computer_hardware/hard_drive/RHDD = computer.portable_drive
if(!RHDD)
return
return 1
var/datum/computer_file/file = RHDD.find_file_by_name(href_list["PRG_usbdeletefile"])
if(!file || file.undeletable)
return
return 1
RHDD.remove_file(file)
if(href_list["PRG_closefile"])
. = 1
open_file = null
error = null
if(href_list["PRG_clone"])
. = 1
var/obj/item/weapon/computer_hardware/hard_drive/HDD = computer.hard_drive
if(!HDD)
return
return 1
var/datum/computer_file/F = HDD.find_file_by_name(href_list["PRG_clone"])
if(!F || !istype(F))
return
return 1
var/datum/computer_file/C = F.clone(1)
HDD.store_file(C)
if(href_list["PRG_rename"])
. = 1
var/obj/item/weapon/computer_hardware/hard_drive/HDD = computer.hard_drive
if(!HDD)
return
return 1
var/datum/computer_file/file = HDD.find_file_by_name(href_list["PRG_rename"])
if(!file || !istype(file))
return
return 1
var/newname = sanitize(input(usr, "Enter new file name:", "File rename", file.filename))
if(file && newname)
file.filename = newname
if(href_list["PRG_edit"])
. = 1
if(!open_file)
return
return 1
var/obj/item/weapon/computer_hardware/hard_drive/HDD = computer.hard_drive
if(!HDD)
return
return 1
var/datum/computer_file/data/F = HDD.find_file_by_name(open_file)
if(!F || !istype(F))
return
return 1
// 16384 is the limit for file length in characters. Currently, papers have value of 2048 so this is 8 times as long, since we can't edit parts of the file independently.
var/newtext = sanitize(html_decode(input(usr, "Editing file [open_file]. You may use most tags used in paper formatting:", "Text Editor", F.stored_data) as message), 16384)
if(F)
@@ -86,41 +97,43 @@
error = "I/O error: Unable to overwrite file. Hard drive is probably full. You may want to backup your changes before closing this window:<br><br>[F.stored_data]<br><br>"
HDD.store_file(backup)
if(href_list["PRG_printfile"])
. = 1
if(!open_file)
return
return 1
var/obj/item/weapon/computer_hardware/hard_drive/HDD = computer.hard_drive
if(!HDD)
return
return 1
var/datum/computer_file/data/F = HDD.find_file_by_name(open_file)
if(!F || !istype(F))
return
return 1
if(!computer.nano_printer)
error = "Missing Hardware: Your computer does not have required hardware to complete this operation."
return
return 1
if(!computer.nano_printer.print_text(parse_tags(F.stored_data)))
error = "Hardware error: Printer was unable to print the file. It may be out of paper."
return
return 1
if(href_list["PRG_copytousb"])
. = 1
var/obj/item/weapon/computer_hardware/hard_drive/HDD = computer.hard_drive
var/obj/item/weapon/computer_hardware/hard_drive/portable/RHDD = computer.portable_drive
if(!HDD || !RHDD)
return
return 1
var/datum/computer_file/F = HDD.find_file_by_name(href_list["PRG_copytousb"])
if(!F || !istype(F))
return
return 1
var/datum/computer_file/C = F.clone(0)
RHDD.store_file(C)
if(href_list["PRG_copyfromusb"])
. = 1
var/obj/item/weapon/computer_hardware/hard_drive/HDD = computer.hard_drive
var/obj/item/weapon/computer_hardware/hard_drive/portable/RHDD = computer.portable_drive
if(!HDD || !RHDD)
return
return 1
var/datum/computer_file/F = RHDD.find_file_by_name(href_list["PRG_copyfromusb"])
if(!F || !istype(F))
return
return 1
var/datum/computer_file/C = F.clone(0)
HDD.store_file(C)
..(href, href_list)
/datum/computer_file/program/filemanager/proc/parse_tags(var/t)
t = replacetext(t, "\[center\]", "<center>")

View File

@@ -89,17 +89,16 @@
if(href_list["PRG_downloadfile"])
if(!downloaded_file)
begin_file_download(href_list["PRG_downloadfile"])
return
return 1
if(href_list["PRG_reseterror"])
if(downloaderror)
download_completion = 0
download_netspeed = 0
downloaded_file = null
downloaderror = ""
return
return 1
return 0
/datum/nano_module/computer_ntnetdownload
name = "Network Downloader"
var/obj/item/modular_computer/my_computer = null
@@ -162,4 +161,4 @@
ui.auto_update_layout = 1
ui.set_initial_data(data)
ui.open()
ui.set_auto_update(1)
ui.set_auto_update(1)

View File

@@ -47,14 +47,17 @@
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
@@ -66,20 +69,23 @@
// 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
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")
ntnet_global.setting_disabled = 1
return 1
if(href_list["purgelogs"])
. = 1
if(ntnet_global)
ntnet_global.purge_logs()
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)
if(href_list["toggle_function"])
. = 1
if(!ntnet_global)
return
return 1
ntnet_global.toggle_function(href_list["toggle_function"])

View File

@@ -20,9 +20,13 @@
username = "DefaultUser[rand(100, 999)]"
/datum/computer_file/program/chatclient/Topic(href, href_list)
if(..())
return 1
if(href_list["PRG_speak"])
. = 1
if(!channel)
return
return 1
var/mob/living/user = usr
var/message = sanitize(input(user, "Enter message or leave blank to cancel: "))
if(!message || !channel)
@@ -30,6 +34,7 @@
channel.add_message(message, username)
if(href_list["PRG_joinchannel"])
. = 1
var/datum/ntnet_conversation/C
for(var/datum/ntnet_conversation/chan in ntnet_global.chat_channels)
if(chan.id == text2num(href_list["PRG_joinchannel"]))
@@ -37,11 +42,11 @@
break
if(!C)
return
return 1
if(netadmin_mode)
channel = C // Bypasses normal leave/join and passwords. Technically makes the user invisible to others.
return
return 1
if(C.password)
var/mob/living/user = usr
@@ -49,14 +54,16 @@
if(C && (password == C.password))
C.add_client(src)
channel = C
return
return 1
C.add_client(src)
channel = C
if(href_list["PRG_leavechannel"])
. = 1
if(channel)
channel.remove_client(src)
channel = null
if(href_list["PRG_newchannel"])
. = 1
var/mob/living/user = usr
var/channel_title = sanitize(input(user,"Enter channel name or leave blank to cancel:"))
if(!channel_title)
@@ -67,12 +74,13 @@
channel = C
C.title = channel_title
if(href_list["PRG_toggleadmin"])
. = 1
if(netadmin_mode)
netadmin_mode = 0
if(channel)
channel.remove_client(src) // We shouldn't be in channel's user list, but just in case...
channel = null
return
return 1
var/mob/living/user = usr
if(can_run(usr, 1, access_network))
if(channel)
@@ -85,21 +93,23 @@
return
netadmin_mode = 1
if(href_list["PRG_changename"])
. = 1
var/mob/living/user = usr
var/newname = sanitize(input(user,"Enter new nickname or leave blank to cancel:"))
if(!newname)
return
return 1
if(channel)
channel.add_status_message("[username] is now known as [newname].")
username = newname
if(href_list["PRG_savelog"])
. = 1
if(!channel)
return
var/mob/living/user = usr
var/logname = input(user,"Enter desired logfile name (.log) or leave blank to cancel:")
if(!logname || !channel)
return
return 1
var/datum/computer_file/data/logfile = new/datum/computer_file/data/logfile()
// Now we will generate HTML-compliant file that can actually be viewed/printed.
logfile.filename = logname
@@ -112,14 +122,15 @@
if(!computer)
// This program shouldn't even be runnable without computer.
CRASH("Var computer is null!")
return
return 1
if(!computer.hard_drive)
computer.visible_message("\The [computer] shows an \"I/O Error - Hard drive connection error\" warning.")
else // In 99.9% cases this will mean our HDD is full
computer.visible_message("\The [computer] shows an \"I/O Error - Hard drive may be full. Please free some space and try again. Required space: [logfile.size]GQ\" warning.")
if(href_list["PRG_renamechannel"])
. = 1
if(!operator_mode || !channel)
return
return 1
var/mob/living/user = usr
var/newname = sanitize(input(user, "Enter new channel name or leave blank to cancel:"))
if(!newname || !channel)
@@ -127,24 +138,25 @@
channel.add_status_message("Channel renamed from [channel.title] to [newname] by operator.")
channel.title = newname
if(href_list["PRG_deletechannel"])
. = 1
if(channel && ((channel.operator == src) || netadmin_mode))
del(channel)
qdel(channel)
channel = null
if(href_list["PRG_setpassword"])
. = 1
if(!channel || ((channel.operator != src) && !netadmin_mode))
return
return 1
var/mob/living/user = usr
var/newpassword = sanitize(input(user, "Enter new password for this channel. Leave blank to cancel, enter 'nopassword' to remove password completely:"))
if(!channel || !newpassword || ((channel.operator != src) && !netadmin_mode))
return
return 1
if(newpassword == "nopassword")
channel.password = ""
else
channel.password = newpassword
..(href, href_list)
/datum/computer_file/program/chatclient/process_tick()
..()
if(running)
@@ -215,4 +227,4 @@
ui.auto_update_layout = 1
ui.set_initial_data(data)
ui.open()
ui.set_auto_update(1)
ui.set_auto_update(1)

View File

@@ -161,7 +161,7 @@ var/global/nttransfer_uid = 0
return
downloaded_file = remote.provided_file.clone()
remote.connected_clients.Add(src)
return
return 1
if(href_list["PRG_reset"])
error = ""
upload_menu = 0
@@ -171,7 +171,7 @@ var/global/nttransfer_uid = 0
for(var/datum/computer_file/program/nttransfer/T in connected_clients)
T.crash_download("Remote server has forcibly closed the connection")
provided_file = null
return
return 1
if(href_list["PRG_setpassword"])
var/pass = sanitize(input(usr, "Enter new server password. Leave blank to cancel, input 'none' to disable password.", "Server security", "none"))
if(!pass)
@@ -180,7 +180,7 @@ var/global/nttransfer_uid = 0
server_password = ""
return
server_password = pass
return
return 1
if(href_list["PRG_uploadfile"])
for(var/datum/computer_file/F in computer.hard_drive.stored_files)
if("[F.uid]" == href_list["PRG_uploadfile"])
@@ -191,7 +191,7 @@ var/global/nttransfer_uid = 0
ntnet_global.fileservers.Add(src)
return
error = "I/O Error: Unable to locate file on hard drive."
return
return 1
if(href_list["PRG_uploadmenu"])
upload_menu = 1
return 0
return 0