From 9bd40ef6f637c1e4af119a96bb56b1e6fc0c44c0 Mon Sep 17 00:00:00 2001 From: Kyep Date: Fri, 26 Apr 2019 17:54:11 -0700 Subject: [PATCH 1/3] improves hub entry --- code/controllers/configuration.dm | 20 ++++++---- code/game/world.dm | 64 +++++++++++++++---------------- config/example/config.txt | 6 +++ 3 files changed, 49 insertions(+), 41 deletions(-) diff --git a/code/controllers/configuration.dm b/code/controllers/configuration.dm index 01cf57aad9e..4570eeee37c 100644 --- a/code/controllers/configuration.dm +++ b/code/controllers/configuration.dm @@ -1,5 +1,7 @@ /datum/configuration var/server_name = null // server name (for world name / status) + var/server_tag_line = null // server tagline (for showing on hub entry) + var/server_extra_features = null // server-specific extra features (for hub entry) var/server_suffix = 0 // generate numeric suffix based on server port var/minimum_client_build = 1421 // Build 1421 due to the middle mouse button exploit @@ -53,7 +55,6 @@ var/humans_need_surnames = 0 var/allow_random_events = 0 // enables random events mid-round when set to 1 var/allow_ai = 1 // allow ai job - var/hostedby = null var/respawn = 0 var/guest_jobban = 1 var/usewhitelist = 0 @@ -213,7 +214,7 @@ // Automatic localhost admin disable var/disable_localhost_admin = 0 - + //Start now warning var/start_now_confirmation = 0 @@ -358,10 +359,10 @@ if("no_dead_vote") config.vote_no_dead = 1 - + if("vote_autotransfer_initial") config.vote_autotransfer_initial = text2num(value) - + if("vote_autotransfer_interval") config.vote_autotransfer_interval = text2num(value) @@ -386,6 +387,12 @@ if("servername") config.server_name = value + if("server_tag_line") + config.server_tag_line = value + + if("server_extra_features") + config.server_extra_features = value + if("serversuffix") config.server_suffix = 1 @@ -395,9 +402,6 @@ if("nudge_script_path") config.nudge_script_path = value - if("hostedby") - config.hostedby = value - if("server") config.server = value @@ -645,7 +649,7 @@ if("disable_karma") config.disable_karma = 1 - + if("start_now_confirmation") config.start_now_confirmation = 1 diff --git a/code/game/world.dm b/code/game/world.dm index 4681f46498a..ce803719647 100644 --- a/code/game/world.dm +++ b/code/game/world.dm @@ -374,26 +374,34 @@ var/world_topic_spam_protect_time = world.timeofday // apply some settings from config.. /world/proc/update_status() + status = get_status_text() + +/proc/get_world_status_text() + return world.get_status_text() + +/world/proc/get_status_text() var/s = "" if(config && config.server_name) s += "[config.server_name] — " + s += "[station_name()] " + if(config && config.githuburl) + s+= "([game_version])" - s += "[station_name()]"; - s += " (" - s += "" //Change this to wherever you want the hub to link to. - s += "[game_version]" - s += "" - s += ")" - s += "
The Perfect Mix of RP & Action
" - - - + if(config && config.server_tag_line) + s += "
[config.server_tag_line]" + s += "
" var/list/features = list() + var/n = GLOB.clients.len + if(n > 1) + features += "~[n] players" + else if(n > 0) + features += "~[n] player" + if(ticker) - if(master_mode) + if(master_mode && master_mode != "secret") features += master_mode else features += "STARTING" @@ -401,7 +409,8 @@ var/world_topic_spam_protect_time = world.timeofday if(!enter_allowed) features += "closed" - features += abandon_allowed ? "respawn" : "no respawn" + if(config && config.server_extra_features) + features += config.server_extra_features if(config && config.allow_vote_mode) features += "vote" @@ -409,31 +418,20 @@ var/world_topic_spam_protect_time = world.timeofday if(config && config.allow_ai) features += "AI allowed" - var/n = 0 - for(var/mob/M in GLOB.player_list) - if(M.client) - n++ + if(config && config.forumurl) + features += "Forum" + if(config && config.discordurl) + features += "Discord" + if(config && config.wikiurl) + features += "Wiki" - if(n > 1) - features += "~[n] players" - else if(n > 0) - features += "~[n] player" - - /* - is there a reason for this? the byond site shows 'hosted by X' when there is a proper host already. - if(host) - features += "hosted by [host]" - */ - -// if(!host && config && config.hostedby) -// features += "hosted by [config.hostedby]" + if(abandon_allowed) + features += "respawn" if(features) - s += ": [jointext(features, ", ")]" + s += "[jointext(features, ", ")]" - /* does this help? I do not know */ - if(src.status != s) - src.status = s + return s #define FAILED_DB_CONNECTION_CUTOFF 5 var/failed_db_connections = 0 diff --git a/config/example/config.txt b/config/example/config.txt index d93809c32cd..75c51322dfa 100644 --- a/config/example/config.txt +++ b/config/example/config.txt @@ -1,6 +1,12 @@ ## Server name: This appears at the top of the screen in-game. In this case it will read "spacestation13: station_name" where station_name is the randomly generated name of the station for the round. Remove the # infront of SERVERNAME and replace 'spacestation13' with the name of your choice # SERVERNAME spacestation13 +## Server tagline: This appears on the hub entry. +# SERVER_TAG_LINE The Perfect Mix of RP & Action + +## Server extra features: This appears in the feature list on the hub entry. +# SERVER_EXTRA_FEATURES fun + ## Add a # infront of this if you want to use the SQL based admin system, the legacy system uses admins.txt. You need to set up your database to use the SQL based system. ADMIN_LEGACY_SYSTEM From 6e145e208f6ff528024b72d16312c9ad53c13c6f Mon Sep 17 00:00:00 2001 From: Kyep Date: Mon, 29 Apr 2019 17:34:06 -0700 Subject: [PATCH 2/3] save space, 'paracode', let byond handle playercount, -discord/-forum --- code/_globalvars/configuration.dm | 2 +- code/game/world.dm | 15 +-------------- config/example/config.txt | 2 +- 3 files changed, 3 insertions(+), 16 deletions(-) diff --git a/code/_globalvars/configuration.dm b/code/_globalvars/configuration.dm index 1e35e150a25..6dc18d4fdff 100644 --- a/code/_globalvars/configuration.dm +++ b/code/_globalvars/configuration.dm @@ -3,7 +3,7 @@ var/datum/configuration/config = null var/host = null var/join_motd = null GLOBAL_VAR(join_tos) -var/game_version = "Custom ParaCode" +var/game_version = "ParaCode" var/changelog_hash = md5('html/changelog.html') //used to check if the CL changed var/game_year = (text2num(time2text(world.realtime, "YYYY")) + 544) diff --git a/code/game/world.dm b/code/game/world.dm index ce803719647..86ca6d883bd 100644 --- a/code/game/world.dm +++ b/code/game/world.dm @@ -386,7 +386,7 @@ var/world_topic_spam_protect_time = world.timeofday s += "[config.server_name] — " s += "[station_name()] " if(config && config.githuburl) - s+= "([game_version])" + s+= "([game_version])" if(config && config.server_tag_line) s += "
[config.server_tag_line]" @@ -394,12 +394,6 @@ var/world_topic_spam_protect_time = world.timeofday s += "
" var/list/features = list() - var/n = GLOB.clients.len - if(n > 1) - features += "~[n] players" - else if(n > 0) - features += "~[n] player" - if(ticker) if(master_mode && master_mode != "secret") features += master_mode @@ -415,13 +409,6 @@ var/world_topic_spam_protect_time = world.timeofday if(config && config.allow_vote_mode) features += "vote" - if(config && config.allow_ai) - features += "AI allowed" - - if(config && config.forumurl) - features += "Forum" - if(config && config.discordurl) - features += "Discord" if(config && config.wikiurl) features += "Wiki" diff --git a/config/example/config.txt b/config/example/config.txt index 75c51322dfa..7c87be811fe 100644 --- a/config/example/config.txt +++ b/config/example/config.txt @@ -2,7 +2,7 @@ # SERVERNAME spacestation13 ## Server tagline: This appears on the hub entry. -# SERVER_TAG_LINE The Perfect Mix of RP & Action +# SERVER_EXTRA_FEATURES medium RP, varied species/jobs/modes ## Server extra features: This appears in the feature list on the hub entry. # SERVER_EXTRA_FEATURES fun From ebf807863f22f91c9c8e869b5580ebaf2ac6c168 Mon Sep 17 00:00:00 2001 From: Kyep Date: Mon, 29 Apr 2019 20:49:52 -0700 Subject: [PATCH 3/3] changed defaults --- config/example/config.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config/example/config.txt b/config/example/config.txt index 7c87be811fe..845f4c5bae2 100644 --- a/config/example/config.txt +++ b/config/example/config.txt @@ -2,10 +2,10 @@ # SERVERNAME spacestation13 ## Server tagline: This appears on the hub entry. -# SERVER_EXTRA_FEATURES medium RP, varied species/jobs/modes +#SERVER_TAG_LINE The Perfect Mix of RP & Action ## Server extra features: This appears in the feature list on the hub entry. -# SERVER_EXTRA_FEATURES fun +#SERVER_EXTRA_FEATURES medium RP, varied species/jobs/modes ## Add a # infront of this if you want to use the SQL based admin system, the legacy system uses admins.txt. You need to set up your database to use the SQL based system. ADMIN_LEGACY_SYSTEM