diff --git a/code/controllers/configuration.dm b/code/controllers/configuration.dm index d1aa9c69a4..042d6e22d4 100644 --- a/code/controllers/configuration.dm +++ b/code/controllers/configuration.dm @@ -88,6 +88,8 @@ var/global/list/gamemode_cache = list() var/static/automute_on = 0 //enables automuting/spam prevention var/static/jobs_have_minimal_access = 0 //determines whether jobs use minimal access or expanded access. + var/static/hub_visible = FALSE + var/cult_ghostwriter = 1 //Allows ghosts to write in blood in cult rounds... var/cult_ghostwriter_req_cultists = 10 //...so long as this many cultists are active. @@ -365,6 +367,9 @@ var/global/list/gamemode_cache = list() if ("log_ooc") config.log_ooc = 1 + if ("hub_visible") + config.hub_visible = TRUE + if ("log_access") config.log_access = 1 diff --git a/code/game/world.dm b/code/game/world.dm index 00c0f99a41..f1f09088fc 100644 --- a/code/game/world.dm +++ b/code/game/world.dm @@ -10,13 +10,13 @@ config.post_load() - if(config && config.server_name != null && config.server_suffix && world.port > 0) - // dumb and hardcoded but I don't care~ - config.server_name += " #[(world.port % 1000) / 100]" - - if(config && config.log_runtime) + if (config.server_name) + name = config.server_name + if (config.log_runtime) log = file("data/logs/runtime/[time2text(world.realtime,"YYYY-MM-DD-(hh-mm-ss)")]-runtime.log") + update_hub_visibility(config.hub_visible) + GLOB.timezoneOffset = get_timezone_offset() callHook("startup") diff --git a/code/hub.dm b/code/hub.dm index 9bd4fae1d8..c51d60e11a 100644 --- a/code/hub.dm +++ b/code/hub.dm @@ -1,15 +1,12 @@ /world - hub = "Exadv1.spacestation13" - //hub_password = "SORRYNOPASSWORD" - hub_password = "kMZy3U5jJHSiBQjr" name = "Space Station 13" -/* This is for any host that would like their server to appear on the main SS13 hub. -To use it, simply replace the password above, with the password found below, and it should work. -If not, let us know on the main tgstation IRC channel of irc.rizon.net #tgstation13 we can help you there. - - hub = "Exadv1.spacestation13" - hub_password = "kMZy3U5jJHSiBQjr" - name = "Space Station 13" -*/ +/world/proc/update_hub_visibility(new_status) + if (isnull(new_status)) + new_status = !config.hub_visible + config.hub_visible = new_status + if (config.hub_visible) + hub_password = "kMZy3U5jJHSiBQjr" + else + hub_password = "SORRYNOPASSWORD" diff --git a/code/modules/admin/admin.dm b/code/modules/admin/admin.dm index 7e5c97e214..4ff5544539 100644 --- a/code/modules/admin/admin.dm +++ b/code/modules/admin/admin.dm @@ -1652,3 +1652,16 @@ var/global/floorIsLava = 0 qdel(P) faxreply = null return + + +/datum/admins/proc/toggle_hub_visibility() + set category = "Server" + set desc = "Globally Toggles Hub Visibility" + set name = "Toggle Hub Visibility" + if(!check_rights(R_ADMIN)) + return + world.update_hub_visibility() + var/long_message = "Updated hub visibility. The server is now [config.hub_visible ? "visible" : "invisible"]." + if (config.hub_visible && !world.reachable) + message_admins("WARNING: The server will not show up on the hub because byond is detecting that a firewall is blocking incoming connections.") + log_and_message_admins(long_message) diff --git a/code/modules/admin/admin_verb_lists.dm b/code/modules/admin/admin_verb_lists.dm index 9399299702..90a33b5c2c 100644 --- a/code/modules/admin/admin_verb_lists.dm +++ b/code/modules/admin/admin_verb_lists.dm @@ -109,7 +109,8 @@ var/global/list/admin_verbs_admin = list( /datum/admins/proc/view_feedback, /client/proc/debug_global_variables, /client/proc/admin_add_whitelist, - /client/proc/admin_del_whitelist + /client/proc/admin_del_whitelist, + /datum/admins/proc/toggle_hub_visibility ) var/global/list/admin_verbs_ban = list( diff --git a/code/modules/mob/mob.dm b/code/modules/mob/mob.dm index 8573c0db03..9a3265b644 100644 --- a/code/modules/mob/mob.dm +++ b/code/modules/mob/mob.dm @@ -683,6 +683,7 @@ stat("Instances:","[world.contents.len]") stat("World Time:", world.time) stat("Real time of day:", REALTIMEOFDAY) + stat("Hub:", "Visibility [config.hub_visible?"On":"Off"], [world.reachable?"":"NOT"] Reachable") stat(null) if(GLOB) GLOB.stat_entry() diff --git a/config/example/config.txt b/config/example/config.txt index 3171fcd7d4..1d7bff52c4 100644 --- a/config/example/config.txt +++ b/config/example/config.txt @@ -1,6 +1,9 @@ ## Server name: This appears at the top of the screen in-game. In this case it will read "tgstation: station_name" where station_name is the randomly generated name of the station for the round. Remove the # infront of SERVERNAME and replace 'tgstation' with the name of your choice # SERVERNAME spacestation13 +## Uncomment to make the server default to being listed on the BYOND hub. +#HUB_VISIBLE + ## Alert levels ALERT_GREEN All threats to the station have passed. Security may not have weapons visible, privacy laws are once again fully enforced. ALERT_BLUE_UPTO The station has received reliable information about possible hostile activity on the station. Security staff may have weapons visible, random searches are permitted.