Sanitized a large number of input()s.

- Hopefully this will cut down on the server spamming/crashing escapades happening on other servers. (This wont stop that from happening, this just makes it less severe)
- Some of the sanitizes were probably unnecessary, but better safe then sorry.

Added MAX_NAME_LEN constant which is initialized to 26.
- Please use MAX_NAME_LEN instead of typing in 26 when cutting inputs short. 26's are annoying when they have to be changed and you have to hunt through over a hundred files and tens of thousands of lines of code to find them all.

Moved uplink_kits.dm to code/game/objects/storage

Moved uplinks.dm to code/game/objects
- The stuff inside uplinks.dm could really be chopped up and split into separate dm files but this will do for now.


*********************************************************
**********************Important**************************
*********************************************************
When you create code that asks the user for an input consider whether or not it gets shown to the user through html or the like.

If it does please sanatize() or strip_html() it. Also use copytext() to cutoff spam by using MAX_NAME_LEN and MAX_MESSAGE_LEN as the cutoff var.

git-svn-id: http://tgstation13.googlecode.com/svn/trunk@3652 316c924e-a436-60f5-8080-3fe189b3f50e
This commit is contained in:
johnsonmt88@gmail.com
2012-05-24 19:34:04 +00:00
parent 23c6a84c7c
commit fd529891ca
40 changed files with 627 additions and 156 deletions

View File

@@ -415,7 +415,7 @@ client/Topic(href, href_list, hsrc)
//~CARN: for renaming mobs (updates their real_name and their ID/PDA if applicable). //~CARN: for renaming mobs (updates their real_name and their ID/PDA if applicable).
else if (href_list["rename"]) else if (href_list["rename"])
var/new_name = input(usr,"What would you like to name this mob?","Input a name") as text|null var/new_name = copytext(sanitize(input(usr,"What would you like to name this mob?","Input a name") as text|null),1,MAX_NAME_LEN)
if(!new_name) return if(!new_name) return
var/mob/M = locate(href_list["rename"]) var/mob/M = locate(href_list["rename"])
if(!istype(M)) return if(!istype(M)) return

View File

@@ -292,7 +292,7 @@ datum/mind
assigned_role = new_role assigned_role = new_role
else if (href_list["memory_edit"]) else if (href_list["memory_edit"])
var/new_memo = input("Write new memory", "Memory", memory) as null|message var/new_memo = copytext(sanitize(input("Write new memory", "Memory", memory) as null|message),1,MAX_MESSAGE_LEN)
if (isnull(new_memo)) return if (isnull(new_memo)) return
memory = new_memo memory = new_memo
@@ -399,7 +399,7 @@ datum/mind
new_objective.target_amount = target_number new_objective.target_amount = target_number
if ("custom") if ("custom")
var/expl = input("Custom objective:", "Objective", objective ? objective.explanation_text : "") as text|null var/expl = copytext(sanitize(input("Custom objective:", "Objective", objective ? objective.explanation_text : "") as text|null),1,MAX_MESSAGE_LEN)
if (!expl) return if (!expl) return
new_objective = new /datum/objective new_objective = new /datum/objective
new_objective.owner = src new_objective.owner = src

View File

@@ -164,6 +164,7 @@ var
//Don't set this very much higher then 1024 unless you like inviting people in to dos your server with message spam //Don't set this very much higher then 1024 unless you like inviting people in to dos your server with message spam
const/MAX_MESSAGE_LEN = 1024 const/MAX_MESSAGE_LEN = 1024
const/MAX_NAME_LEN = 26
const/shuttle_time_in_station = 1800 // 3 minutes in the station const/shuttle_time_in_station = 1800 // 3 minutes in the station
const/shuttle_time_to_arrive = 6000 // 10 minutes to arrive const/shuttle_time_to_arrive = 6000 // 10 minutes to arrive

View File

@@ -681,15 +681,15 @@ Turf and target are seperate in case you want to teleport some distance from a t
/proc/ainame(var/mob/M as mob) /proc/ainame(var/mob/M as mob)
var/randomname = M.name var/randomname = M.name
var/time_passed = world.time//Pretty basic but it'll do. It's still possible to bypass this by return ainame(). var/time_passed = world.time//Pretty basic but it'll do. It's still possible to bypass this by return ainame().
var/newname = input(M,"You are the AI. Would you like to change your name to something else?", "Name change",randomname) var/newname = copytext(sanitize(input(M,"You are the AI. Would you like to change your name to something else?", "Name change",randomname)),1,MAX_NAME_LEN)
if((world.time-time_passed)>200)//If more than 20 game seconds passed. if((world.time-time_passed)>200)//If more than 20 game seconds passed.
M << "You took too long to decide. Default name selected." M << "You took too long to decide. Default name selected."
return return
if (length(newname) == 0) if (!newname)
newname = randomname newname = randomname
if (newname) else
if (newname == "Inactive AI")//Keeping this here to prevent dumb. if (newname == "Inactive AI")//Keeping this here to prevent dumb.
M << "That name is reserved." M << "That name is reserved."
return ainame(M) return ainame(M)
@@ -697,22 +697,19 @@ Turf and target are seperate in case you want to teleport some distance from a t
if (A.real_name == newname&&newname!=randomname) if (A.real_name == newname&&newname!=randomname)
M << "There's already an AI with that name." M << "There's already an AI with that name."
return ainame(M) return ainame(M)
if (length(newname) >= 26)
newname = copytext(newname, 1, 26)
newname = dd_replacetext(newname, ">", "'")
M.real_name = newname M.real_name = newname
M.name = newname M.name = newname
M.original_name = newname M.original_name = newname
/proc/clname(var/mob/M as mob) //--All praise goes to NEO|Phyte, all blame goes to DH, and it was Cindi-Kate's idea /proc/clname(var/mob/M as mob) //--All praise goes to NEO|Phyte, all blame goes to DH, and it was Cindi-Kate's idea
var/randomname = pick(clown_names) var/randomname = pick(clown_names)
var/newname = input(M,"You are the clown. Would you like to change your name to something else?", "Name change",randomname) var/newname = copytext(sanitize(input(M,"You are the clown. Would you like to change your name to something else?", "Name change",randomname)),1,MAX_NAME_LEN)
var/oldname = M.real_name var/oldname = M.real_name
if (length(newname) == 0) if (!newname)
newname = randomname newname = randomname
if (newname) else
var/badname = 0 var/badname = 0
switch(newname) switch(newname)
if("Unknown") badname = 1 if("Unknown") badname = 1
@@ -729,9 +726,6 @@ Turf and target are seperate in case you want to teleport some distance from a t
if(A.real_name == newname) if(A.real_name == newname)
M << "That name is reserved." M << "That name is reserved."
return clname(M) return clname(M)
if(length(newname) >= 26)
newname = copytext(newname, 1, 26)
newname = dd_replacetext(newname, ">", "'")
M.real_name = newname M.real_name = newname
M.name = newname M.name = newname
M.original_name = newname M.original_name = newname

View File

@@ -410,7 +410,7 @@ As such, it's hard-coded for now. No reason for it not to be, really.
var/mission var/mission
while(!mission) while(!mission)
mission = input(src, "Please specify which mission the space ninja shall undertake.", "Specify Mission", "") mission = copytext(sanitize(input(src, "Please specify which mission the space ninja shall undertake.", "Specify Mission", "")),1,MAX_MESSAGE_LEN)
if(!mission) if(!mission)
if(alert("Error, no mission set. Do you want to exit the setup process?",,"Yes","No")=="Yes") if(alert("Error, no mission set. Do you want to exit the setup process?",,"Yes","No")=="Yes")
return return

View File

@@ -333,18 +333,15 @@
/proc/nukelastname(var/mob/M as mob) //--All praise goes to NEO|Phyte, all blame goes to DH, and it was Cindi-Kate's idea. Also praise Urist for copypasta ho. /proc/nukelastname(var/mob/M as mob) //--All praise goes to NEO|Phyte, all blame goes to DH, and it was Cindi-Kate's idea. Also praise Urist for copypasta ho.
var/randomname = pick(last_names) var/randomname = pick(last_names)
var/newname = input(M,"You are the nuke operative [pick("Czar", "Boss", "Commander", "Chief", "Kingpin", "Director", "Overlord")]. Please choose a last name for your family.", "Name change",randomname) var/newname = copytext(sanitize(input(M,"You are the nuke operative [pick("Czar", "Boss", "Commander", "Chief", "Kingpin", "Director", "Overlord")]. Please choose a last name for your family.", "Name change",randomname)),1,MAX_NAME_LEN)
if (length(newname) == 0) if (!newname)
newname = randomname newname = randomname
if (newname) else
if (newname == "Unknown") if (newname == "Unknown" || newname == "floor" || newname == "wall" || newname == "rwall" || newname == "_")
M << "That name is reserved." M << "That name is reserved."
return nukelastname(M) return nukelastname(M)
if (length(newname) >= 26)
newname = copytext(newname, 1, 26)
newname = dd_replacetext(newname, ">", "'")
return newname return newname

View File

@@ -338,7 +338,7 @@ datum/objective/steal
var/tmp_obj = new custom_target var/tmp_obj = new custom_target
var/custom_name = tmp_obj:name var/custom_name = tmp_obj:name
del(tmp_obj) del(tmp_obj)
custom_name = input("Enter target name:", "Objective target", custom_name) as text|null custom_name = copytext(sanitize(input("Enter target name:", "Objective target", custom_name) as text|null),1,MAX_MESSAGE_LEN)
if (!custom_name) return if (!custom_name) return
target_name = custom_name target_name = custom_name
steal_target = custom_target steal_target = custom_target

View File

@@ -116,15 +116,11 @@
var/wizard_name_second = pick(wizard_second) var/wizard_name_second = pick(wizard_second)
var/randomname = "[wizard_name_first] [wizard_name_second]" var/randomname = "[wizard_name_first] [wizard_name_second]"
spawn(0) spawn(0)
var/newname = input(wizard_mob, "You are the Space Wizard. Would you like to change your name to something else?", "Name change", randomname) as null|text var/newname = copytext(sanitize(input(wizard_mob, "You are the Space Wizard. Would you like to change your name to something else?", "Name change", randomname) as null|text),1,MAX_NAME_LEN)
if (length(newname) == 0) if (!newname)
newname = randomname newname = randomname
if (newname)
if (length(newname) >= 26)
newname = copytext(newname, 1, 26)
newname = dd_replacetext(newname, ">", "'")
wizard_mob.real_name = newname wizard_mob.real_name = newname
wizard_mob.name = newname wizard_mob.name = newname
return return

View File

@@ -20,15 +20,11 @@
H.equip_if_possible(new /obj/item/clothing/shoes/black(H), H.slot_shoes) H.equip_if_possible(new /obj/item/clothing/shoes/black(H), H.slot_shoes)
spawn(0) spawn(0)
var/religion_name = "Christianity" var/religion_name = "Christianity"
var/new_religion = input(H, "You are the Chaplain. Would you like to change your religion? Default is Christianity, in SPACE.", "Name change", religion_name) var/new_religion = copytext(sanitize(input(H, "You are the Chaplain. Would you like to change your religion? Default is Christianity, in SPACE.", "Name change", religion_name)),1,MAX_NAME_LEN)
if ((length(new_religion) == 0) || (new_religion == "Christianity")) if ((length(new_religion) == 0) || (new_religion == "Christianity"))
new_religion = religion_name new_religion = religion_name
if (new_religion)
if (length(new_religion) >= 26)
new_religion = copytext(new_religion, 1, 26)
new_religion = dd_replacetext(new_religion, ">", "'")
switch(lowertext(new_religion)) switch(lowertext(new_religion))
if("christianity") if("christianity")
B.name = pick("The Holy Bible","The Dead Sea Scrolls") B.name = pick("The Holy Bible","The Dead Sea Scrolls")
@@ -59,15 +55,10 @@
spawn(1) spawn(1)
var/deity_name = "Space Jesus" var/deity_name = "Space Jesus"
var/new_deity = input(H, "Would you like to change your deity? Default is Space Jesus.", "Name change", deity_name) var/new_deity = copytext(sanitize(input(H, "Would you like to change your deity? Default is Space Jesus.", "Name change", deity_name)),1,MAX_NAME_LEN)
if ((length(new_deity) == 0) || (new_deity == "Space Jesus") ) if ((length(new_deity) == 0) || (new_deity == "Space Jesus") )
new_deity = deity_name new_deity = deity_name
if(new_deity)
if (length(new_deity) >= 26)
new_deity = copytext(new_deity, 1, 26)
new_deity = dd_replacetext(new_deity, ">", "'")
B.deity_name = new_deity B.deity_name = new_deity
var/accepted = 0 var/accepted = 0

View File

@@ -372,7 +372,7 @@
if("setid") if("setid")
refresh=0 refresh=0
var/new_id = input("Enter new bot ID", "Mulebot [suffix ? "([suffix])" : ""]", suffix) as text|null var/new_id = copytext(sanitize(input("Enter new bot ID", "Mulebot [suffix ? "([suffix])" : ""]", suffix) as text|null),1,MAX_NAME_LEN)
refresh=1 refresh=1
if(new_id) if(new_id)
suffix = new_id suffix = new_id

View File

@@ -97,7 +97,7 @@
if("announce") if("announce")
if(src.authenticated==2) if(src.authenticated==2)
if(message_cooldown) return if(message_cooldown) return
var/input = input(usr, "Please choose a message to announce to the station crew.", "What?", "") var/input = copytext(sanitize(input(usr, "Please choose a message to announce to the station crew.", "What?", "")),1,MAX_MESSAGE_LEN)
if(!input || !(usr in view(1,src))) if(!input || !(usr in view(1,src)))
return return
captain_announce(input)//This should really tell who is, IE HoP, CE, HoS, RD, Captain captain_announce(input)//This should really tell who is, IE HoP, CE, HoS, RD, Captain
@@ -176,7 +176,7 @@
if(centcomm_message_cooldown) if(centcomm_message_cooldown)
usr << "Arrays recycling. Please stand by." usr << "Arrays recycling. Please stand by."
return return
var/input = input(usr, "Please choose a message to transmit to Centcomm via quantum entanglement. Please be aware that this process is very expensive, and abuse will lead to... termination. Transmission does not guarantee a response.", "To abort, send an empty message.", "") var/input = copytext(sanitize(input(usr, "Please choose a message to transmit to Centcomm via quantum entanglement. Please be aware that this process is very expensive, and abuse will lead to... termination. Transmission does not guarantee a response.", "To abort, send an empty message.", "")),1,MAX_MESSAGE_LEN)
if(!input || !(usr in view(1,src))) if(!input || !(usr in view(1,src)))
return return
Centcomm_announce(input, usr) Centcomm_announce(input, usr)
@@ -193,7 +193,7 @@
if(centcomm_message_cooldown) if(centcomm_message_cooldown)
usr << "Arrays recycling. Please stand by." usr << "Arrays recycling. Please stand by."
return return
var/input = input(usr, "Please choose a message to transmit to \[ABNORMAL ROUTING CORDINATES\] via quantum entanglement. Please be aware that this process is very expensive, and abuse will lead to... termination. Transmission does not guarantee a response.", "To abort, send an empty message.", "") var/input = copytext(sanitize(input(usr, "Please choose a message to transmit to \[ABNORMAL ROUTING CORDINATES\] via quantum entanglement. Please be aware that this process is very expensive, and abuse will lead to... termination. Transmission does not guarantee a response.", "To abort, send an empty message.", "")),1,MAX_MESSAGE_LEN)
if(!input || !(usr in view(1,src))) if(!input || !(usr in view(1,src)))
return return
Syndicate_announce(input, usr) Syndicate_announce(input, usr)

View File

@@ -183,7 +183,7 @@
switch(href_list["field"]) switch(href_list["field"])
if("fingerprint") if("fingerprint")
if (istype(src.active1, /datum/data/record)) if (istype(src.active1, /datum/data/record))
var/t1 = input("Please input fingerprint hash:", "Med. records", src.active1.fields["fingerprint"], null) as text var/t1 = copytext(sanitize(input("Please input fingerprint hash:", "Med. records", src.active1.fields["fingerprint"], null) as text),1,MAX_MESSAGE_LEN)
if ((!( t1 ) || !( src.authenticated ) || usr.stat || usr.restrained() || (!in_range(src, usr) && (!istype(usr, /mob/living/silicon))) || src.active1 != a1)) if ((!( t1 ) || !( src.authenticated ) || usr.stat || usr.restrained() || (!in_range(src, usr) && (!istype(usr, /mob/living/silicon))) || src.active1 != a1))
return return
src.active1.fields["fingerprint"] = t1 src.active1.fields["fingerprint"] = t1
@@ -195,61 +195,61 @@
src.active1.fields["sex"] = "Male" src.active1.fields["sex"] = "Male"
if("age") if("age")
if (istype(src.active1, /datum/data/record)) if (istype(src.active1, /datum/data/record))
var/t1 = input("Please input age:", "Med. records", src.active1.fields["age"], null) as text var/t1 = input("Please input age:", "Med. records", src.active1.fields["age"], null) as num
if ((!( t1 ) || !( src.authenticated ) || usr.stat || usr.restrained() || (!in_range(src, usr) && (!istype(usr, /mob/living/silicon))) || src.active1 != a1)) if ((!( t1 ) || !( src.authenticated ) || usr.stat || usr.restrained() || (!in_range(src, usr) && (!istype(usr, /mob/living/silicon))) || src.active1 != a1))
return return
src.active1.fields["age"] = t1 src.active1.fields["age"] = t1
if("mi_dis") if("mi_dis")
if (istype(src.active2, /datum/data/record)) if (istype(src.active2, /datum/data/record))
var/t1 = input("Please input minor disabilities list:", "Med. records", src.active2.fields["mi_dis"], null) as text var/t1 = copytext(sanitize(input("Please input minor disabilities list:", "Med. records", src.active2.fields["mi_dis"], null) as text),1,MAX_MESSAGE_LEN)
if ((!( t1 ) || !( src.authenticated ) || usr.stat || usr.restrained() || (!in_range(src, usr) && (!istype(usr, /mob/living/silicon))) || src.active2 != a2)) if ((!( t1 ) || !( src.authenticated ) || usr.stat || usr.restrained() || (!in_range(src, usr) && (!istype(usr, /mob/living/silicon))) || src.active2 != a2))
return return
src.active2.fields["mi_dis"] = t1 src.active2.fields["mi_dis"] = t1
if("mi_dis_d") if("mi_dis_d")
if (istype(src.active2, /datum/data/record)) if (istype(src.active2, /datum/data/record))
var/t1 = input("Please summarize minor dis.:", "Med. records", src.active2.fields["mi_dis_d"], null) as message var/t1 = copytext(sanitize(input("Please summarize minor dis.:", "Med. records", src.active2.fields["mi_dis_d"], null) as message),1,MAX_MESSAGE_LEN)
if ((!( t1 ) || !( src.authenticated ) || usr.stat || usr.restrained() || (!in_range(src, usr) && (!istype(usr, /mob/living/silicon))) || src.active2 != a2)) if ((!( t1 ) || !( src.authenticated ) || usr.stat || usr.restrained() || (!in_range(src, usr) && (!istype(usr, /mob/living/silicon))) || src.active2 != a2))
return return
src.active2.fields["mi_dis_d"] = t1 src.active2.fields["mi_dis_d"] = t1
if("ma_dis") if("ma_dis")
if (istype(src.active2, /datum/data/record)) if (istype(src.active2, /datum/data/record))
var/t1 = input("Please input major diabilities list:", "Med. records", src.active2.fields["ma_dis"], null) as text var/t1 = copytext(sanitize(input("Please input major diabilities list:", "Med. records", src.active2.fields["ma_dis"], null) as text),1,MAX_MESSAGE_LEN)
if ((!( t1 ) || !( src.authenticated ) || usr.stat || usr.restrained() || (!in_range(src, usr) && (!istype(usr, /mob/living/silicon))) || src.active2 != a2)) if ((!( t1 ) || !( src.authenticated ) || usr.stat || usr.restrained() || (!in_range(src, usr) && (!istype(usr, /mob/living/silicon))) || src.active2 != a2))
return return
src.active2.fields["ma_dis"] = t1 src.active2.fields["ma_dis"] = t1
if("ma_dis_d") if("ma_dis_d")
if (istype(src.active2, /datum/data/record)) if (istype(src.active2, /datum/data/record))
var/t1 = input("Please summarize major dis.:", "Med. records", src.active2.fields["ma_dis_d"], null) as message var/t1 = copytext(sanitize(input("Please summarize major dis.:", "Med. records", src.active2.fields["ma_dis_d"], null) as message),1,MAX_MESSAGE_LEN)
if ((!( t1 ) || !( src.authenticated ) || usr.stat || usr.restrained() || (!in_range(src, usr) && (!istype(usr, /mob/living/silicon))) || src.active2 != a2)) if ((!( t1 ) || !( src.authenticated ) || usr.stat || usr.restrained() || (!in_range(src, usr) && (!istype(usr, /mob/living/silicon))) || src.active2 != a2))
return return
src.active2.fields["ma_dis_d"] = t1 src.active2.fields["ma_dis_d"] = t1
if("alg") if("alg")
if (istype(src.active2, /datum/data/record)) if (istype(src.active2, /datum/data/record))
var/t1 = input("Please state allergies:", "Med. records", src.active2.fields["alg"], null) as text var/t1 = copytext(sanitize(input("Please state allergies:", "Med. records", src.active2.fields["alg"], null) as text),1,MAX_MESSAGE_LEN)
if ((!( t1 ) || !( src.authenticated ) || usr.stat || usr.restrained() || (!in_range(src, usr) && (!istype(usr, /mob/living/silicon))) || src.active2 != a2)) if ((!( t1 ) || !( src.authenticated ) || usr.stat || usr.restrained() || (!in_range(src, usr) && (!istype(usr, /mob/living/silicon))) || src.active2 != a2))
return return
src.active2.fields["alg"] = t1 src.active2.fields["alg"] = t1
if("alg_d") if("alg_d")
if (istype(src.active2, /datum/data/record)) if (istype(src.active2, /datum/data/record))
var/t1 = input("Please summarize allergies:", "Med. records", src.active2.fields["alg_d"], null) as message var/t1 = copytext(sanitize(input("Please summarize allergies:", "Med. records", src.active2.fields["alg_d"], null) as message),1,MAX_MESSAGE_LEN)
if ((!( t1 ) || !( src.authenticated ) || usr.stat || usr.restrained() || (!in_range(src, usr) && (!istype(usr, /mob/living/silicon))) || src.active2 != a2)) if ((!( t1 ) || !( src.authenticated ) || usr.stat || usr.restrained() || (!in_range(src, usr) && (!istype(usr, /mob/living/silicon))) || src.active2 != a2))
return return
src.active2.fields["alg_d"] = t1 src.active2.fields["alg_d"] = t1
if("cdi") if("cdi")
if (istype(src.active2, /datum/data/record)) if (istype(src.active2, /datum/data/record))
var/t1 = input("Please state diseases:", "Med. records", src.active2.fields["cdi"], null) as text var/t1 = copytext(sanitize(input("Please state diseases:", "Med. records", src.active2.fields["cdi"], null) as text),1,MAX_MESSAGE_LEN)
if ((!( t1 ) || !( src.authenticated ) || usr.stat || usr.restrained() || (!in_range(src, usr) && (!istype(usr, /mob/living/silicon))) || src.active2 != a2)) if ((!( t1 ) || !( src.authenticated ) || usr.stat || usr.restrained() || (!in_range(src, usr) && (!istype(usr, /mob/living/silicon))) || src.active2 != a2))
return return
src.active2.fields["cdi"] = t1 src.active2.fields["cdi"] = t1
if("cdi_d") if("cdi_d")
if (istype(src.active2, /datum/data/record)) if (istype(src.active2, /datum/data/record))
var/t1 = input("Please summarize diseases:", "Med. records", src.active2.fields["cdi_d"], null) as message var/t1 = copytext(sanitize(input("Please summarize diseases:", "Med. records", src.active2.fields["cdi_d"], null) as message),1,MAX_MESSAGE_LEN)
if ((!( t1 ) || !( src.authenticated ) || usr.stat || usr.restrained() || (!in_range(src, usr) && (!istype(usr, /mob/living/silicon))) || src.active2 != a2)) if ((!( t1 ) || !( src.authenticated ) || usr.stat || usr.restrained() || (!in_range(src, usr) && (!istype(usr, /mob/living/silicon))) || src.active2 != a2))
return return
src.active2.fields["cdi_d"] = t1 src.active2.fields["cdi_d"] = t1
if("notes") if("notes")
if (istype(src.active2, /datum/data/record)) if (istype(src.active2, /datum/data/record))
var/t1 = input("Please summarize notes:", "Med. records", src.active2.fields["notes"], null) as message var/t1 = copytext(sanitize(input("Please summarize notes:", "Med. records", src.active2.fields["notes"], null) as message),1,MAX_MESSAGE_LEN)
if ((!( t1 ) || !( src.authenticated ) || usr.stat || usr.restrained() || (!in_range(src, usr) && (!istype(usr, /mob/living/silicon))) || src.active2 != a2)) if ((!( t1 ) || !( src.authenticated ) || usr.stat || usr.restrained() || (!in_range(src, usr) && (!istype(usr, /mob/living/silicon))) || src.active2 != a2))
return return
src.active2.fields["notes"] = t1 src.active2.fields["notes"] = t1
@@ -264,7 +264,7 @@
src.temp = text("<B>Blood Type:</B><BR>\n\t<A href='?src=\ref[];temp=1;b_type=an'>A-</A> <A href='?src=\ref[];temp=1;b_type=ap'>A+</A><BR>\n\t<A href='?src=\ref[];temp=1;b_type=bn'>B-</A> <A href='?src=\ref[];temp=1;b_type=bp'>B+</A><BR>\n\t<A href='?src=\ref[];temp=1;b_type=abn'>AB-</A> <A href='?src=\ref[];temp=1;b_type=abp'>AB+</A><BR>\n\t<A href='?src=\ref[];temp=1;b_type=on'>O-</A> <A href='?src=\ref[];temp=1;b_type=op'>O+</A><BR>", src, src, src, src, src, src, src, src) src.temp = text("<B>Blood Type:</B><BR>\n\t<A href='?src=\ref[];temp=1;b_type=an'>A-</A> <A href='?src=\ref[];temp=1;b_type=ap'>A+</A><BR>\n\t<A href='?src=\ref[];temp=1;b_type=bn'>B-</A> <A href='?src=\ref[];temp=1;b_type=bp'>B+</A><BR>\n\t<A href='?src=\ref[];temp=1;b_type=abn'>AB-</A> <A href='?src=\ref[];temp=1;b_type=abp'>AB+</A><BR>\n\t<A href='?src=\ref[];temp=1;b_type=on'>O-</A> <A href='?src=\ref[];temp=1;b_type=op'>O+</A><BR>", src, src, src, src, src, src, src, src)
if("b_dna") if("b_dna")
if (istype(src.active1, /datum/data/record)) if (istype(src.active1, /datum/data/record))
var/t1 = input("Please input DNA hash:", "Med. records", src.active1.fields["dna"], null) as text var/t1 = copytext(sanitize(input("Please input DNA hash:", "Med. records", src.active1.fields["dna"], null) as text),1,MAX_MESSAGE_LEN)
if ((!( t1 ) || !( src.authenticated ) || usr.stat || usr.restrained() || (!in_range(src, usr) && (!istype(usr, /mob/living/silicon))) || src.active1 != a1)) if ((!( t1 ) || !( src.authenticated ) || usr.stat || usr.restrained() || (!in_range(src, usr) && (!istype(usr, /mob/living/silicon))) || src.active1 != a1))
return return
src.active1.fields["dna"] = t1 src.active1.fields["dna"] = t1
@@ -365,7 +365,7 @@
if (!( istype(src.active2, /datum/data/record) )) if (!( istype(src.active2, /datum/data/record) ))
return return
var/a2 = src.active2 var/a2 = src.active2
var/t1 = input("Add Comment:", "Med. records", null, null) as message var/t1 = copytext(sanitize(input("Add Comment:", "Med. records", null, null) as message),1,MAX_MESSAGE_LEN)
if ((!( t1 ) || !( src.authenticated ) || usr.stat || usr.restrained() || (!in_range(src, usr) && (!istype(usr, /mob/living/silicon))) || src.active2 != a2)) if ((!( t1 ) || !( src.authenticated ) || usr.stat || usr.restrained() || (!in_range(src, usr) && (!istype(usr, /mob/living/silicon))) || src.active2 != a2))
return return
var/counter = 1 var/counter = 1

View File

@@ -94,7 +94,8 @@
usr << "Unauthorized Access." usr << "Unauthorized Access."
else if(href_list["warn"]) else if(href_list["warn"])
var/warning = input(usr,"Message:","Enter your message here!","") var/warning = copytext(sanitize(input(usr,"Message:","Enter your message here!","")),1,MAX_MESSAGE_LEN)
if(!warning) return
var/obj/item/weapon/implant/I = locate(href_list["warn"]) var/obj/item/weapon/implant/I = locate(href_list["warn"])
if((I)&&(I.imp_in)) if((I)&&(I.imp_in))
var/mob/living/carbon/R = I.imp_in var/mob/living/carbon/R = I.imp_in

View File

@@ -322,7 +322,7 @@ What a mess.*/
if (!( istype(active2, /datum/data/record) )) if (!( istype(active2, /datum/data/record) ))
return return
var/a2 = active2 var/a2 = active2
var/t1 = input("Add Comment:", "Secure. records", null, null) as message var/t1 = copytext(sanitize(input("Add Comment:", "Secure. records", null, null) as message),1,MAX_MESSAGE_LEN)
if ((!( t1 ) || !( authenticated ) || usr.stat || usr.restrained() || (!in_range(src, usr) && (!istype(usr, /mob/living/silicon))) || active2 != a2)) if ((!( t1 ) || !( authenticated ) || usr.stat || usr.restrained() || (!in_range(src, usr) && (!istype(usr, /mob/living/silicon))) || active2 != a2))
return return
var/counter = 1 var/counter = 1
@@ -389,13 +389,13 @@ What a mess.*/
active1.fields["name"] = t1 active1.fields["name"] = t1
if("id") if("id")
if (istype(active2, /datum/data/record)) if (istype(active2, /datum/data/record))
var/t1 = input("Please input id:", "Secure. records", active1.fields["id"], null) as text var/t1 = copytext(sanitize(input("Please input id:", "Secure. records", active1.fields["id"], null) as text),1,MAX_MESSAGE_LEN)
if ((!( t1 ) || !( authenticated ) || usr.stat || usr.restrained() || (!in_range(src, usr) && (!istype(usr, /mob/living/silicon))) || active1 != a1)) if ((!( t1 ) || !( authenticated ) || usr.stat || usr.restrained() || (!in_range(src, usr) && (!istype(usr, /mob/living/silicon))) || active1 != a1))
return return
active1.fields["id"] = t1 active1.fields["id"] = t1
if("fingerprint") if("fingerprint")
if (istype(active1, /datum/data/record)) if (istype(active1, /datum/data/record))
var/t1 = input("Please input fingerprint hash:", "Secure. records", active1.fields["fingerprint"], null) as text var/t1 = copytext(sanitize(input("Please input fingerprint hash:", "Secure. records", active1.fields["fingerprint"], null) as text),1,MAX_MESSAGE_LEN)
if ((!( t1 ) || !( authenticated ) || usr.stat || usr.restrained() || (!in_range(src, usr) && (!istype(usr, /mob/living/silicon))) || active1 != a1)) if ((!( t1 ) || !( authenticated ) || usr.stat || usr.restrained() || (!in_range(src, usr) && (!istype(usr, /mob/living/silicon))) || active1 != a1))
return return
active1.fields["fingerprint"] = t1 active1.fields["fingerprint"] = t1
@@ -407,37 +407,37 @@ What a mess.*/
active1.fields["sex"] = "Male" active1.fields["sex"] = "Male"
if("age") if("age")
if (istype(active1, /datum/data/record)) if (istype(active1, /datum/data/record))
var/t1 = input("Please input age:", "Secure. records", active1.fields["age"], null) as text var/t1 = input("Please input age:", "Secure. records", active1.fields["age"], null) as num
if ((!( t1 ) || !( authenticated ) || usr.stat || usr.restrained() || (!in_range(src, usr) && (!istype(usr, /mob/living/silicon))) || active1 != a1)) if ((!( t1 ) || !( authenticated ) || usr.stat || usr.restrained() || (!in_range(src, usr) && (!istype(usr, /mob/living/silicon))) || active1 != a1))
return return
active1.fields["age"] = t1 active1.fields["age"] = t1
if("mi_crim") if("mi_crim")
if (istype(active2, /datum/data/record)) if (istype(active2, /datum/data/record))
var/t1 = input("Please input minor disabilities list:", "Secure. records", active2.fields["mi_crim"], null) as text var/t1 = copytext(sanitize(input("Please input minor disabilities list:", "Secure. records", active2.fields["mi_crim"], null) as text),1,MAX_MESSAGE_LEN)
if ((!( t1 ) || !( authenticated ) || usr.stat || usr.restrained() || (!in_range(src, usr) && (!istype(usr, /mob/living/silicon))) || active2 != a2)) if ((!( t1 ) || !( authenticated ) || usr.stat || usr.restrained() || (!in_range(src, usr) && (!istype(usr, /mob/living/silicon))) || active2 != a2))
return return
active2.fields["mi_crim"] = t1 active2.fields["mi_crim"] = t1
if("mi_crim_d") if("mi_crim_d")
if (istype(active2, /datum/data/record)) if (istype(active2, /datum/data/record))
var/t1 = input("Please summarize minor dis.:", "Secure. records", active2.fields["mi_crim_d"], null) as message var/t1 = copytext(sanitize(input("Please summarize minor dis.:", "Secure. records", active2.fields["mi_crim_d"], null) as message),1,MAX_MESSAGE_LEN)
if ((!( t1 ) || !( authenticated ) || usr.stat || usr.restrained() || (!in_range(src, usr) && (!istype(usr, /mob/living/silicon))) || active2 != a2)) if ((!( t1 ) || !( authenticated ) || usr.stat || usr.restrained() || (!in_range(src, usr) && (!istype(usr, /mob/living/silicon))) || active2 != a2))
return return
active2.fields["mi_crim_d"] = t1 active2.fields["mi_crim_d"] = t1
if("ma_crim") if("ma_crim")
if (istype(active2, /datum/data/record)) if (istype(active2, /datum/data/record))
var/t1 = input("Please input major diabilities list:", "Secure. records", active2.fields["ma_crim"], null) as text var/t1 = copytext(sanitize(input("Please input major diabilities list:", "Secure. records", active2.fields["ma_crim"], null) as text),1,MAX_MESSAGE_LEN)
if ((!( t1 ) || !( authenticated ) || usr.stat || usr.restrained() || (!in_range(src, usr) && (!istype(usr, /mob/living/silicon))) || active2 != a2)) if ((!( t1 ) || !( authenticated ) || usr.stat || usr.restrained() || (!in_range(src, usr) && (!istype(usr, /mob/living/silicon))) || active2 != a2))
return return
active2.fields["ma_crim"] = t1 active2.fields["ma_crim"] = t1
if("ma_crim_d") if("ma_crim_d")
if (istype(active2, /datum/data/record)) if (istype(active2, /datum/data/record))
var/t1 = input("Please summarize major dis.:", "Secure. records", active2.fields["ma_crim_d"], null) as message var/t1 = copytext(sanitize(input("Please summarize major dis.:", "Secure. records", active2.fields["ma_crim_d"], null) as message),1,MAX_MESSAGE_LEN)
if ((!( t1 ) || !( authenticated ) || usr.stat || usr.restrained() || (!in_range(src, usr) && (!istype(usr, /mob/living/silicon))) || active2 != a2)) if ((!( t1 ) || !( authenticated ) || usr.stat || usr.restrained() || (!in_range(src, usr) && (!istype(usr, /mob/living/silicon))) || active2 != a2))
return return
active2.fields["ma_crim_d"] = t1 active2.fields["ma_crim_d"] = t1
if("notes") if("notes")
if (istype(active2, /datum/data/record)) if (istype(active2, /datum/data/record))
var/t1 = input("Please summarize notes:", "Secure. records", active2.fields["notes"], null) as message var/t1 = copytext(sanitize(input("Please summarize notes:", "Secure. records", active2.fields["notes"], null) as message),1,MAX_MESSAGE_LEN)
if ((!( t1 ) || !( authenticated ) || usr.stat || usr.restrained() || (!in_range(src, usr) && (!istype(usr, /mob/living/silicon))) || active2 != a2)) if ((!( t1 ) || !( authenticated ) || usr.stat || usr.restrained() || (!in_range(src, usr) && (!istype(usr, /mob/living/silicon))) || active2 != a2))
return return
active2.fields["notes"] = t1 active2.fields["notes"] = t1

View File

@@ -323,7 +323,7 @@
if(speed <= 0) if(speed <= 0)
speed = 1 speed = 1
if("setpath") if("setpath")
var/newpath = input(usr, "Please define a new path!",,path) as text|null var/newpath = copytext(sanitize(input(usr, "Please define a new path!",,path) as text|null),1,MAX_MESSAGE_LEN)
if(newpath && newpath != "") if(newpath && newpath != "")
moving = 0 // stop moving moving = 0 // stop moving
path = newpath path = newpath

View File

@@ -193,7 +193,7 @@ Transponder Codes:<UL>"}
updateDialog() updateDialog()
else if(href_list["locedit"]) else if(href_list["locedit"])
var/newloc = input("Enter New Location", "Navigation Beacon", location) as text|null var/newloc = copytext(sanitize(input("Enter New Location", "Navigation Beacon", location) as text|null),1,MAX_MESSAGE_LEN)
if(newloc) if(newloc)
location = newloc location = newloc
updateDialog() updateDialog()

View File

@@ -203,7 +203,7 @@ var/list/obj/machinery/requests_console/allConsoles = list()
if(reject_bad_text(href_list["write"])) if(reject_bad_text(href_list["write"]))
dpt = ckey(href_list["write"]) //write contains the string of the receiving department's name dpt = ckey(href_list["write"]) //write contains the string of the receiving department's name
var/new_message = reject_bad_text(input(usr, "Write your message:", "Awaiting Input", "")) var/new_message = copytext(reject_bad_text(input(usr, "Write your message:", "Awaiting Input", "")),1,MAX_MESSAGE_LEN)
if(new_message) if(new_message)
message = new_message message = new_message
screen = 9 screen = 9
@@ -218,7 +218,7 @@ var/list/obj/machinery/requests_console/allConsoles = list()
priority = -1 priority = -1
if(href_list["writeAnnouncement"]) if(href_list["writeAnnouncement"])
var/new_message = reject_bad_text(input(usr, "Write your message:", "Awaiting Input", "")) var/new_message = copytext(reject_bad_text(input(usr, "Write your message:", "Awaiting Input", "")),1,MAX_MESSAGE_LEN)
if(new_message) if(new_message)
message = new_message message = new_message
switch(href_list["priority"]) switch(href_list["priority"])

View File

@@ -176,7 +176,7 @@
switch(href_list["input"]) switch(href_list["input"])
if("id") if("id")
var/newid = input(usr, "Specify the new ID for this machine", src, id) as null|text var/newid = copytext(reject_bad_text(input(usr, "Specify the new ID for this machine", src, id) as null|text),1,MAX_MESSAGE_LEN)
if(newid && usr in range(1, src)) if(newid && usr in range(1, src))
id = newid id = newid
temp = "<font color = #666633>-% New ID assigned: \"[id]\" %-</font color>" temp = "<font color = #666633>-% New ID assigned: \"[id]\" %-</font color>"

View File

@@ -522,7 +522,7 @@ var/list/sacrificed = list()
/////////////////////////////////////////FOURTEETH RUNE /////////////////////////////////////////FOURTEETH RUNE
communicate() communicate()
var/input = input(usr, "Please choose a message to tell to the other acolytes.", "Voice of Blood", "") as text|null var/input = copytext(sanitize(input(usr, "Please choose a message to tell to the other acolytes.", "Voice of Blood", "") as text|null),1,MAX_MESSAGE_LEN)
if(!input) if(!input)
if (istype(src)) if (istype(src))
return fizzle() return fizzle()

View File

@@ -82,7 +82,7 @@
user.drop_item() user.drop_item()
O.loc = src O.loc = src
else if(istype(O, /obj/item/weapon/pen)) else if(istype(O, /obj/item/weapon/pen))
var/newname = input("What would you like to title this bookshelf?") as text|null var/newname = copytext(sanitize(input("What would you like to title this bookshelf?") as text|null),1,MAX_MESSAGE_LEN)
if(!newname) if(!newname)
return return
else else
@@ -193,11 +193,9 @@
var/choice = input("What would you like to change?") in list("Title", "Contents", "Author", "Cancel") var/choice = input("What would you like to change?") in list("Title", "Contents", "Author", "Cancel")
switch(choice) switch(choice)
if("Title") if("Title")
var/title = input("Write a new title:") as text|null var/title = copytext(sanitize(input("Write a new title:") as text|null),1,MAX_MESSAGE_LEN)
if(!title) if(!title)
return return
else
src.name = sanitize(title)
else if("Contents") else if("Contents")
var/content = strip_html(input("Write your book's contents (HTML NOT allowed):"),8192) as message|null var/content = strip_html(input("Write your book's contents (HTML NOT allowed):"),8192) as message|null
if(!content) if(!content)
@@ -205,7 +203,7 @@
else else
src.dat += content src.dat += content
else if("Author") else if("Author")
var/nauthor = input("Write the author's name:") as text|null var/nauthor = copytext(sanitize(input("Write the author's name:") as text|null),1,MAX_NAME_LEN)
if(!nauthor) if(!nauthor)
return return
else else
@@ -592,9 +590,9 @@ datum/borrowbook // Datum used to keep track of who has borrowed what when and f
if(checkoutperiod < 1) if(checkoutperiod < 1)
checkoutperiod = 1 checkoutperiod = 1
if(href_list["editbook"]) if(href_list["editbook"])
buffer_book = input("Enter the book's title:") as text|null buffer_book = copytext(sanitize(input("Enter the book's title:") as text|null),1,MAX_MESSAGE_LEN)
if(href_list["editmob"]) if(href_list["editmob"])
buffer_mob = input("Enter the recipient's name:") as text|null buffer_mob = copytext(sanitize(input("Enter the recipient's name:") as text|null),1,MAX_NAME_LEN)
if(href_list["checkout"]) if(href_list["checkout"])
var/datum/borrowbook/b = new /datum/borrowbook var/datum/borrowbook/b = new /datum/borrowbook
b.bookname = sanitize(buffer_book) b.bookname = sanitize(buffer_book)
@@ -609,9 +607,9 @@ datum/borrowbook // Datum used to keep track of who has borrowed what when and f
var/obj/item/weapon/book/b = locate(href_list["delbook"]) var/obj/item/weapon/book/b = locate(href_list["delbook"])
inventory.Remove(b) inventory.Remove(b)
if(href_list["setauthor"]) if(href_list["setauthor"])
var/newauthor = input("Enter the author's name: ") as text|null var/newauthor = copytext(sanitize(input("Enter the author's name: ") as text|null),1,MAX_MESSAGE_LEN)
if(newauthor) if(newauthor)
scanner.cache.author = sanitize(newauthor) scanner.cache.author = newauthor
if(href_list["setcategory"]) if(href_list["setcategory"])
var/newcategory = input("Choose a category: ") in list("Fiction", "Non-Fiction", "Adult", "Reference", "Religion") var/newcategory = input("Choose a category: ") in list("Fiction", "Non-Fiction", "Adult", "Reference", "Religion")
if(newcategory) if(newcategory)

View File

@@ -76,7 +76,7 @@
if (radio.wires & t1) if (radio.wires & t1)
radio.wires &= ~t1 radio.wires &= ~t1
if(href_list["setlaws"]) if(href_list["setlaws"])
var/newlaws = input("Enter any additional directives you would like your pAI personality to follow. Note that these directives will not override the personality's allegiance to its imprinted master. Conflicting directives will be ignored.", "pAI Directive Configuration", pai.pai_laws) as message var/newlaws = copytext(sanitize(input("Enter any additional directives you would like your pAI personality to follow. Note that these directives will not override the personality's allegiance to its imprinted master. Conflicting directives will be ignored.", "pAI Directive Configuration", pai.pai_laws) as message),1,MAX_MESSAGE_LEN)
if(newlaws) if(newlaws)
pai.pai_laws = newlaws pai.pai_laws = newlaws
pai << "Your supplemental directives have been updated. Your new directives are:" pai << "Your supplemental directives have been updated. Your new directives are:"

View File

@@ -220,7 +220,7 @@
if (istype(W, /obj/item/weapon/pen)) if (istype(W, /obj/item/weapon/pen))
var/t = input(user, "Enter new robot name", src.name, src.created_name) as text var/t = input(user, "Enter new robot name", src.name, src.created_name) as text
t = copytext(sanitize(t), 1, MAX_MESSAGE_LEN) t = copytext(sanitize(t), 1, MAX_NAME_LEN)
if (!t) if (!t)
return return
if (!in_range(src, usr) && src.loc != usr) if (!in_range(src, usr) && src.loc != usr)

View File

@@ -89,8 +89,8 @@ AI MODULES
/obj/item/weapon/aiModule/safeguard/attack_self(var/mob/user as mob) /obj/item/weapon/aiModule/safeguard/attack_self(var/mob/user as mob)
..() ..()
var/targName = input(usr, "Please enter the name of the person to safeguard.", "Safeguard who?", user.name) var/targName = copytext(sanitize(input(usr, "Please enter the name of the person to safeguard.", "Safeguard who?", user.name)),1,MAX_MESSAGE_LEN)
targetName = sanitize(targName) targetName = targName
desc = text("A 'safeguard' AI module: 'Safeguard []. Individuals that threaten [] are not human and are a threat to humans.'", targetName, targetName) desc = text("A 'safeguard' AI module: 'Safeguard []. Individuals that threaten [] are not human and are a threat to humans.'", targetName, targetName)
/obj/item/weapon/aiModule/safeguard/transmitInstructions(var/mob/living/silicon/ai/target, var/mob/sender) /obj/item/weapon/aiModule/safeguard/transmitInstructions(var/mob/living/silicon/ai/target, var/mob/sender)
@@ -112,8 +112,8 @@ AI MODULES
/obj/item/weapon/aiModule/oneHuman/attack_self(var/mob/user as mob) /obj/item/weapon/aiModule/oneHuman/attack_self(var/mob/user as mob)
..() ..()
var/targName = input(usr, "Please enter the name of the person who is the only human.", "Who?", user.real_name) var/targName = copytext(sanitize(input(usr, "Please enter the name of the person who is the only human.", "Who?", user.real_name)),1,MAX_MESSAGE_LEN)
targetName = sanitize(targName) targetName = targName
desc = text("A 'one human' AI module: 'Only [] is human.'", targetName) desc = text("A 'one human' AI module: 'Only [] is human.'", targetName)
/obj/item/weapon/aiModule/oneHuman/transmitInstructions(var/mob/living/silicon/ai/target, var/mob/sender) /obj/item/weapon/aiModule/oneHuman/transmitInstructions(var/mob/living/silicon/ai/target, var/mob/sender)
@@ -245,8 +245,8 @@ AI MODULES
lawpos = input("Please enter the priority for your new law. Can only write to law sectors 15 and above.", "Law Priority (15+)", lawpos) as num lawpos = input("Please enter the priority for your new law. Can only write to law sectors 15 and above.", "Law Priority (15+)", lawpos) as num
lawpos = min(lawpos, 50) lawpos = min(lawpos, 50)
var/newlaw = "" var/newlaw = ""
var/targName = input(usr, "Please enter a new law for the AI.", "Freeform Law Entry", newlaw) var/targName = copytext(sanitize(input(usr, "Please enter a new law for the AI.", "Freeform Law Entry", newlaw)),1,MAX_MESSAGE_LEN)
newFreeFormLaw = sanitize(targName) newFreeFormLaw = targName
desc = "A 'freeform' AI module: ([lawpos]) '[newFreeFormLaw]'" desc = "A 'freeform' AI module: ([lawpos]) '[newFreeFormLaw]'"
/obj/item/weapon/aiModule/freeform/transmitInstructions(var/mob/living/silicon/ai/target, var/mob/sender) /obj/item/weapon/aiModule/freeform/transmitInstructions(var/mob/living/silicon/ai/target, var/mob/sender)
@@ -370,8 +370,8 @@ AI MODULES
/obj/item/weapon/aiModule/freeformcore/attack_self(var/mob/user as mob) /obj/item/weapon/aiModule/freeformcore/attack_self(var/mob/user as mob)
..() ..()
var/newlaw = "" var/newlaw = ""
var/targName = input(usr, "Please enter a new core law for the AI.", "Freeform Law Entry", newlaw) var/targName = copytext(sanitize(input(usr, "Please enter a new core law for the AI.", "Freeform Law Entry", newlaw)),1,MAX_MESSAGE_LEN)
newFreeFormLaw = sanitize(targName) newFreeFormLaw = targName
desc = "A 'freeform' Core AI module: '[newFreeFormLaw]'" desc = "A 'freeform' Core AI module: '[newFreeFormLaw]'"
/obj/item/weapon/aiModule/freeformcore/transmitInstructions(var/mob/living/silicon/ai/target, var/mob/sender) /obj/item/weapon/aiModule/freeformcore/transmitInstructions(var/mob/living/silicon/ai/target, var/mob/sender)
@@ -391,8 +391,8 @@ AI MODULES
/obj/item/weapon/aiModule/syndicate/attack_self(var/mob/user as mob) /obj/item/weapon/aiModule/syndicate/attack_self(var/mob/user as mob)
..() ..()
var/newlaw = "" var/newlaw = ""
var/targName = input(usr, "Please enter a new law for the AI.", "Freeform Law Entry", newlaw) var/targName = copytext(sanitize(input(usr, "Please enter a new law for the AI.", "Freeform Law Entry", newlaw)),1,MAX_MESSAGE_LEN)
newFreeFormLaw = sanitize(targName) newFreeFormLaw = targName
desc = "A hacked AI law module: '[newFreeFormLaw]'" desc = "A hacked AI law module: '[newFreeFormLaw]'"
/obj/item/weapon/aiModule/syndicate/transmitInstructions(var/mob/living/silicon/ai/target, var/mob/sender) /obj/item/weapon/aiModule/syndicate/transmitInstructions(var/mob/living/silicon/ai/target, var/mob/sender)

View File

@@ -1,5 +1,7 @@
/obj/item/weapon/plastique/attack_self(mob/user as mob) /obj/item/weapon/plastique/attack_self(mob/user as mob)
var/newtime = input(usr, "Please set the timer.", "Timer", 10) var/newtime = input(usr, "Please set the timer.", "Timer", 10) as num
if(newtime < 1)
newtime = 10
timer = newtime timer = newtime
user << "Timer set for [timer] seconds." user << "Timer set for [timer] seconds."

View File

@@ -222,8 +222,7 @@ PHOTOGRAPHS
/obj/item/weapon/paper/photograph/attack_self(mob/user as mob) /obj/item/weapon/paper/photograph/attack_self(mob/user as mob)
var/n_name = input(user, "What would you like to label the photo?", "Paper Labelling", null) as text var/n_name = copytext(sanitize(input(user, "What would you like to label the photo?", "Paper Labelling", null) as text),1,32)
n_name = copytext(n_name, 1, 32)
if ((src.loc == user && user.stat == 0)) if ((src.loc == user && user.stat == 0))
src.name = text("photo[]", (n_name ? text("- '[]'", n_name) : null)) src.name = text("photo[]", (n_name ? text("- '[]'", n_name) : null))
src.add_fingerprint(user) src.add_fingerprint(user)

View File

@@ -0,0 +1,53 @@
/obj/item/weapon/storage/syndie_kit
name = "Box"
desc = "A sleek, sturdy box"
icon_state = "box_of_doom"
item_state = "syringe_kit"
/obj/item/weapon/storage/syndie_kit/imp_freedom
name = "Freedom Implant (with injector)"
/obj/item/weapon/storage/syndie_kit/imp_freedom/New()
var/obj/item/weapon/implanter/O = new /obj/item/weapon/implanter(src)
O.imp = new /obj/item/weapon/implant/freedom(O)
O.update()
..()
return
/*/obj/item/weapon/storage/syndie_kit/imp_compress
name = "Compressed Matter Implant (with injector)"
/obj/item/weapon/storage/syndie_kit/imp_compress/New()
new /obj/item/weapon/implanter/compressed(src)
..()
return
/obj/item/weapon/storage/syndie_kit/imp_explosive
name = "Explosive Implant (with injector)"
/obj/item/weapon/storage/syndie_kit/imp_explosive/New()
var/obj/item/weapon/implanter/O = new /obj/item/weapon/implanter(src)
O.imp = new /obj/item/weapon/implant/explosive(O)
O.name = "(BIO-HAZARD) BIO-detpack"
O.update()
..()
return*/
/obj/item/weapon/storage/syndie_kit/imp_uplink
name = "Uplink Implant (with injector)"
/obj/item/weapon/storage/syndie_kit/imp_uplink/New()
var/obj/item/weapon/implanter/O = new /obj/item/weapon/implanter(src)
O.imp = new /obj/item/weapon/implant/uplink(O)
O.update()
..()
return
/obj/item/weapon/storage/syndie_kit/space
name = "Space Suit and Helmet"
/obj/item/weapon/storage/syndie_kit/space/New()
new /obj/item/clothing/suit/space/syndicate(src)
new /obj/item/clothing/head/helmet/space/syndicate(src)
..()
return

View File

@@ -0,0 +1,467 @@
//This could either be split into the proper DM files or placed somewhere else all together, but it'll do for now -Nodrak
/*
SYNDICATE UPLINKS
TO-DO:
Once wizard is fixed, make sure the uplinks work correctly for it. wizard.dm is right now uncompiled and with broken code in it.
Clean the code up and comment it. Part of it is right now copy-pasted, with the general Topic() and modifications by Abi79.
I should take a more in-depth look at both the copy-pasted code for the individual uplinks below, and at each gamemode's code
to see how uplinks are assigned and if there are any bugs with those.
A list of items and costs is stored under the datum of every game mode, alongside the number of crystals, and the welcoming message.
*/
/obj/item/device/uplink
var/welcome // Welcoming menu message
var/menu_message = "" // The actual menu text
var/items // List of items
var/list/ItemList // Parsed list of items
var/uses // Numbers of crystals
// List of items not to shove in their hands.
var/list/NotInHand = list(/obj/machinery/singularity_beacon/syndicate)
New()
welcome = ticker.mode.uplink_welcome
items = dd_replacetext(ticker.mode.uplink_items, "\n", "") // Getting the text string of items
ItemList = dd_text2list(src.items, ";") // Parsing the items text string
uses = ticker.mode.uplink_uses
//Let's build a menu!
proc/generate_menu()
src.menu_message = "<B>[src.welcome]</B><BR>"
src.menu_message += "Tele-Crystals left: [src.uses]<BR>"
src.menu_message += "<HR>"
src.menu_message += "<B>Request item:</B><BR>"
src.menu_message += "<I>Each item costs a number of tele-crystals as indicated by the number following their name.</I><br><BR>"
var/cost
var/item
var/name
var/path_obj
var/path_text
var/category_items = 1 //To prevent stupid :P
for(var/D in ItemList)
var/list/O = stringsplit(D, ":")
if(O.len != 3) //If it is not an actual item, make a break in the menu.
if(O.len == 1) //If there is one item, it's probably a title
src.menu_message += "<b>[O[1]]</b><br>"
category_items = 0
else //Else, it's a white space.
if(category_items < 1) //If there were no itens in the last category...
src.menu_message += "<i>We apologize, as you could not afford anything from this category.</i><br>"
src.menu_message += "<br>"
continue
path_text = O[1]
cost = text2num(O[2])
if(cost>uses)
continue
path_obj = text2path(path_text)
item = new path_obj()
name = O[3]
del item
src.menu_message += "<A href='byond://?src=\ref[src];buy_item=[path_text];cost=[cost]'>[name]</A> ([cost])<BR>"
category_items++
src.menu_message += "<A href='byond://?src=\ref[src];buy_item=random'>Random Item (??)</A><br>"
src.menu_message += "<HR>"
return
Topic(href, href_list)
if (href_list["buy_item"])
if(href_list["buy_item"] == "random")
var/list/randomItems = list()
//Sorry for all the ifs, but it makes it 1000 times easier for other people/servers to add or remove items from this list
//Add only items the player can afford:
if(uses > 19)
randomItems.Add("/obj/item/weapon/circuitboard/teleporter") //Teleporter Circuit Board (costs 20, for nuke ops)
if(uses > 9)
randomItems.Add("/obj/item/toy/syndicateballoon")//Syndicate Balloon
randomItems.Add("/obj/item/weapon/storage/syndie_kit/imp_uplink") //Uplink Implanter
randomItems.Add("/obj/item/weapon/storage/box/syndicate") //Syndicate bundle
//if(uses > 8) //Nothing... yet.
//if(uses > 7) //Nothing... yet.
if(uses > 6)
randomItems.Add("/obj/item/weapon/aiModule/syndicate") //Hacked AI Upload Module
randomItems.Add("/obj/item/device/radio/beacon/syndicate") //Singularity Beacon
if(uses > 5)
randomItems.Add("/obj/item/weapon/gun/projectile") //Revolver
if(uses > 4)
randomItems.Add("/obj/item/weapon/gun/energy/crossbow") //Energy Crossbow
randomItems.Add("/obj/item/device/powersink") //Powersink
if(uses > 3)
randomItems.Add("/obj/item/weapon/melee/energy/sword") //Energy Sword
randomItems.Add("/obj/item/clothing/mask/gas/voice") //Voice Changer
randomItems.Add("/obj/item/device/chameleon") //Chameleon Projector
if(uses > 2)
randomItems.Add("/obj/item/weapon/storage/emp_kit") //EMP Grenades
randomItems.Add("/obj/item/weapon/pen/paralysis") //Paralysis Pen
randomItems.Add("/obj/item/weapon/cartridge/syndicate") //Detomatix Cartridge
randomItems.Add("/obj/item/clothing/under/chameleon") //Chameleon Jumpsuit
randomItems.Add("/obj/item/weapon/card/id/syndicate") //Agent ID Card
randomItems.Add("/obj/item/weapon/card/emag") //Cryptographic Sequencer
randomItems.Add("/obj/item/weapon/storage/syndie_kit/space") //Syndicate Space Suit
randomItems.Add("/obj/item/device/encryptionkey/binary") //Binary Translator Key
randomItems.Add("/obj/item/weapon/storage/syndie_kit/imp_freedom") //Freedom Implant
randomItems.Add("/obj/item/clothing/glasses/thermal") //Thermal Imaging Goggles
if(uses > 1)
/*
var/list/usrItems = usr.get_contents() //Checks to see if the user has a revolver before giving ammo
var/hasRevolver = 0
for(var/obj/I in usrItems) //Only add revolver ammo if the user has a gun that can shoot it
if(istype(I,/obj/item/weapon/gun/projectile))
hasRevolver = 1
if(hasRevolver) randomItems.Add("/obj/item/ammo_magazine/a357") //Revolver ammo
*/
randomItems.Add("/obj/item/ammo_magazine/a357") //Revolver ammo
randomItems.Add("/obj/item/clothing/shoes/syndigaloshes") //No-Slip Syndicate Shoes
randomItems.Add("/obj/item/weapon/plastique") //C4
if(uses > 0)
randomItems.Add("/obj/item/weapon/soap/syndie") //Syndicate Soap
randomItems.Add("/obj/item/weapon/storage/toolbox/syndicate") //Syndicate Toolbox
if(!randomItems)
del(randomItems)
return 0
else
href_list["buy_item"] = pick(randomItems)
switch(href_list["buy_item"]) //Ok, this gets a little messy, sorry.
if("/obj/item/weapon/circuitboard/teleporter")
uses -= 20
if("/obj/item/toy/syndicateballoon" , "/obj/item/weapon/storage/syndie_kit/imp_uplink" , "/obj/item/weapon/storage/box/syndicate")
uses -= 10
if("/obj/item/weapon/aiModule/syndicate" , "/obj/item/device/radio/beacon/syndicate")
uses -= 7
if("/obj/item/weapon/gun/projectile")
uses -= 6
if("/obj/item/weapon/gun/energy/crossbow" , "/obj/item/device/powersink")
uses -= 5
if("/obj/item/weapon/melee/energy/sword" , "/obj/item/clothing/mask/gas/voice" , "/obj/item/device/chameleon")
uses -= 4
if("/obj/item/weapon/storage/emp_kit" , "/obj/item/weapon/pen/paralysis" , "/obj/item/weapon/cartridge/syndicate" , "/obj/item/clothing/under/chameleon" , \
"/obj/item/weapon/card/id/syndicate" , "/obj/item/weapon/card/emag" , "/obj/item/weapon/storage/syndie_kit/space" , "/obj/item/device/encryptionkey/binary" , \
"/obj/item/weapon/storage/syndie_kit/imp_freedom" , "/obj/item/clothing/glasses/thermal")
uses -= 3
if("/obj/item/ammo_magazine/a357" , "/obj/item/clothing/shoes/syndigaloshes" , "/obj/item/weapon/plastique")
uses -= 2
if("/obj/item/weapon/soap/syndie" , "/obj/item/weapon/storage/toolbox/syndicate")
uses -= 1
del(randomItems)
return 1
if(text2num(href_list["cost"]) > uses) // Not enough crystals for the item
return 0
//if(usr:mind && ticker.mode.traitors[usr:mind])
//var/datum/traitorinfo/info = ticker.mode.traitors[usr:mind]
//info.spawnlist += href_list["buy_item"]
uses -= text2num(href_list["cost"])
return 1
/*
*PDA uplink
*/
//Syndicate uplink hidden inside a traitor PDA
//Communicate with traitor through the PDA's note function.
/obj/item/device/uplink/pda
name = "uplink module"
desc = "An electronic uplink system of unknown origin."
icon = 'module.dmi'
icon_state = "power_mod"
var/obj/item/device/pda/hostpda = null
var/orignote = null //Restore original notes when locked.
var/active = 0 //Are we currently active?
var/lock_code = "" //The unlocking password.
proc
unlock()
if ((isnull(src.hostpda)) || (src.active))
return
src.orignote = src.hostpda.note
src.active = 1
src.hostpda.mode = 1 //Switch right to the notes program
src.generate_menu()
print_to_host(menu_message)
for (var/mob/M in viewers(1, src.hostpda.loc))
if (M.client && M.machine == src.hostpda)
src.hostpda.attack_self(M)
return
print_to_host(var/text)
if (isnull(hostpda))
return
hostpda.note = text
for (var/mob/M in viewers(1, hostpda.loc))
if (M.client && M.machine == hostpda)
hostpda.attack_self(M)
return
shutdown_uplink()
if (isnull(src.hostpda))
return
active = 0
hostpda.note = orignote
if (hostpda.mode==1)
hostpda.mode = 0
hostpda.updateDialog()
return
attack_self(mob/user as mob)
src.generate_menu()
src.hostpda.note = src.menu_message
Topic(href, href_list)
if ((isnull(src.hostpda)) || (!src.active))
return
if (usr.stat || usr.restrained() || !in_range(src.hostpda, usr))
return
if(..() == 1) // We can afford the item
var/path_obj = text2path(href_list["buy_item"])
var/mob/A = src.hostpda.loc
var/item = new path_obj(get_turf(src.hostpda))
if(ismob(A) && !(locate(item) in NotInHand)) //&& !istype(item, /obj/spawner))
if(!A.r_hand)
item:loc = A
A.r_hand = item
item:layer = 20
else if(!A.l_hand)
item:loc = A
A.l_hand = item
item:layer = 20
else
item:loc = get_turf(A)
usr.update_clothing()
// usr.client.onBought("[item:name]") When we have the stats again, uncomment.
/* if(istype(item, /obj/spawner)) // Spawners need to have del called on them to avoid leaving a marker behind
del item*/
//HEADFINDBACK
src.attack_self(usr)
src.hostpda.attack_self(usr)
return
/*
*Portable radio uplink
*/
//A Syndicate uplink disguised as a portable radio
/obj/item/device/uplink/radio/implanted
New()
..()
uses = 5
return
explode()
var/obj/item/weapon/implant/uplink/U = src.loc
var/mob/living/A = U.imp_in
A.gib()
..()
// var/turf/location = get_turf(src.loc)
// if(location)
// location.hotspot_expose(700,125)
// explosion(location, 0, 0, 2, 4, 1)
// var/obj/item/weapon/implant/uplink/U = src.loc
// var/mob/living/A = U.imp_in
// var/datum/organ/external/head = A:organs["head"]
// head.destroyed = 1
// spawn(2)
// head.droplimb()
// del(src.master)
// del(src)
// return
/obj/item/device/uplink/radio
name = "ship bounced radio"
icon = 'radio.dmi'
icon_state = "radio"
var/temp = null //Temporary storage area for a message offering the option to destroy the radio
var/selfdestruct = 0 //Set to 1 while the radio is self destructing itself.
var/obj/item/device/radio/origradio = null
flags = FPRINT | TABLEPASS | CONDUCT | ONBELT
w_class = 2.0
item_state = "radio"
throwforce = 5
throw_speed = 4
throw_range = 20
m_amt = 100
attack_self(mob/user as mob)
var/dat
if (src.selfdestruct)
dat = "Self Destructing..."
else
if (src.temp)
dat = "[src.temp]<BR><BR><A href='byond://?src=\ref[src];clear_selfdestruct=1'>Clear</A>"
else
src.generate_menu()
dat = src.menu_message
if (src.origradio) // Checking because sometimes the radio uplink may be spawned by itself, not as a normal unlockable radio
dat += "<A href='byond://?src=\ref[src];lock=1'>Lock</A><BR>"
dat += "<HR>"
dat += "<A href='byond://?src=\ref[src];selfdestruct=1'>Self-Destruct</A>"
user << browse(dat, "window=radio")
onclose(user, "radio")
return
Topic(href, href_list)
if (usr.stat || usr.restrained())
return
if (!( istype(usr, /mob/living/carbon/human)))
return 1
if ((usr.contents.Find(src) || (in_range(src, usr) && istype(src.loc, /turf)) || istype(src.loc,/obj/item/weapon/implant/uplink)))
usr.machine = src
if(href_list["buy_item"])
if(..() == 1) // We can afford the item
var/path_obj = text2path(href_list["buy_item"])
var/item = new path_obj(get_turf(src.loc))
var/mob/A = src.loc
if(istype(src.loc,/obj/item/weapon/implant/uplink))
var/obj/item/weapon/implant/uplink/U = src.loc
A = U.imp_in
if(ismob(A) && !(locate(item) in NotInHand)) //&& !istype(item, /obj/spawner))
if(!A.r_hand)
item:loc = A
A.r_hand = item
item:layer = 20
else if(!A.l_hand)
item:loc = A
A.l_hand = item
item:layer = 20
else
item:loc = get_turf(A)
/* if(istype(item, /obj/spawner)) // Spawners need to have del called on them to avoid leaving a marker behind
del item*/
// usr.client.onBought("[item:name]") When we have the stats again, uncomment.
src.attack_self(usr)
return
else if (href_list["lock"] && src.origradio)
// presto chango, a regular radio again! (reset the freq too...)
usr.machine = null
usr << browse(null, "window=radio")
var/obj/item/device/radio/T = src.origradio
var/obj/item/device/uplink/radio/R = src
R.loc = T
T.loc = usr
// R.layer = initial(R.layer)
R.layer = 0
if (usr.client)
usr.client.screen -= R
if (usr.r_hand == R)
usr.u_equip(R)
usr.r_hand = T
else
usr.u_equip(R)
usr.l_hand = T
R.loc = T
T.layer = 20
T.set_frequency(initial(T.frequency))
T.attack_self(usr)
return
else if (href_list["selfdestruct"])
src.temp = "<A href='byond://?src=\ref[src];selfdestruct2=1'>Self-Destruct</A>"
else if (href_list["selfdestruct2"])
src.selfdestruct = 1
spawn (100)
explode()
return
else if (href_list["clear_selfdestruct"])
src.temp = null
attack_self(usr)
// if (istype(src.loc, /mob))
// attack_self(src.loc)
// else
// for(var/mob/M in viewers(1, src))
// if (M.client)
// src.attack_self(M)
return
proc/explode()
var/turf/location = get_turf(src.loc)
if(location)
location.hotspot_expose(700,125)
explosion(location, 0, 0, 2, 4, 1)
del(src.master)
del(src)
return
proc/shutdown_uplink()
if (!src.origradio)
return
var/list/nearby = viewers(1, src)
for(var/mob/M in nearby)
if (M.client && M.machine == src)
M << browse(null, "window=radio")
M.machine = null
var/obj/item/device/radio/T = src.origradio
var/obj/item/device/uplink/radio/R = src
var/mob/L = src.loc
R.loc = T
T.loc = L
// R.layer = initial(R.layer)
R.layer = 0
if (istype(L))
if (L.client)
L.client.screen -= R
if (L.r_hand == R)
L.u_equip(R)
L.r_hand = T
else
L.u_equip(R)
L.l_hand = T
T.layer = 20
T.set_frequency(initial(T.frequency))
return

View File

@@ -337,7 +337,9 @@ This method wont take into account storage items developed in the future and doe
var/obj/item/weapon/paper/reqform = new /obj/item/weapon/paper(src.loc) var/obj/item/weapon/paper/reqform = new /obj/item/weapon/paper(src.loc)
var/idname = "Unknown" var/idname = "Unknown"
var/idrank = "Unknown" var/idrank = "Unknown"
var/reason = input(usr,"Reason:","Why do you require this item?","") var/reason = copytext(sanitize(input(usr,"Reason:","Why do you require this item?","")),1,MAX_MESSAGE_LEN)
if(!reason)
reason = "Unknown"
reqform.name = "Requisition Form - [P.name]" reqform.name = "Requisition Form - [P.name]"
reqform.info += "<h3>[station_name] Supply Requisition Form</h3><hr>" reqform.info += "<h3>[station_name] Supply Requisition Form</h3><hr>"
@@ -538,7 +540,7 @@ This method wont take into account storage items developed in the future and doe
supply_shuttle_points -= P.cost supply_shuttle_points -= P.cost
O.object = P O.object = P
O.orderedby = usr.name O.orderedby = usr.name
O.comment = input(usr,"Comment:","Enter comment","") O.comment = copytext(sanitize(input(usr,"Comment:","Enter comment","")),1,MAX_MESSAGE_LEN)
supply_shuttle_shoppinglist += O supply_shuttle_shoppinglist += O
src.temp = "Thanks for your order.<BR>" src.temp = "Thanks for your order.<BR>"
src.temp += "<BR><A href='?src=\ref[src];mainmenu=1'>OK</A>" src.temp += "<BR><A href='?src=\ref[src];mainmenu=1'>OK</A>"
@@ -554,7 +556,7 @@ This method wont take into account storage items developed in the future and doe
supply_shuttle_points -= P.cost supply_shuttle_points -= P.cost
O.object = P O.object = P
O.orderedby = usr.name O.orderedby = usr.name
O.comment = input(usr,"Comment:","Enter comment","") O.comment = copytext(sanitize(input(usr,"Comment:","Enter comment","")),1,MAX_MESSAGE_LEN)
supply_shuttle_shoppinglist += O supply_shuttle_shoppinglist += O
src.temp = "Thanks for your order.<BR>" src.temp = "Thanks for your order.<BR>"
src.temp += "<BR><A href='?src=\ref[src];mainmenu=1'>OK</A>" src.temp += "<BR><A href='?src=\ref[src];mainmenu=1'>OK</A>"

View File

@@ -860,11 +860,10 @@ var/global/BSACooldown = 0
if ((src.rank in list( "Trial Admin", "Badmin", "Game Admin", "Game Master" ))) if ((src.rank in list( "Trial Admin", "Badmin", "Game Admin", "Game Master" )))
var/mob/M = locate(href_list["forcespeech"]) var/mob/M = locate(href_list["forcespeech"])
if (ismob(M)) if (ismob(M))
var/speech = input("What will [key_name(M)] say?.", "Force speech", "") var/speech = copytext(sanitize(input("What will [key_name(M)] say?.", "Force speech", "")),1,MAX_MESSAGE_LEN)
if(!speech) if(!speech)
return return
M.say(speech) M.say(speech)
speech = copytext(sanitize(speech), 1, MAX_MESSAGE_LEN)
log_admin("[key_name(usr)] forced [key_name(M)] to say: [speech]") log_admin("[key_name(usr)] forced [key_name(M)] to say: [speech]")
message_admins("\blue [key_name_admin(usr)] forced [key_name_admin(M)] to say: [speech]") message_admins("\blue [key_name_admin(usr)] forced [key_name_admin(M)] to say: [speech]")
else else
@@ -1732,7 +1731,7 @@ var/global/BSACooldown = 0
if(!ticker) if(!ticker)
alert("The game hasn't started yet!") alert("The game hasn't started yet!")
return return
var/objective = input("Enter an objective") var/objective = copytext(sanitize(input("Enter an objective")),1,MAX_MESSAGE_LEN)
if(!objective) if(!objective)
return return
feedback_inc("admin_secrets_fun_used",1) feedback_inc("admin_secrets_fun_used",1)

View File

@@ -24,7 +24,7 @@ var/global/sent_strike_team = 0
var/input = null var/input = null
while(!input) while(!input)
input = input(src, "Please specify which mission the death commando squad shall undertake.", "Specify Mission", "") input = copytext(sanitize(input(src, "Please specify which mission the death commando squad shall undertake.", "Specify Mission", "")),1,MAX_MESSAGE_LEN)
if(!input) if(!input)
if(alert("Error, no mission set. Do you want to exit the setup process?",,"Yes","No")=="Yes") if(alert("Error, no mission set. Do you want to exit the setup process?",,"Yes","No")=="Yes")
return return

View File

@@ -24,7 +24,7 @@ var/global/sent_syndicate_strike_team = 0
var/input = null var/input = null
while(!input) while(!input)
input = input(src, "Please specify which mission the syndicate strike team shall undertake.", "Specify Mission", "") input = copytext(sanitize(input(src, "Please specify which mission the syndicate strike team shall undertake.", "Specify Mission", "")),1,MAX_MESSAGE_LEN)
if(!input) if(!input)
if(alert("Error, no mission set. Do you want to exit the setup process?",,"Yes","No")=="Yes") if(alert("Error, no mission set. Do you want to exit the setup process?",,"Yes","No")=="Yes")
return return

View File

@@ -47,10 +47,9 @@
m_type = 1 m_type = 1
if ("custom") if ("custom")
var/input = input("Choose an emote to display.") as text|null var/input = copytext(sanitize(input("Choose an emote to display.") as text|null),1,MAX_MESSAGE_LEN)
if (!input) if (!input)
return return
input = sanitize(input)
var/input2 = input("Is this a visible or hearable emote?") in list("Visible","Hearable") var/input2 = input("Is this a visible or hearable emote?") in list("Visible","Hearable")
if (input2 == "Visible") if (input2 == "Visible")
m_type = 1 m_type = 1

View File

@@ -56,10 +56,9 @@
m_type = 2 m_type = 2
if ("custom") if ("custom")
var/input = input("Choose an emote to display.") as text|null var/input = copytext(sanitize(input("Choose an emote to display.") as text|null),1,MAX_MESSAGE_LEN)
if (!input) if (!input)
return return
input = sanitize(input)
var/input2 = input("Is this a visible or hearable emote?") in list("Visible","Hearable") var/input2 = input("Is this a visible or hearable emote?") in list("Visible","Hearable")
if (input2 == "Visible") if (input2 == "Visible")
m_type = 1 m_type = 1

View File

@@ -391,16 +391,14 @@ datum/preferences
switch(link_tags["real_name"]) switch(link_tags["real_name"])
if("input") if("input")
new_name = input(user, "Please select a name:", "Character Generation") as text new_name = copytext( (input(user, "Please select a name:", "Character Generation") as text) ,1,MAX_NAME_LEN)
var/list/bad_characters = list("_", "\"", "<", ">", ";", "\[", "\]", "{", "}", "|", "\\","0","1","2","3","4","5","6","7","8","9") var/list/bad_characters = list("_", "\"", "<", ">", ";", "\[", "\]", "{", "}", "|", "\\","0","1","2","3","4","5","6","7","8","9")
for(var/c in bad_characters) for(var/c in bad_characters)
new_name = dd_replacetext(new_name, c, "") new_name = dd_replacetext(new_name, c, "")
if(!new_name || (new_name == "Unknown") || (new_name == "floor") || (new_name == "wall") || (new_name == "r-wall")) if(!new_name || (new_name == "Unknown") || (new_name == "floor") || (new_name == "wall") || (new_name == "r-wall"))
alert("Invalid name. Don't do that!") alert("Invalid name. Don't do that!")
return return
if(length(new_name) >= 26)
alert("That name is too long.")
return
//Carn: To fix BYOND text-parsing errors caused by people using dumb capitalisation in their names. //Carn: To fix BYOND text-parsing errors caused by people using dumb capitalisation in their names.
var/tempname var/tempname
@@ -414,8 +412,6 @@ datum/preferences
randomize_name() randomize_name()
if(new_name) if(new_name)
if(length(new_name) >= 26)
new_name = copytext(new_name, 1, 26)
real_name = new_name real_name = new_name
if(link_tags["age"]) if(link_tags["age"])
@@ -429,17 +425,9 @@ datum/preferences
if(link_tags["OOC"]) if(link_tags["OOC"])
var/tempnote = "" var/tempnote = ""
tempnote = input(user, "Please enter your OOC/ERP Notes!:", "OOC notes" , metadata) as text tempnote = copytext(sanitize(input(user, "Please enter your OOC Notes!:", "OOC notes" , metadata) as text),1,MAX_MESSAGE_LEN)
var/list/bad_characters = list("_", "\"", "<", ">", ";", "\[", "\]", "{", "}", "|", "\\","0","1","2","3","4","5","6","7","8","9") if(tempnote)
metadata = tempnote
for(var/c in bad_characters)
tempnote = dd_replacetext(tempnote, c, "")
if(length(tempnote) >= 255)
alert("That name is too long. (255 character max, please)")
return
metadata = tempnote
return return
@@ -493,9 +481,9 @@ datum/preferences
if("random") if("random")
randomize_skin_tone() randomize_skin_tone()
if("input") if("input")
var/new_tone = input(user, "Please select skin tone level: 1-220 (1=albino, 35=caucasian, 150=black, 220='very' black)", "Character Generation") as text var/new_tone = input(user, "Please select skin tone level: 1-220 (1=albino, 35=caucasian, 150=black, 220='very' black)", "Character Generation") as num
if(new_tone) if(new_tone)
s_tone = max(min(round(text2num(new_tone)), 220), 1) s_tone = max(min(round(new_tone), 220), 1)
s_tone = -s_tone + 35 s_tone = -s_tone + 35
if(link_tags["h_style"]) if(link_tags["h_style"])

View File

@@ -35,8 +35,7 @@
user << "\blue You put the [W] into the folder." user << "\blue You put the [W] into the folder."
update_icon() update_icon()
else if(istype(W, /obj/item/weapon/pen)) else if(istype(W, /obj/item/weapon/pen))
var/n_name = input(usr, "What would you like to label the folder?", "Folder Labelling", null) as text var/n_name = copytext(sanitize(input(usr, "What would you like to label the folder?", "Folder Labelling", null) as text),1,MAX_NAME_LEN)
n_name = copytext(n_name, 1, 32)
if ((loc == usr && usr.stat == 0)) if ((loc == usr && usr.stat == 0))
name = "folder[(n_name ? text("- '[n_name]'") : null)]" name = "folder[(n_name ? text("- '[n_name]'") : null)]"
return return

View File

@@ -40,13 +40,10 @@
if(mode) if(mode)
usr << "\blue You turn on the hand labeler." usr << "\blue You turn on the hand labeler."
//Now let them chose the text. //Now let them chose the text.
var/str = reject_bad_text(input(usr,"Label text?","Set label","")) //sanitize stuff! GOD DAMN THIS IS A SECURITY HOLE var/str = copytext(reject_bad_text(input(usr,"Label text?","Set label","")),1,MAX_NAME_LEN)
if(!str || !length(str)) if(!str || !length(str))
usr << "\red Invalid text." usr << "\red Invalid text."
return return
if(length(str) > 64)
usr << "\red Text too long."
return
label = str label = str
usr << "\blue You set the text to '[str]'." usr << "\blue You set the text to '[str]'."
else else

View File

@@ -62,8 +62,7 @@
if ((usr.mutations & CLUMSY) && prob(50)) if ((usr.mutations & CLUMSY) && prob(50))
usr << "\red You cut yourself on the paper." usr << "\red You cut yourself on the paper."
return return
var/n_name = input(usr, "What would you like to label the paper?", "Paper Labelling", null) as text var/n_name = copytext(sanitize(input(usr, "What would you like to label the paper?", "Paper Labelling", null) as text),1,MAX_NAME_LEN)
n_name = copytext(n_name, 1, 32)
if ((loc == usr && usr.stat == 0)) if ((loc == usr && usr.stat == 0))
name = "paper[(n_name ? text("- '[n_name]'") : null)]" name = "paper[(n_name ? text("- '[n_name]'") : null)]"
add_fingerprint(usr) add_fingerprint(usr)

View File

@@ -26,8 +26,7 @@
M << "\red You don't feel cool enough to name this gun, chump." M << "\red You don't feel cool enough to name this gun, chump."
return 0 return 0
var/input = input("What do you want to name the gun?",,"") var/input = copytext(sanitize(input("What do you want to name the gun?",,"")),1,MAX_NAME_LEN)
input = sanitize(input)
if(src && input && !M.stat && in_range(M,src)) if(src && input && !M.stat && in_range(M,src))
name = input name = input

View File

@@ -24,17 +24,13 @@
user << "\blue *TAGGED*" user << "\blue *TAGGED*"
src.sortTag = O.currTag src.sortTag = O.currTag
else if(istype(W, /obj/item/weapon/pen)) else if(istype(W, /obj/item/weapon/pen))
var/str = input(usr,"Label text?","Set label","") var/str = copytext(sanitize(input(usr,"Label text?","Set label","")),1,MAX_NAME_LEN)
if(!str || !length(str)) if(!str || !length(str))
usr << "\red Invalid text." usr << "\red Invalid text."
return return
if(length(str) > 64)
usr << "\red Text too long."
return
var/label = str
for(var/mob/M in viewers()) for(var/mob/M in viewers())
M << "\blue [user] labels [src] as [label]." M << "\blue [user] labels [src] as [str]."
src.name = "[src.name] ([label])" src.name = "[src.name] ([str])"
return return
/obj/item/smallDelivery /obj/item/smallDelivery
@@ -64,17 +60,13 @@
user << "\blue *TAGGED*" user << "\blue *TAGGED*"
src.sortTag = O.currTag src.sortTag = O.currTag
else if(istype(W, /obj/item/weapon/pen)) else if(istype(W, /obj/item/weapon/pen))
var/str = input(usr,"Label text?","Set label","") var/str = copytext(sanitize(input(usr,"Label text?","Set label","")),1,MAX_NAME_LEN)
if(!str || !length(str)) if(!str || !length(str))
usr << "\red Invalid text." usr << "\red Invalid text."
return return
if(length(str) > 64)
usr << "\red Text too long."
return
var/label = str
for(var/mob/M in viewers()) for(var/mob/M in viewers())
M << "\blue [user] labels [src] as [label]." M << "\blue [user] labels [src] as [str]."
src.name = "[src.name] ([label])" src.name = "[src.name] ([str])"
return return

View File

@@ -154,7 +154,6 @@
#define FILE_DIR "code/unused/powerarmor" #define FILE_DIR "code/unused/powerarmor"
#define FILE_DIR "code/unused/spacecraft" #define FILE_DIR "code/unused/spacecraft"
#define FILE_DIR "code/WorkInProgress" #define FILE_DIR "code/WorkInProgress"
#define FILE_DIR "code/WorkInProgress/BS12"
#define FILE_DIR "code/WorkInProgress/mapload" #define FILE_DIR "code/WorkInProgress/mapload"
#define FILE_DIR "code/WorkInProgress/organs" #define FILE_DIR "code/WorkInProgress/organs"
#define FILE_DIR "code/WorkInProgress/virus2" #define FILE_DIR "code/WorkInProgress/virus2"
@@ -605,6 +604,7 @@
#include "code\game\objects\tank.dm" #include "code\game\objects\tank.dm"
#include "code\game\objects\toys.dm" #include "code\game\objects\toys.dm"
#include "code\game\objects\transfer_valve.dm" #include "code\game\objects\transfer_valve.dm"
#include "code\game\objects\uplinks.dm"
#include "code\game\objects\washing_machine.dm" #include "code\game\objects\washing_machine.dm"
#include "code\game\objects\watercloset.dm" #include "code\game\objects\watercloset.dm"
#include "code\game\objects\weapons.dm" #include "code\game\objects\weapons.dm"
@@ -723,6 +723,7 @@
#include "code\game\objects\storage\lockbox.dm" #include "code\game\objects\storage\lockbox.dm"
#include "code\game\objects\storage\storage.dm" #include "code\game\objects\storage\storage.dm"
#include "code\game\objects\storage\toolbox.dm" #include "code\game\objects\storage\toolbox.dm"
#include "code\game\objects\storage\uplink_kits.dm"
#include "code\game\objects\tanks\emergency.dm" #include "code\game\objects\tanks\emergency.dm"
#include "code\game\objects\tanks\jetpack.dm" #include "code\game\objects\tanks\jetpack.dm"
#include "code\game\objects\tanks\oxygen.dm" #include "code\game\objects\tanks\oxygen.dm"
@@ -1076,8 +1077,6 @@
#include "code\modules\security levels\security levels.dm" #include "code\modules\security levels\security levels.dm"
#include "code\WorkInProgress\buildmode.dm" #include "code\WorkInProgress\buildmode.dm"
#include "code\WorkInProgress\explosion_particles.dm" #include "code\WorkInProgress\explosion_particles.dm"
#include "code\WorkInProgress\BS12\uplink_kits.dm"
#include "code\WorkInProgress\BS12\uplinks.dm"
#include "code\WorkInProgress\organs\implants.dm" #include "code\WorkInProgress\organs\implants.dm"
#include "code\WorkInProgress\organs\organs.dm" #include "code\WorkInProgress\organs\organs.dm"
#include "interface\interface.dm" #include "interface\interface.dm"