Merge pull request #11389 from Kyep/hub_entry_update

Improves Hub Listing
This commit is contained in:
variableundefined
2019-04-30 12:08:32 +08:00
committed by GitHub
4 changed files with 36 additions and 41 deletions
+21 -36
View File
@@ -374,26 +374,28 @@ 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 += "<b>[config.server_name]</b> &#8212; "
s += "<b>[station_name()]</b> "
if(config && config.githuburl)
s+= "([game_version])"
s += "<b>[station_name()]</b>";
s += " ("
s += "<a href=\"http://nanotrasen.se\">" //Change this to wherever you want the hub to link to.
s += "[game_version]"
s += "</a>"
s += ")"
s += "<br>The Perfect Mix of RP & Action<br>"
if(config && config.server_tag_line)
s += "<br>[config.server_tag_line]"
s += "<br>"
var/list/features = list()
if(ticker)
if(master_mode)
if(master_mode && master_mode != "secret")
features += master_mode
else
features += "<b>STARTING</b>"
@@ -401,39 +403,22 @@ 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"
if(config && config.allow_ai)
features += "AI allowed"
if(config && config.wikiurl)
features += "<a href=\"[config.wikiurl]\">Wiki</a>"
var/n = 0
for(var/mob/M in GLOB.player_list)
if(M.client)
n++
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 <b>[host]</b>"
*/
// if(!host && config && config.hostedby)
// features += "hosted by <b>[config.hostedby]</b>"
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