From 0c200c9483e4537ae6756b3e34e4809e65f424ef Mon Sep 17 00:00:00 2001 From: Atermonera Date: Thu, 21 May 2020 11:19:04 -0700 Subject: [PATCH 1/2] Allows you to toggle off Byond/Discord/URLs in OOC --- code/controllers/configuration.dm | 17 +++++++++++++++++ code/game/verbs/ooc.dm | 27 +++++++++++++++++++++++++-- config/example/config.txt | 11 ++++++++++- 3 files changed, 52 insertions(+), 3 deletions(-) diff --git a/code/controllers/configuration.dm b/code/controllers/configuration.dm index 74f46e5bf4..30cd2f9279 100644 --- a/code/controllers/configuration.dm +++ b/code/controllers/configuration.dm @@ -232,7 +232,15 @@ var/list/gamemode_cache = list() var/static/dooc_allowed = 1 var/static/dsay_allowed = 1 +<<<<<<< HEAD var/static/starlight = 0 // Whether space turfs have ambient light or not +======= + var/allow_byond_links = 0 + var/allow_discord_links = 0 + var/allow_url_links = 0 // honestly if I were you i'd leave this one off, only use in dire situations + + var/starlight = 0 // Whether space turfs have ambient light or not +>>>>>>> 3fbc72a... Merge pull request #7206 from GeneriedJenelle/patch-1 var/static/list/ert_species = list(SPECIES_HUMAN) @@ -423,6 +431,15 @@ var/list/gamemode_cache = list() if ("allow_admin_spawning") config.allow_admin_spawning = 1 + + if ("allow_byond_links") + allow_byond_links = 1 + + if ("allow_discord_links") + allow_discord_links = 1 + + if ("allow_url_links") + allow_url_links = 1 if ("no_dead_vote") config.vote_no_dead = 1 diff --git a/code/game/verbs/ooc.dm b/code/game/verbs/ooc.dm index b494e844f4..c408cc54aa 100644 --- a/code/game/verbs/ooc.dm +++ b/code/game/verbs/ooc.dm @@ -29,16 +29,29 @@ if(prefs.muted & MUTE_OOC) to_chat(src, "You cannot use OOC (muted).") return - if(findtext(msg, "byond://")) + if(findtext(msg, "byond://") && !config.allow_byond_links) to_chat(src, "Advertising other servers is not allowed.") log_admin("[key_name(src)] has attempted to advertise in OOC: [msg]") message_admins("[key_name_admin(src)] has attempted to advertise in OOC: [msg]") return +<<<<<<< HEAD //VOREStation Add - No talking during voting if(SSvote && SSvote.mode) to_chat(src, "OOC is not allowed during voting.") return //VOREStation Add End +======= + if(findtext(msg, "discord.gg") && !config.allow_discord_links) + to_chat(src, "Advertising discords is not allowed.") + log_admin("[key_name(src)] has attempted to advertise a discord server in OOC: [msg]") + message_admins("[key_name_admin(src)] has attempted to advertise a discord server in OOC: [msg]") + return + if((findtext(msg, "http://") || findtext(msg, "https://")) && !config.allow_url_links) + to_chat(src, "Posting external links is not allowed.") + log_admin("[key_name(src)] has attempted to post a link in OOC: [msg]") + message_admins("[key_name_admin(src)] has attempted to post a link in OOC: [msg]") + return +>>>>>>> 3fbc72a... Merge pull request #7206 from GeneriedJenelle/patch-1 log_ooc(msg, src) @@ -109,11 +122,21 @@ if(prefs.muted & MUTE_OOC) to_chat(src, "You cannot use OOC (muted).") return - if(findtext(msg, "byond://")) + if(findtext(msg, "byond://") && !config.allow_byond_links) to_chat(src, "Advertising other servers is not allowed.") log_admin("[key_name(src)] has attempted to advertise in OOC: [msg]") message_admins("[key_name_admin(src)] has attempted to advertise in OOC: [msg]") return + if(findtext(msg, "discord.gg") && !config.allow_discord_links) + to_chat(src, "Advertising discords is not allowed.") + log_admin("[key_name(src)] has attempted to advertise a discord server in OOC: [msg]") + message_admins("[key_name_admin(src)] has attempted to advertise a discord server in OOC: [msg]") + return + if((findtext(msg, "http://") || findtext(msg, "https://")) && !config.allow_url_links) + to_chat(src, "Posting external links is not allowed.") + log_admin("[key_name(src)] has attempted to post a link in OOC: [msg]") + message_admins("[key_name_admin(src)] has attempted to post a link in OOC: [msg]") + return log_looc(msg,src) diff --git a/config/example/config.txt b/config/example/config.txt index ff0340bcea..a39790d2e2 100644 --- a/config/example/config.txt +++ b/config/example/config.txt @@ -532,6 +532,15 @@ SQLITE_FEEDBACK_MIN_AGE 7 ## Comment this out if you don't want to use the 'nightshift lighting' subsystem to adjust lights based on ingame time ENABLE_NIGHT_SHIFTS +<<<<<<< HEAD ## Comment this out to enable playtime restrictions for jobs in their respective departments (mostly for heads) -# USE_PLAYTIME_RESTRICTION_FOR_JOBS \ No newline at end of file +# USE_PLAYTIME_RESTRICTION_FOR_JOBS +======= +## OOC/LOOC control ## + +# Uncomment to allow links of the following kinds. # +# ALLOW_BYOND_LINKS +# ALLOW_DISCORD_LINKS +ALLOW_URL_LINKS +>>>>>>> 3fbc72a... Merge pull request #7206 from GeneriedJenelle/patch-1 From 62c3bdd2e7254d9575a21ff63bfb74864efa5111 Mon Sep 17 00:00:00 2001 From: Aronai Sieyes Date: Thu, 21 May 2020 15:43:40 -0400 Subject: [PATCH 2/2] Merge upstream PR --- code/controllers/configuration.dm | 4 ---- code/game/verbs/ooc.dm | 3 --- config/example/config.txt | 5 +---- 3 files changed, 1 insertion(+), 11 deletions(-) diff --git a/code/controllers/configuration.dm b/code/controllers/configuration.dm index 30cd2f9279..8a3b7c560b 100644 --- a/code/controllers/configuration.dm +++ b/code/controllers/configuration.dm @@ -232,15 +232,11 @@ var/list/gamemode_cache = list() var/static/dooc_allowed = 1 var/static/dsay_allowed = 1 -<<<<<<< HEAD - var/static/starlight = 0 // Whether space turfs have ambient light or not -======= var/allow_byond_links = 0 var/allow_discord_links = 0 var/allow_url_links = 0 // honestly if I were you i'd leave this one off, only use in dire situations var/starlight = 0 // Whether space turfs have ambient light or not ->>>>>>> 3fbc72a... Merge pull request #7206 from GeneriedJenelle/patch-1 var/static/list/ert_species = list(SPECIES_HUMAN) diff --git a/code/game/verbs/ooc.dm b/code/game/verbs/ooc.dm index c408cc54aa..4ee0213f8f 100644 --- a/code/game/verbs/ooc.dm +++ b/code/game/verbs/ooc.dm @@ -34,13 +34,11 @@ log_admin("[key_name(src)] has attempted to advertise in OOC: [msg]") message_admins("[key_name_admin(src)] has attempted to advertise in OOC: [msg]") return -<<<<<<< HEAD //VOREStation Add - No talking during voting if(SSvote && SSvote.mode) to_chat(src, "OOC is not allowed during voting.") return //VOREStation Add End -======= if(findtext(msg, "discord.gg") && !config.allow_discord_links) to_chat(src, "Advertising discords is not allowed.") log_admin("[key_name(src)] has attempted to advertise a discord server in OOC: [msg]") @@ -51,7 +49,6 @@ log_admin("[key_name(src)] has attempted to post a link in OOC: [msg]") message_admins("[key_name_admin(src)] has attempted to post a link in OOC: [msg]") return ->>>>>>> 3fbc72a... Merge pull request #7206 from GeneriedJenelle/patch-1 log_ooc(msg, src) diff --git a/config/example/config.txt b/config/example/config.txt index a39790d2e2..713d741b17 100644 --- a/config/example/config.txt +++ b/config/example/config.txt @@ -532,15 +532,12 @@ SQLITE_FEEDBACK_MIN_AGE 7 ## Comment this out if you don't want to use the 'nightshift lighting' subsystem to adjust lights based on ingame time ENABLE_NIGHT_SHIFTS -<<<<<<< HEAD ## Comment this out to enable playtime restrictions for jobs in their respective departments (mostly for heads) # USE_PLAYTIME_RESTRICTION_FOR_JOBS -======= -## OOC/LOOC control ## +## OOC/LOOC control ## # Uncomment to allow links of the following kinds. # # ALLOW_BYOND_LINKS # ALLOW_DISCORD_LINKS ALLOW_URL_LINKS ->>>>>>> 3fbc72a... Merge pull request #7206 from GeneriedJenelle/patch-1