diff --git a/baystation12.dme b/baystation12.dme
index fd0b229b659..9103ff1b305 100644
--- a/baystation12.dme
+++ b/baystation12.dme
@@ -648,6 +648,7 @@
#include "code\game\objects\tank.dm"
#include "code\game\objects\toys.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\watercloset.dm"
#include "code\game\objects\weapons.dm"
@@ -773,6 +774,7 @@
#include "code\game\objects\storage\lockbox.dm"
#include "code\game\objects\storage\storage.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\jetpack.dm"
#include "code\game\objects\tanks\oxygen.dm"
@@ -1182,8 +1184,6 @@
#include "code\WorkInProgress\organs\organs.dm"
#include "code\WorkInProgress\Ported\head.dm"
#include "code\WorkInProgress\Ported\policetape.dm"
-#include "code\WorkInProgress\Ported\Abi79\uplink_kits.dm"
-#include "code\WorkInProgress\Ported\Abi79\uplinks.dm"
#include "code\WorkInProgress\Ported\Bureaucracy\copier.dm"
#include "code\WorkInProgress\Ported\Bureaucracy\filing.dm"
#include "code\WorkInProgress\SkyMarshal\coatrack.dm"
diff --git a/code/datums/datumvars.dm b/code/datums/datumvars.dm
index c328dd98d1b..8f41138e108 100644
--- a/code/datums/datumvars.dm
+++ b/code/datums/datumvars.dm
@@ -418,7 +418,7 @@ client/Topic(href, href_list, hsrc)
//~CARN: for renaming mobs (updates their real_name and their ID/PDA if applicable).
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
var/mob/M = locate(href_list["rename"])
if(!istype(M)) return
diff --git a/code/datums/mind.dm b/code/datums/mind.dm
index eb2d7b924a7..9be4f6423fb 100644
--- a/code/datums/mind.dm
+++ b/code/datums/mind.dm
@@ -305,7 +305,7 @@ datum/mind
role_alt_title = null
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
memory = new_memo
@@ -408,7 +408,7 @@ datum/mind
new_objective:target_amount = target_number
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
new_objective = new /datum/objective
new_objective.owner = src
diff --git a/code/defines/global.dm b/code/defines/global.dm
index eea4addf107..6754b7b7925 100644
--- a/code/defines/global.dm
+++ b/code/defines/global.dm
@@ -190,6 +190,8 @@ var
const/MAX_PAPER_MESSAGE_LEN = 3072
const/MAX_BOOK_MESSAGE_LEN = 9216
+ const/MAX_NAME_LEN = 26
+
list/paper_blacklist = list("script","frame","iframe","input","button","a","embed","object")
const/shuttle_time_in_station = 1800 // 3 minutes in the station
diff --git a/code/defines/procs/helpers.dm b/code/defines/procs/helpers.dm
index e128be4cf8c..8a2d3311421 100644
--- a/code/defines/procs/helpers.dm
+++ b/code/defines/procs/helpers.dm
@@ -692,15 +692,15 @@ Turf and target are seperate in case you want to teleport some distance from a t
/proc/ainame(var/mob/M as mob)
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/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.
M << "You took too long to decide. Default name selected."
return
- if (length(newname) == 0)
+ if (!newname)
newname = randomname
- if (newname)
+ else
if (newname == "Inactive AI")//Keeping this here to prevent dumb.
M << "That name is reserved."
return ainame(M)
@@ -708,22 +708,19 @@ Turf and target are seperate in case you want to teleport some distance from a t
if (A.real_name == newname&&newname!=randomname)
M << "There's already an AI with that name."
return ainame(M)
- if (length(newname) >= 26)
- newname = copytext(newname, 1, 26)
- newname = dd_replacetext(newname, ">", "'")
M.real_name = newname
M.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
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
- if (length(newname) == 0)
+ if (!newname)
newname = randomname
- if (newname)
+ else
var/badname = 0
switch(newname)
if("Unknown") badname = 1
@@ -740,9 +737,6 @@ Turf and target are seperate in case you want to teleport some distance from a t
if(A.real_name == newname)
M << "That name is reserved."
return clname(M)
- if(length(newname) >= 26)
- newname = copytext(newname, 1, 26)
- newname = dd_replacetext(newname, ">", "'")
M.real_name = newname
M.name = newname
M.original_name = newname
diff --git a/code/game/events/EventProcs/space_ninja.dm b/code/game/events/EventProcs/space_ninja.dm
index c600efd4057..ca89012651c 100644
--- a/code/game/events/EventProcs/space_ninja.dm
+++ b/code/game/events/EventProcs/space_ninja.dm
@@ -409,7 +409,7 @@ As such, it's hard-coded for now. No reason for it not to be, really.
var/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(alert("Error, no mission set. Do you want to exit the setup process?",,"Yes","No")=="Yes")
return
diff --git a/code/game/gamemodes/nuclear/nuclear.dm b/code/game/gamemodes/nuclear/nuclear.dm
index 91f56fd4f9e..c59807054a1 100644
--- a/code/game/gamemodes/nuclear/nuclear.dm
+++ b/code/game/gamemodes/nuclear/nuclear.dm
@@ -339,18 +339,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.
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
- if (newname)
- if (newname == "Unknown")
+ else
+ if (newname == "Unknown" || newname == "floor" || newname == "wall" || newname == "rwall" || newname == "_")
M << "That name is reserved."
return nukelastname(M)
- if (length(newname) >= 26)
- newname = copytext(newname, 1, 26)
- newname = dd_replacetext(newname, ">", "'")
return newname
diff --git a/code/game/gamemodes/objective.dm b/code/game/gamemodes/objective.dm
index 632fdca82f7..3c01abe6679 100644
--- a/code/game/gamemodes/objective.dm
+++ b/code/game/gamemodes/objective.dm
@@ -334,7 +334,7 @@ datum/objective/steal
var/tmp_obj = new custom_target
var/custom_name = tmp_obj:name
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
target_name = custom_name
steal_target = custom_target
@@ -343,7 +343,6 @@ datum/objective/steal
set_target(new_target)
return steal_target
-
check_completion()
if(!steal_target || !owner.current) return 0
if(!isliving(owner.current)) return 0
diff --git a/code/game/gamemodes/wizard/wizard.dm b/code/game/gamemodes/wizard/wizard.dm
index a3eff11b365..885b32ccdd5 100644
--- a/code/game/gamemodes/wizard/wizard.dm
+++ b/code/game/gamemodes/wizard/wizard.dm
@@ -72,15 +72,11 @@
var/wizard_name_second = pick(wizard_second)
var/randomname = "[wizard_name_first] [wizard_name_second]"
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
- if (newname)
- if (length(newname) >= 26)
- newname = copytext(newname, 1, 26)
- newname = dd_replacetext(newname, ">", "'")
wizard_mob.real_name = newname
wizard_mob.name = newname
return
diff --git a/code/game/jobs/job/civilian_chaplain.dm b/code/game/jobs/job/civilian_chaplain.dm
index 6f80d8ec9bb..0871a8977f4 100644
--- a/code/game/jobs/job/civilian_chaplain.dm
+++ b/code/game/jobs/job/civilian_chaplain.dm
@@ -21,15 +21,11 @@
H.equip_if_possible(new /obj/item/clothing/shoes/black(H), H.slot_shoes)
spawn(0)
var/religion_name = "Christianity"
- var/new_religion = input(H, "You are the Chaplain / Counselor. For game mechanics purposes, you need to choose a religion either way. 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 / Counselor. For game mechanics purposes, you need to choose a religion either way. 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"))
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))
if("christianity")
B.name = pick("The Holy Bible","The Dead Sea Scrolls")
@@ -53,15 +49,10 @@
spawn(1)
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") )
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
var/accepted = 0
diff --git a/code/game/machinery/bots/mulebot.dm b/code/game/machinery/bots/mulebot.dm
index 9d720356481..fe00a74c636 100644
--- a/code/game/machinery/bots/mulebot.dm
+++ b/code/game/machinery/bots/mulebot.dm
@@ -377,7 +377,7 @@
if("setid")
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
if(new_id)
suffix = new_id
@@ -962,4 +962,4 @@
new /obj/effect/decal/cleanable/oil(src.loc)
unload(0)
- del(src)
\ No newline at end of file
+ del(src)
diff --git a/code/game/machinery/computer/communications.dm b/code/game/machinery/computer/communications.dm
index fb4b4e1b2f9..84c936a4266 100644
--- a/code/game/machinery/computer/communications.dm
+++ b/code/game/machinery/computer/communications.dm
@@ -98,7 +98,7 @@
if("announce")
if(src.authenticated==2)
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)))
return
captain_announce(input)//This should really tell who is, IE HoP, CE, HoS, RD, Captain
@@ -187,7 +187,7 @@
if(centcomm_message_cooldown)
usr << "Arrays recycling. Please stand by."
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)))
return
Centcomm_announce(input, usr)
@@ -204,7 +204,7 @@
if(centcomm_message_cooldown)
usr << "Arrays recycling. Please stand by."
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)))
return
Syndicate_announce(input, usr)
diff --git a/code/game/machinery/computer/medical.dm b/code/game/machinery/computer/medical.dm
index 56b5e8c1af5..b25043f1f8e 100644
--- a/code/game/machinery/computer/medical.dm
+++ b/code/game/machinery/computer/medical.dm
@@ -293,7 +293,7 @@
switch(href_list["field"])
if("fingerprint")
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))
return
src.active1.fields["fingerprint"] = t1
@@ -305,61 +305,61 @@
src.active1.fields["sex"] = "Male"
if("age")
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))
return
src.active1.fields["age"] = t1
if("mi_dis")
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))
return
src.active2.fields["mi_dis"] = t1
if("mi_dis_d")
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))
return
src.active2.fields["mi_dis_d"] = t1
if("ma_dis")
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))
return
src.active2.fields["ma_dis"] = t1
if("ma_dis_d")
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))
return
src.active2.fields["ma_dis_d"] = t1
if("alg")
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))
return
src.active2.fields["alg"] = t1
if("alg_d")
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))
return
src.active2.fields["alg_d"] = t1
if("cdi")
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))
return
src.active2.fields["cdi"] = t1
if("cdi_d")
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))
return
src.active2.fields["cdi_d"] = t1
if("notes")
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))
return
src.active2.fields["notes"] = t1
@@ -374,7 +374,7 @@
src.temp = text("Blood Type:
\n\tA- A+
\n\tB- B+
\n\tAB- AB+
\n\tO- O+
", src, src, src, src, src, src, src, src)
if("b_dna")
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))
return
src.active1.fields["dna"] = t1
@@ -475,7 +475,7 @@
if (!( istype(src.active2, /datum/data/record) ))
return
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))
return
var/counter = 1
diff --git a/code/game/machinery/computer/prisoner.dm b/code/game/machinery/computer/prisoner.dm
index efde1f1f012..61e26796260 100644
--- a/code/game/machinery/computer/prisoner.dm
+++ b/code/game/machinery/computer/prisoner.dm
@@ -94,7 +94,8 @@
usr << "Unauthorized Access."
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"])
if((I)&&(I.imp_in))
var/mob/living/carbon/R = I.imp_in
diff --git a/code/game/machinery/computer/security.dm b/code/game/machinery/computer/security.dm
index 0790bc4af8b..2a657a0abc9 100644
--- a/code/game/machinery/computer/security.dm
+++ b/code/game/machinery/computer/security.dm
@@ -348,7 +348,7 @@ What a mess.*/
if (!( istype(active2, /datum/data/record) ))
return
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))
return
var/counter = 1
@@ -415,13 +415,13 @@ What a mess.*/
active1.fields["name"] = t1
if("id")
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))
return
active1.fields["id"] = t1
if("fingerprint")
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))
return
active1.fields["fingerprint"] = t1
@@ -433,37 +433,37 @@ What a mess.*/
active1.fields["sex"] = "Male"
if("age")
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))
return
active1.fields["age"] = t1
if("mi_crim")
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))
return
active2.fields["mi_crim"] = t1
if("mi_crim_d")
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))
return
active2.fields["mi_crim_d"] = t1
if("ma_crim")
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))
return
active2.fields["ma_crim"] = t1
if("ma_crim_d")
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))
return
active2.fields["ma_crim_d"] = t1
if("notes")
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))
return
active2.fields["notes"] = t1
diff --git a/code/game/machinery/magnet.dm b/code/game/machinery/magnet.dm
index 46385e4686a..f7dd8539ad8 100644
--- a/code/game/machinery/magnet.dm
+++ b/code/game/machinery/magnet.dm
@@ -323,7 +323,7 @@
if(speed <= 0)
speed = 1
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 != "")
moving = 0 // stop moving
path = newpath
diff --git a/code/game/machinery/navbeacon.dm b/code/game/machinery/navbeacon.dm
index 88711376da9..fe89e8309ae 100644
--- a/code/game/machinery/navbeacon.dm
+++ b/code/game/machinery/navbeacon.dm
@@ -193,7 +193,7 @@ Transponder Codes:
"}
updateDialog()
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)
location = newloc
updateDialog()
diff --git a/code/game/machinery/requests_console.dm b/code/game/machinery/requests_console.dm
index 9a02fe6025b..6f59e606fd5 100644
--- a/code/game/machinery/requests_console.dm
+++ b/code/game/machinery/requests_console.dm
@@ -203,7 +203,7 @@ var/list/obj/machinery/requests_console/allConsoles = list()
if(reject_bad_text(href_list["write"]))
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)
message = new_message
screen = 9
@@ -218,7 +218,7 @@ var/list/obj/machinery/requests_console/allConsoles = list()
priority = -1
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)
message = new_message
switch(href_list["priority"])
diff --git a/code/game/machinery/telecomms/machine_interactions.dm b/code/game/machinery/telecomms/machine_interactions.dm
index 7d87be6345b..f715af521e2 100644
--- a/code/game/machinery/telecomms/machine_interactions.dm
+++ b/code/game/machinery/telecomms/machine_interactions.dm
@@ -176,7 +176,7 @@
switch(href_list["input"])
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))
id = newid
temp = "-% New ID assigned: \"[id]\" %-"
diff --git a/code/game/magic/cultist/runes.dm b/code/game/magic/cultist/runes.dm
index fda0744c647..93b76fcece9 100644
--- a/code/game/magic/cultist/runes.dm
+++ b/code/game/magic/cultist/runes.dm
@@ -534,7 +534,7 @@ var/list/sacrificed = list()
/////////////////////////////////////////FOURTEETH RUNE
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 (istype(src))
return fizzle()
diff --git a/code/game/magic/library.dm b/code/game/magic/library.dm
index 5a2c62f6bf3..6fc25a3fde9 100644
--- a/code/game/magic/library.dm
+++ b/code/game/magic/library.dm
@@ -123,7 +123,7 @@
user.drop_item()
O.loc = src
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)
return
else
@@ -306,12 +306,9 @@
var/choice = input("What would you like to change?") in list("Title", "Contents", "Author", "Cancel")
switch(choice)
if("Title")
- var/ntitle = input("Write a new title:") as text|null
+ var/ntitle = copytext(sanitize(input("Write a new title:") as text|null),1,MAX_MESSAGE_LEN)
if(!ntitle)
return
- else
- title = sanitize(ntitle)
- name = "Book: [title]"
if("Contents")
var/t = "[src.dat]"
do
@@ -337,7 +334,7 @@
src.dat = t
gen_pages()
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)
return
else
@@ -780,9 +777,9 @@ datum/borrowbook // Datum used to keep track of who has borrowed what when and f
if(checkoutperiod < 1)
checkoutperiod = 1
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"])
- 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"])
var/datum/borrowbook/b = new /datum/borrowbook
b.bookname = sanitize(buffer_book)
@@ -802,9 +799,9 @@ datum/borrowbook // Datum used to keep track of who has borrowed what when and f
scanner.cache.title = sanitize(newtitle)
scanner.cache.name = "Book: [scanner.cache.title]"
if(href_list["setauthor"])
- var/newauthor = input("Enter the author's name: ", "Book Upload", scanner.cache.author) as text|null
+ var/newauthor = copytext(sanitize(input("Enter the author's name: ", "Book Upload", scanner.cache.author) as text|null),1,MAX_MESSAGE_LEN)
if(newauthor)
- scanner.cache.author = sanitize(newauthor)
+ scanner.cache.author = newauthor
if(href_list["setcategory"])
var/newcategory = input("Choose a category: ") in list("Fiction", "Non-Fiction", "Adult", "Reference", "Religion")
if(newcategory)
diff --git a/code/game/objects/devices/paicard.dm b/code/game/objects/devices/paicard.dm
index 05cdbbd2196..ff7e2ef5dba 100644
--- a/code/game/objects/devices/paicard.dm
+++ b/code/game/objects/devices/paicard.dm
@@ -90,7 +90,7 @@
else
radio.wires |= t1
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)
pai.pai_laws = newlaws
pai << "Your supplemental directives have been updated. Your new directives are:"
diff --git a/code/game/objects/items/robot_parts.dm b/code/game/objects/items/robot_parts.dm
index c392932ff22..fcc1df6dd60 100644
--- a/code/game/objects/items/robot_parts.dm
+++ b/code/game/objects/items/robot_parts.dm
@@ -220,7 +220,7 @@
if (istype(W, /obj/item/weapon/pen))
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)
return
if (!in_range(src, usr) && src.loc != usr)
diff --git a/code/game/objects/items/weapons/AI_modules.dm b/code/game/objects/items/weapons/AI_modules.dm
index 4f2ffc43991..9a00bbb85bc 100755
--- a/code/game/objects/items/weapons/AI_modules.dm
+++ b/code/game/objects/items/weapons/AI_modules.dm
@@ -91,8 +91,8 @@ AI MODULES
/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)
- targetName = sanitize(targName)
+ var/targName = copytext(sanitize(input(usr, "Please enter the name of the person to safeguard.", "Safeguard who?", user.name)),1,MAX_MESSAGE_LEN)
+ targetName = targName
desc = text("A 'safeguard' AI module: 'Safeguard []. Individuals that threaten [] are not crew and are a threat to crew.'", targetName, targetName)
/obj/item/weapon/aiModule/safeguard/transmitInstructions(var/mob/living/silicon/ai/target, var/mob/sender)
@@ -114,8 +114,8 @@ AI MODULES
/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 crewmember.", "Who?", user.real_name)
- targetName = sanitize(targName)
+ 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 = targName
desc = text("A 'one crewmember' AI module: 'Only [] is crewmember.'", targetName)
/obj/item/weapon/aiModule/oneHuman/transmitInstructions(var/mob/living/silicon/ai/target, var/mob/sender)
@@ -247,8 +247,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 = min(lawpos, 50)
var/newlaw = ""
- var/targName = input(usr, "Please enter a new law for the AI.", "Freeform Law Entry", newlaw)
- newFreeFormLaw = sanitize(targName)
+ var/targName = copytext(sanitize(input(usr, "Please enter a new law for the AI.", "Freeform Law Entry", newlaw)),1,MAX_MESSAGE_LEN)
+ newFreeFormLaw = targName
desc = "A 'freeform' AI module: ([lawpos]) '[newFreeFormLaw]'"
/obj/item/weapon/aiModule/freeform/transmitInstructions(var/mob/living/silicon/ai/target, var/mob/sender)
@@ -390,8 +390,8 @@ AI MODULES
/obj/item/weapon/aiModule/freeformcore/attack_self(var/mob/user as mob)
..()
var/newlaw = ""
- var/targName = input(usr, "Please enter a new core law for the AI.", "Freeform Law Entry", newlaw)
- newFreeFormLaw = sanitize(targName)
+ var/targName = copytext(sanitize(input(usr, "Please enter a new core law for the AI.", "Freeform Law Entry", newlaw)),1,MAX_MESSAGE_LEN)
+ newFreeFormLaw = targName
desc = "A 'freeform' Core AI module: '[newFreeFormLaw]'"
/obj/item/weapon/aiModule/freeformcore/transmitInstructions(var/mob/living/silicon/ai/target, var/mob/sender)
@@ -411,8 +411,8 @@ AI MODULES
/obj/item/weapon/aiModule/syndicate/attack_self(var/mob/user as mob)
..()
var/newlaw = ""
- var/targName = input(usr, "Please enter a new law for the AI.", "Freeform Law Entry", newlaw)
- newFreeFormLaw = sanitize(targName)
+ var/targName = copytext(sanitize(input(usr, "Please enter a new law for the AI.", "Freeform Law Entry", newlaw)),1,MAX_MESSAGE_LEN)
+ newFreeFormLaw = targName
desc = "A hacked AI law module: '[newFreeFormLaw]'"
/obj/item/weapon/aiModule/syndicate/transmitInstructions(var/mob/living/silicon/ai/target, var/mob/sender)
diff --git a/code/game/objects/items/weapons/explosives.dm b/code/game/objects/items/weapons/explosives.dm
index 1548cb45418..662e143920e 100644
--- a/code/game/objects/items/weapons/explosives.dm
+++ b/code/game/objects/items/weapons/explosives.dm
@@ -1,5 +1,7 @@
/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
user << "Timer set for [timer] seconds."
diff --git a/code/game/objects/items/weapons/wrappingpaper.dm b/code/game/objects/items/weapons/wrappingpaper.dm
index 8d3bb9a8495..26046b07dc2 100644
--- a/code/game/objects/items/weapons/wrappingpaper.dm
+++ b/code/game/objects/items/weapons/wrappingpaper.dm
@@ -222,8 +222,7 @@ PHOTOGRAPHS
/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
- n_name = copytext(n_name, 1, 32)
+ var/n_name = copytext(sanitize(input(user, "What would you like to label the photo?", "Paper Labelling", null) as text),1,32)
if ((src.loc == user && user.stat == 0))
src.name = text("photo[]", (n_name ? text("- '[]'", n_name) : null))
src.add_fingerprint(user)
diff --git a/code/game/objects/storage/uplink_kits.dm b/code/game/objects/storage/uplink_kits.dm
new file mode 100644
index 00000000000..b7b053135ec
--- /dev/null
+++ b/code/game/objects/storage/uplink_kits.dm
@@ -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
\ No newline at end of file
diff --git a/code/game/objects/uplinks.dm b/code/game/objects/uplinks.dm
new file mode 100644
index 00000000000..203cbb77bb7
--- /dev/null
+++ b/code/game/objects/uplinks.dm
@@ -0,0 +1,461 @@
+/*
+
+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 = "[src.welcome]
"
+ src.menu_message += "Tele-Crystals left: [src.uses]
"
+ src.menu_message += "
"
+ src.menu_message += "Request item:
"
+ src.menu_message += "Each item costs a number of tele-crystals as indicated by the number following their name.
"
+
+ 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 += "[O[1]]
"
+ 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 += "We apologize, as you could not afford anything from this category.
"
+ src.menu_message += "
"
+ 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 += "[name] ([cost])
"
+ category_items++
+
+// src.menu_message += "Random Item (??)
"
+ src.menu_message += "
"
+ 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/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]
Clear"
+ 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 += "Lock
"
+ dat += "
"
+ dat += "Self-Destruct"
+
+ 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 = "Self-Destruct"
+
+ 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
\ No newline at end of file
diff --git a/code/game/supplyshuttle.dm b/code/game/supplyshuttle.dm
index f481fe8f58f..c601a5582e8 100644
--- a/code/game/supplyshuttle.dm
+++ b/code/game/supplyshuttle.dm
@@ -373,7 +373,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/idname = "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.overlays += "paper_words"
@@ -587,7 +589,7 @@ This method wont take into account storage items developed in the future and doe
supply_shuttle_points -= P.cost
O.object = P
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
src.temp = "Thanks for your order.
"
src.temp += "
OK"
@@ -603,7 +605,7 @@ This method wont take into account storage items developed in the future and doe
supply_shuttle_points -= P.cost
O.object = P
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
src.temp = "Thanks for your order.
"
src.temp += "
OK"
@@ -676,7 +678,7 @@ This method wont take into account storage items developed in the future and doe
if (supply_shuttle_moving) return
if (!supply_can_move())
- usr << "\red The supply shuttle can not transport station employees or homing beacons."
+ usr << "\red The supply shuttle can not transport station employees, exosuits, classified nuclear codes, or homing beacons."
return
var/shuttleat = supply_shuttle_at_station ? SUPPLY_STATION_AREATYPE : SUPPLY_DOCK_AREATYPE
diff --git a/code/modules/admin/admin.dm b/code/modules/admin/admin.dm
index 5305be97577..2b29c7e5ad1 100644
--- a/code/modules/admin/admin.dm
+++ b/code/modules/admin/admin.dm
@@ -968,11 +968,10 @@ var/global/BSACooldown = 0
if ((src.rank in list( "Trial Admin", "Badmin", "Game Admin", "Game Master" )))
var/mob/M = locate(href_list["forcespeech"])
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)
return
M.say(speech)
- speech = copytext(sanitize(speech), 1, MAX_MESSAGE_LEN)
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]")
else
@@ -1883,7 +1882,7 @@ var/global/BSACooldown = 0
if(!ticker)
alert("The game hasn't started yet!")
return
- var/objective = input("Enter an objective")
+ var/objective = copytext(sanitize(input("Enter an objective")),1,MAX_MESSAGE_LEN)
if(!objective)
return
//feedback_inc("admin_secrets_fun_used",1)
diff --git a/code/modules/admin/verbs/striketeam.dm b/code/modules/admin/verbs/striketeam.dm
index 79eb5baec5e..1b526ff5211 100644
--- a/code/modules/admin/verbs/striketeam.dm
+++ b/code/modules/admin/verbs/striketeam.dm
@@ -24,7 +24,7 @@ var/global/sent_strike_team = 0
var/input = null
while(!input)
- input = input(src, "Please specify which mission the death commando squad shall undertake.", "Specify Mission", "") as text|null
+ input = copytext(sanitize(input(src, "Please specify which mission the death commando squad shall undertake.", "Specify Mission", "")),1,MAX_MESSAGE_LEN)
if(!input)
if(alert("Error, no mission set. Do you want to exit the setup process?",,"Yes","No")=="Yes")
return
diff --git a/code/modules/admin/verbs/striketeam_syndicate.dm b/code/modules/admin/verbs/striketeam_syndicate.dm
index 8f4a15d6f72..8f25d8630fb 100644
--- a/code/modules/admin/verbs/striketeam_syndicate.dm
+++ b/code/modules/admin/verbs/striketeam_syndicate.dm
@@ -24,7 +24,7 @@ var/global/sent_syndicate_strike_team = 0
var/input = null
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(alert("Error, no mission set. Do you want to exit the setup process?",,"Yes","No")=="Yes")
return
diff --git a/code/modules/mob/living/carbon/human/emote.dm b/code/modules/mob/living/carbon/human/emote.dm
index 66137de8578..21337db9b32 100644
--- a/code/modules/mob/living/carbon/human/emote.dm
+++ b/code/modules/mob/living/carbon/human/emote.dm
@@ -76,7 +76,7 @@
param = trim(param)
var/input
if(!param)
- input = input("Choose an emote to display.") as text|null
+ input = copytext(sanitize(input("Choose an emote to display.") as text|null),1,MAX_MESSAGE_LEN)
else
input = param
if(input)
diff --git a/code/modules/mob/living/silicon/robot/emote.dm b/code/modules/mob/living/silicon/robot/emote.dm
index d5e7b4514e8..d9c13ba48f8 100644
--- a/code/modules/mob/living/silicon/robot/emote.dm
+++ b/code/modules/mob/living/silicon/robot/emote.dm
@@ -54,10 +54,9 @@
m_type = 2
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)
return
- input = sanitize(input)
var/input2 = input("Is this a visible or hearable emote?") in list("Visible","Hearable")
if (input2 == "Visible")
m_type = 1
diff --git a/code/modules/mob/new_player/preferences.dm b/code/modules/mob/new_player/preferences.dm
index 1e776e3dbb2..97f7f199070 100644
--- a/code/modules/mob/new_player/preferences.dm
+++ b/code/modules/mob/new_player/preferences.dm
@@ -633,16 +633,15 @@ datum/preferences
switch(link_tags["real_name"])
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")
for(var/c in bad_characters)
new_name = dd_replacetext(new_name, c, "")
+
if(!new_name || (new_name == "Unknown") || (new_name == "floor") || (new_name == "wall") || (new_name == "r-wall"))
alert("Invalid name. Don't do that!")
return
- if(length(new_name) >= 26)
- alert("That name is too long.")
- return
+
//Make it so number one. (means you can have names like McMillian). Credit to: Jtgibson
new_name = simple_titlecase(new_name)
/*
@@ -660,8 +659,6 @@ datum/preferences
randomize_name()
if(new_name)
- if(length(new_name) >= 26)
- new_name = copytext(new_name, 1, 26)
real_name = new_name
if(link_tags["age"])
@@ -675,17 +672,9 @@ datum/preferences
if(link_tags["OOC"])
var/tempnote = ""
- tempnote = input(user, "Please enter your OOC Notes!:", "OOC notes" , metadata) as text
- var/list/bad_characters = list("_", "\"", "<", ">", ";", "\[", "\]", "{", "}", "|", "\\","0","1","2","3","4","5","6","7","8","9")
-
- 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
+ tempnote = copytext(sanitize(input(user, "Please enter your OOC Notes!:", "OOC notes" , metadata) as text),1,MAX_MESSAGE_LEN)
+ if(tempnote)
+ metadata = tempnote
return
@@ -757,7 +746,7 @@ datum/preferences
if("random")
randomize_skin_tone()
if("input")
- var/new_tone = input(user, "Please select skin tone level: 1-220 (1=albino, 35=caucasian, 150=black, 220='very' black) or 20-70 for Tajarans", "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) or 20-70 for Tajarans", "Character Generation") as num
if(new_tone)
if(species == "Tajaran")
s_tone = max(min(round(text2num(new_tone)), 70), 20)
@@ -769,6 +758,7 @@ datum/preferences
if(species != "Human")
return
switch(link_tags["h_style"])
+
// New and improved hair selection code, by Doohl
if("random") // random hair selection
diff --git a/code/modules/paperwork/folders.dm b/code/modules/paperwork/folders.dm
index 9ad6a241b26..ba388b2d30e 100644
--- a/code/modules/paperwork/folders.dm
+++ b/code/modules/paperwork/folders.dm
@@ -35,8 +35,7 @@
user << "\blue You put the [W] into the folder."
update_icon()
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
- n_name = copytext(n_name, 1, 32)
+ var/n_name = copytext(sanitize(input(usr, "What would you like to label the folder?", "Folder Labelling", null) as text),1,MAX_NAME_LEN)
if ((loc == usr && usr.stat == 0))
name = "folder[(n_name ? text("- '[n_name]'") : null)]"
return
diff --git a/code/modules/paperwork/handlabeler.dm b/code/modules/paperwork/handlabeler.dm
index 20d59e1e777..72c55adcc44 100644
--- a/code/modules/paperwork/handlabeler.dm
+++ b/code/modules/paperwork/handlabeler.dm
@@ -40,13 +40,10 @@
if(mode)
usr << "\blue You turn on the hand labeler."
//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))
usr << "\red Invalid text."
return
- if(length(str) > 64)
- usr << "\red Text too long."
- return
label = str
usr << "\blue You set the text to '[str]'."
else
diff --git a/code/modules/paperwork/paper.dm b/code/modules/paperwork/paper.dm
index 7504bce6dd1..9a6910be38a 100644
--- a/code/modules/paperwork/paper.dm
+++ b/code/modules/paperwork/paper.dm
@@ -62,7 +62,7 @@
if ((usr.mutations & CLUMSY) && prob(50))
usr << "\red You cut yourself on the paper."
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))
name = "paper[(n_name ? text("- '[n_name]'") : null)]"
diff --git a/code/modules/projectiles/guns/projectile/revolver.dm b/code/modules/projectiles/guns/projectile/revolver.dm
index fada38243e0..98ddff24763 100644
--- a/code/modules/projectiles/guns/projectile/revolver.dm
+++ b/code/modules/projectiles/guns/projectile/revolver.dm
@@ -27,8 +27,7 @@
M << "\red You don't feel cool enough to name this gun, chump."
return 0
- var/input = input("What do you want to name the gun?",,"")
- input = sanitize(input)
+ var/input = copytext(sanitize(input("What do you want to name the gun?",,"")),1,MAX_NAME_LEN)
if(src && input && !M.stat && in_range(M,src))
name = input
diff --git a/code/modules/recycling/sortingmachinery.dm b/code/modules/recycling/sortingmachinery.dm
index c9d2a6860d7..21b05206db0 100755
--- a/code/modules/recycling/sortingmachinery.dm
+++ b/code/modules/recycling/sortingmachinery.dm
@@ -52,26 +52,19 @@
else if(istype(W, /obj/item/weapon/pen))
switch(alert("What would you like to alter?",,"Title","Description", "Cancel"))
if("Title")
- 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))
usr << "\red Invalid text."
return
- if(length(str) > 64)
- usr << "\red Text too long."
- return
- var/label = str
for(var/mob/M in viewers())
- M << "\blue [user] labels [src] as [label]."
- src.name = "[src.name] ([label])"
+ M << "\blue [user] labels [src] as [str]."
+ src.name = "[src.name] ([str])"
update_icon()
if("Description")
- 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))
usr << "\red Invalid text."
return
- if(length(str) > 64)
- usr << "\red Text too long."
- return
examtext = str
for(var/mob/M in viewers())
M << "\blue [user] labels [src] with the note: [examtext]."
@@ -128,26 +121,19 @@
else if(istype(W, /obj/item/weapon/pen))
switch(alert("What would you like to alter?",,"Title","Description", "Cancel"))
if("Title")
- 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))
usr << "\red Invalid text."
return
- if(length(str) > 64)
- usr << "\red Text too long."
- return
- var/label = str
for(var/mob/M in viewers())
- M << "\blue [user] labels [src] as [label]."
- src.name = "[src.name] ([label])"
+ M << "\blue [user] labels [src] as [str]."
+ src.name = "[src.name] ([str])"
update_icon()
if("Description")
- 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))
usr << "\red Invalid text."
return
- if(length(str) > 64)
- usr << "\red Text too long."
- return
examtext = str
for(var/mob/M in viewers())
M << "\blue [user] labels [src] with the note: [examtext]."