URL configuration

This commit is contained in:
AffectedArc07
2021-05-16 21:14:10 +01:00
parent 400a25dc01
commit 8dd5dfbf7f
41 changed files with 150 additions and 144 deletions
+1 -60
View File
@@ -6,14 +6,11 @@
var/minimum_client_build = 1421 // Build 1421 due to the middle mouse button exploit
var/nudge_script_path = "nudge.py" // where the nudge.py script is located
var/pregame_timestart = 240 // Time it takes for the server to start the game
// var/enable_authentication = 0 // goon authentication
var/allow_Metadata = 0 // Metadata is supported.
var/popup_admin_pm = 0 //adminPMs to non-admins show in a pop-up 'reply' window when set to 1.
var/list/resource_urls = null
var/antag_hud_allowed = 0 // Ghosts can turn on Antagovision to see a HUD of who is the bad guys this round.
var/antag_hud_restricted = 0 // Ghosts that turn on Antagovision cannot rejoin the round.
@@ -21,7 +18,6 @@
var/guest_jobban = 1
var/panic_bunker_threshold = 150 // above this player count threshold, never-before-seen players are blocked from connecting
var/usewhitelist = 0
var/mods_are_mentors = 0
var/automute_on = 0 //enables automuting/spam prevention
var/round_abandon_penalty_period = 30 MINUTES // Time from round start during which ghosting out is penalized
@@ -35,16 +31,6 @@
var/allow_drone_spawn = 1 //assuming the admin allow them to.
var/drone_build_time = 1200 //A drone will become available every X ticks since last drone spawn. Default is 2 minutes.
var/server
var/banappeals
var/wikiurl = "http://example.org"
var/forumurl = "http://example.org"
var/rulesurl = "http://example.org"
var/githuburl = "http://example.org"
var/donationsurl = "http://example.org"
var/discordurl = "http://example.org"
var/discordforumurl = "http://example.org"
var/forbid_singulo_possession = 0
var/check_randomizer = 0
@@ -84,9 +70,6 @@
var/ipintel_whitelist = 0
var/ipintel_detailsurl = "https://iphub.info/?ip="
var/forum_link_url
var/forum_playerinfo_url
var/ban_legacy_system = 0 //Defines whether the server uses the legacy banning system with the files in /data or the SQL system. Config option in config.txt
var/simultaneous_pm_warning_timeout = 100
@@ -129,8 +112,6 @@
/// BYOND account age limit for notifcations of new accounts (Any accounts older than this value will not send notifications on first join)
var/byond_account_age_threshold = 7
/// URL for the CentCom Ban DB API
var/centcom_ban_db_url = null
/// Max amount of CIDs that one ckey can have attached to them before they trip a warning
var/max_client_cid_history = 3
@@ -170,9 +151,6 @@
if(type == "config")
switch(name)
if("resource_urls")
config.resource_urls = splittext(value, " ")
if("ban_legacy_system")
config.ban_legacy_system = 1
@@ -200,12 +178,6 @@
if("ipintel_detailsurl")
config.ipintel_detailsurl = value
if("forum_link_url")
config.forum_link_url = value
if("forum_playerinfo_url")
config.forum_playerinfo_url = value
if("pregame_timestart")
config.pregame_timestart = text2num(value)
@@ -227,36 +199,6 @@
if("minimum_client_build")
config.minimum_client_build = text2num(value)
if("nudge_script_path")
config.nudge_script_path = value
if("server")
config.server = value
if("banappeals")
config.banappeals = value
if("wikiurl")
config.wikiurl = value
if("forumurl")
config.forumurl = value
if("rulesurl")
config.rulesurl = value
if("githuburl")
config.githuburl = value
if("discordurl")
config.discordurl = value
if("discordforumurl")
config.discordforumurl = value
if("donationsurl")
config.donationsurl = value
if("guest_ban")
#warn AA clear this up
GLOB.guests_allowed = 0
@@ -331,8 +273,7 @@
config.developer_express_start = 1
if("byond_account_age_threshold")
config.byond_account_age_threshold = text2num(value)
if("centcom_ban_db_url")
centcom_ban_db_url = value
if("max_client_cid_history")
max_client_cid_history = text2num(value)
if("enable_auto_profiler")
@@ -33,6 +33,8 @@ GLOBAL_DATUM_INIT(configuration, /datum/server_configuration, new())
var/datum/configuration_section/ruin_configuration/ruins
/// Holder for the system configuration datum
var/datum/configuration_section/system_configuration/system
/// Holder for the URL configuration datum
var/datum/configuration_section/url_configuration/url
/// Holder for the voting configuration datum
var/datum/configuration_section/vote_configuration/vote
@@ -63,6 +65,7 @@ GLOBAL_DATUM_INIT(configuration, /datum/server_configuration, new())
overflow = new()
ruins = new()
system = new()
url = new()
vote = new()
// Load our stuff up
@@ -87,6 +90,7 @@ GLOBAL_DATUM_INIT(configuration, /datum/server_configuration, new())
overflow.load_data(raw_config_data["overflow_configuration"])
ruins.load_data(raw_config_data["ruin_configuration"])
system.load_data(raw_config_data["system_configuration"])
url.load_data(raw_config_data["url_configuration"])
vote.load_data(raw_config_data["voting_configuration"])
// And report the load
@@ -0,0 +1,47 @@
/// Config holder for all the server URLs
/datum/configuration_section/url_configuration
// Dont tweak these. You can read them though.
protection_state = PROTECTION_READONLY
/// List of URLs for the server RSC data
var/list/rsc_urls = list()
/// Server URL for auto-reconnecting people at end round
var/server_url
/// URL for the server ban appeals forum
var/banappeals_url
/// URL for the server wiki
var/wiki_url
/// URL for the server forums
var/forum_url
/// URL for the server rules
var/rules_url
/// URL for the server github repository
var/github_url
/// URL for server donations
var/donations_url
/// URL for a direct discord invite
var/discord_url
/// URL for a discord invite going via the forums
var/discord_forum_url
/// URL for linking ingame accounts and forum accounts. Token is appended to end
var/forum_link_url
/// URL for pulling player info on webtools
var/forum_playerinfo_url
/// URL for the CentCom Ban DB API
var/centcom_ban_db_url
/datum/configuration_section/url_configuration/load_data(list/data)
// Use the load wrappers here. That way the default isnt made 'null' if you comment out the config line
CONFIG_LOAD_LIST(rsc_urls, data["rsc_urls"])
CONFIG_LOAD_STR(server_url, data["reboot_url"])
CONFIG_LOAD_STR(banappeals_url, data["ban_appeals_url"])
CONFIG_LOAD_STR(wiki_url, data["wiki_url"])
CONFIG_LOAD_STR(forum_url, data["forum_url"])
CONFIG_LOAD_STR(rules_url, data["rules_url"])
CONFIG_LOAD_STR(github_url, data["github_url"])
CONFIG_LOAD_STR(donations_url, data["donations_url"])
CONFIG_LOAD_STR(discord_url, data["discord_url"])
CONFIG_LOAD_STR(discord_forum_url, data["discord_forum_url"])
CONFIG_LOAD_STR(forum_link_url, data["forum_link_url"])
CONFIG_LOAD_STR(forum_playerinfo_url, data["forum_playerinfo_url"])
CONFIG_LOAD_STR(centcom_ban_db_url, data["centcomm_ban_db_url"])
+2 -2
View File
@@ -266,11 +266,11 @@ SUBSYSTEM_DEF(changelog)
usr.client.github()
// Takes a PR number as argument
if(href_list["openPR"])
if(config.githuburl)
if(GLOB?.configuration?.url.github_url)
if(alert("This will open PR #[href_list["openPR"]] in your browser. Are you sure?",,"Yes","No")=="No")
return
// If the github URL in the config has a trailing slash, it doesnt matter here, thankfully github accepts having a double slash: https://github.com/org/repo//pull/1
var/url = "[config.githuburl]/pull/[href_list["openPR"]]"
var/url = "[GLOB?.configuration?.url.github_url]/pull/[href_list["openPR"]]"
usr << link(url)
else
to_chat(usr, "<span class='danger'>The GitHub URL is not set in the server configuration. PRs cannot be opened from changelog view. Please inform the server host.</span>")
@@ -214,14 +214,18 @@ SUBSYSTEM_DEF(tickets)
"Already Resolved" = "The problem has been resolved already.",
"Mentorhelp" = "Please redirect your question to Mentorhelp, as they are better experienced with these types of questions.",
"Happens Again" = "Thanks, let us know if it continues to happen.",
"Github Issue Report" = "To report a bug, please go to our <a href='[config.githuburl]'>Github page</a>. Then go to 'Issues'. Then 'New Issue'. Then fill out the report form. If the report would reveal current-round information, file it after the round ends.",
"Clear Cache" = "To fix a blank screen, go to the 'Special Verbs' tab and press 'Reload UI Resources'. If that fails, clear your BYOND cache (instructions provided with 'Reload UI Resources'). If that still fails, please adminhelp again, stating you have already done the following." ,
"IC Issue" = "This is an In Character (IC) issue and will not be handled by admins. You could speak to Security, Internal Affairs, a Departmental Head, Nanotrasen Representetive, or any other relevant authority currently on station.",
"Reject" = "Reject",
"Man Up" = "Man Up",
"Appeal on the Forums" = "Appealing a ban must occur on the forums. Privately messaging, or adminhelping about your ban will not resolve it. To appeal your ban, please head to <a href='[config.banappeals]'>[config.banappeals]</a>"
)
if(GLOB?.configuration?.url.banappeals_url)
response_phrases["Appeal on the Forums"] = "Appealing a ban must occur on the forums. Privately messaging, or adminhelping about your ban will not resolve it. To appeal your ban, please head to <a href='[GLOB.configuration.url.banappeals_url]'>[GLOB.configuration.url.banappeals_url]</a>"
if(GLOB?.configuration?.url.github_url)
response_phrases["Github Issue Report"] = "To report a bug, please go to our <a href='[GLOB.configuration.url.github_url]'>Github page</a>. Then go to 'Issues'. Then 'New Issue'. Then fill out the report form. If the report would reveal current-round information, file it after the round ends."
var/sorted_responses = list()
for(var/key in response_phrases) //build a new list based on the short descriptive keys of the master list so we can send this as the input instead of the full paragraphs to the admin choosing which autoresponse
sorted_responses += key