From d395d654b22a15860652953bf0376447d33cd645 Mon Sep 17 00:00:00 2001 From: Yoshax Date: Mon, 27 Jun 2016 03:56:12 +0100 Subject: [PATCH 1/2] Increases max record and book length to higher levels --- code/__defines/misc.dm | 4 +-- html/changelogs/yoshax - snowflakes.yml | 36 +++++++++++++++++++++++++ 2 files changed, 38 insertions(+), 2 deletions(-) create mode 100644 html/changelogs/yoshax - snowflakes.yml diff --git a/code/__defines/misc.dm b/code/__defines/misc.dm index 0a067439939..dc749162d30 100644 --- a/code/__defines/misc.dm +++ b/code/__defines/misc.dm @@ -91,8 +91,8 @@ // Setting this much higher than 1024 could allow spammers to DOS the server easily. #define MAX_MESSAGE_LEN 1024 -#define MAX_PAPER_MESSAGE_LEN 6144 -#define MAX_BOOK_MESSAGE_LEN 12288 +#define MAX_PAPER_MESSAGE_LEN 24576 +#define MAX_BOOK_MESSAGE_LEN 24576 #define MAX_LNAME_LEN 64 #define MAX_NAME_LEN 52 diff --git a/html/changelogs/yoshax - snowflakes.yml b/html/changelogs/yoshax - snowflakes.yml new file mode 100644 index 00000000000..169ace483f4 --- /dev/null +++ b/html/changelogs/yoshax - snowflakes.yml @@ -0,0 +1,36 @@ +################################ +# Example Changelog File +# +# Note: This file, and files beginning with ".", and files that don't end in ".yml" will not be read. If you change this file, you will look really dumb. +# +# Your changelog will be merged with a master changelog. (New stuff added only, and only on the date entry for the day it was merged.) +# When it is, any changes listed below will disappear. +# +# Valid Prefixes: +# bugfix +# wip (For works in progress) +# tweak +# soundadd +# sounddel +# rscadd (general adding of nice things) +# rscdel (general deleting of nice things) +# imageadd +# imagedel +# maptweak +# spellcheck (typo fixes) +# experiment +################################# + +# Your name. +author: Yosh + +# Optional: Remove this file after generating master changelog. Useful for PR changelogs that won't get used again. +delete-after: True + +# Any changes you've made. See valid prefix list above. +# INDENT WITH TWO SPACES. NOT TABS. SPACES. +# SCREW THIS UP AND IT WON'T WORK. +# Also, all entries are changed into a single [] after a master changelog generation. Just remove the brackets when you add new entries. +# Please surround your changes in double quotes ("), as certain characters otherwise screws up compiling. The quotes will not show up in the changelog. +changes: + - tweaks: "Increases max records and book length to ridiculous levels." \ No newline at end of file From 38200a3e20e4d425ef68f66ec824507175cb086c Mon Sep 17 00:00:00 2001 From: Yoshax Date: Mon, 27 Jun 2016 16:26:31 +0100 Subject: [PATCH 2/2] Introduces max record length for record, converts uses of max book length to max paper length barring books --- code/__defines/misc.dm | 3 ++- code/modules/admin/verbs/custom_event.dm | 2 +- code/modules/client/preference_setup/antagonism/01_basic.dm | 2 +- .../client/preference_setup/general/05_background.dm | 6 +++--- code/modules/games/cards.dm | 2 +- 5 files changed, 8 insertions(+), 7 deletions(-) diff --git a/code/__defines/misc.dm b/code/__defines/misc.dm index dc749162d30..5c5dba3c342 100644 --- a/code/__defines/misc.dm +++ b/code/__defines/misc.dm @@ -91,8 +91,9 @@ // Setting this much higher than 1024 could allow spammers to DOS the server easily. #define MAX_MESSAGE_LEN 1024 -#define MAX_PAPER_MESSAGE_LEN 24576 +#define MAX_PAPER_MESSAGE_LEN 6144 #define MAX_BOOK_MESSAGE_LEN 24576 +#define MAX_RECORD_LENGTH 24576 #define MAX_LNAME_LEN 64 #define MAX_NAME_LEN 52 diff --git a/code/modules/admin/verbs/custom_event.dm b/code/modules/admin/verbs/custom_event.dm index 265c16a8689..35931f8e545 100644 --- a/code/modules/admin/verbs/custom_event.dm +++ b/code/modules/admin/verbs/custom_event.dm @@ -7,7 +7,7 @@ src << "Only administrators may use this command." return - var/input = sanitize(input(usr, "Enter the description of the custom event. Be descriptive. To cancel the event, make this blank or hit cancel.", "Custom Event", custom_event_msg) as message|null, MAX_BOOK_MESSAGE_LEN, extra = 0) + var/input = sanitize(input(usr, "Enter the description of the custom event. Be descriptive. To cancel the event, make this blank or hit cancel.", "Custom Event", custom_event_msg) as message|null, MAX_PAPER_MESSAGE_LEN, extra = 0) if(!input || input == "") custom_event_msg = null log_admin("[usr.key] has cleared the custom event text.") diff --git a/code/modules/client/preference_setup/antagonism/01_basic.dm b/code/modules/client/preference_setup/antagonism/01_basic.dm index 5b0be7bb71f..af9c22c99b9 100644 --- a/code/modules/client/preference_setup/antagonism/01_basic.dm +++ b/code/modules/client/preference_setup/antagonism/01_basic.dm @@ -34,7 +34,7 @@ var/global/list/uplink_locations = list("PDA", "Headset", "None") return TOPIC_REFRESH if(href_list["exploitable_record"]) - var/exploitmsg = sanitize(input(user,"Set exploitable information about you here.","Exploitable Information", html_decode(pref.exploit_record)) as message|null, MAX_PAPER_MESSAGE_LEN, extra = 0) + var/exploitmsg = sanitize(input(user,"Set exploitable information about you here.","Exploitable Information", html_decode(pref.exploit_record)) as message|null, MAX_RECORD_LENGTH, extra = 0) if(!isnull(exploitmsg) && !jobban_isbanned(user, "Records") && CanUseTopic(user)) pref.exploit_record = exploitmsg return TOPIC_REFRESH diff --git a/code/modules/client/preference_setup/general/05_background.dm b/code/modules/client/preference_setup/general/05_background.dm index e3076629a8e..c36ce858340 100644 --- a/code/modules/client/preference_setup/general/05_background.dm +++ b/code/modules/client/preference_setup/general/05_background.dm @@ -115,19 +115,19 @@ return TOPIC_REFRESH else if(href_list["set_medical_records"]) - var/new_medical = sanitize(input(user,"Enter medical information here.","Character Preference", html_decode(pref.med_record)) as message|null, MAX_PAPER_MESSAGE_LEN, extra = 0) + var/new_medical = sanitize(input(user,"Enter medical information here.","Character Preference", html_decode(pref.med_record)) as message|null, MAX_RECORD_LENGTH, extra = 0) if(!isnull(new_medical) && !jobban_isbanned(user, "Records") && CanUseTopic(user)) pref.med_record = new_medical return TOPIC_REFRESH else if(href_list["set_general_records"]) - var/new_general = sanitize(input(user,"Enter employment information here.","Character Preference", html_decode(pref.gen_record)) as message|null, MAX_PAPER_MESSAGE_LEN, extra = 0) + var/new_general = sanitize(input(user,"Enter employment information here.","Character Preference", html_decode(pref.gen_record)) as message|null, MAX_RECORD_LENGTH, extra = 0) if(!isnull(new_general) && !jobban_isbanned(user, "Records") && CanUseTopic(user)) pref.gen_record = new_general return TOPIC_REFRESH else if(href_list["set_security_records"]) - var/sec_medical = sanitize(input(user,"Enter security information here.","Character Preference", html_decode(pref.sec_record)) as message|null, MAX_PAPER_MESSAGE_LEN, extra = 0) + var/sec_medical = sanitize(input(user,"Enter security information here.","Character Preference", html_decode(pref.sec_record)) as message|null, MAX_RECORD_LENGTH, extra = 0) if(!isnull(sec_medical) && !jobban_isbanned(user, "Records") && CanUseTopic(user)) pref.sec_record = sec_medical return TOPIC_REFRESH diff --git a/code/modules/games/cards.dm b/code/modules/games/cards.dm index 1b353e34071..3fcf07713b3 100644 --- a/code/modules/games/cards.dm +++ b/code/modules/games/cards.dm @@ -134,7 +134,7 @@ if(P.name != "Blank Card") user << "You cannot write on that card." return - var/cardtext = sanitize(input(user, "What do you wish to write on the card?", "Card Editing") as text|null, MAX_BOOK_MESSAGE_LEN) + var/cardtext = sanitize(input(user, "What do you wish to write on the card?", "Card Editing") as text|null, MAX_PAPER_MESSAGE_LEN) if(!cardtext) return P.name = cardtext