diff --git a/code/_globalvars/configuration.dm b/code/_globalvars/configuration.dm index d05b46e407..83bf3cfb5a 100644 --- a/code/_globalvars/configuration.dm +++ b/code/_globalvars/configuration.dm @@ -7,6 +7,7 @@ GLOBAL_VAR(join_motd) GLOBAL_VAR(station_name) GLOBAL_VAR_INIT(game_version, "/tg/ Station 13") GLOBAL_VAR_INIT(changelog_hash, "") +GLOBAL_VAR_INIT(hub_visibility, FALSE) GLOBAL_VAR_INIT(ooc_allowed, TRUE) // used with admin verbs to disable ooc - not a config option apparently GLOBAL_VAR_INIT(dooc_allowed, TRUE) diff --git a/code/controllers/subsystem/server_maint.dm b/code/controllers/subsystem/server_maint.dm index 9a67b4ecf2..e398f09a03 100644 --- a/code/controllers/subsystem/server_maint.dm +++ b/code/controllers/subsystem/server_maint.dm @@ -11,7 +11,7 @@ SUBSYSTEM_DEF(server_maint) /datum/controller/subsystem/server_maint/Initialize(timeofday) if (config.hub) - world.visibility = 1 + world.update_hub_visibility(TRUE) ..() /datum/controller/subsystem/server_maint/fire(resumed = FALSE) diff --git a/code/modules/admin/verbs/randomverbs.dm b/code/modules/admin/verbs/randomverbs.dm index 9a8e7c8278..551321e893 100644 --- a/code/modules/admin/verbs/randomverbs.dm +++ b/code/modules/admin/verbs/randomverbs.dm @@ -1157,14 +1157,14 @@ GLOBAL_LIST_EMPTY(custom_outfits) //Admin created outfits set category = "Server" set name = "Toggle Hub" - world.visibility = (!world.visibility) + world.update_hub_visibility(!GLOB.hub_visibility) - log_admin("[key_name(usr)] has toggled the server's hub status for the round, it is now [(world.visibility?"on":"off")] the hub.") - message_admins("[key_name_admin(usr)] has toggled the server's hub status for the round, it is now [(world.visibility?"on":"off")] the hub.") - if (world.visibility && !world.reachable) + log_admin("[key_name(usr)] has toggled the server's hub status for the round, it is now [(GLOB.hub_visibility?"on":"off")] the hub.") + message_admins("[key_name_admin(usr)] has toggled the server's hub status for the round, it is now [(GLOB.hub_visibility?"on":"off")] the hub.") + if (GLOB.hub_visibility && !world.reachable) message_admins("WARNING: The server will not show up on the hub because byond is detecting that a filewall is blocking incoming connections.") - SSblackbox.add_details("admin_toggle","Toggled Hub Visibility|[world.visibility]") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! + SSblackbox.add_details("admin_toggle","Toggled Hub Visibility|[GLOB.hub_visibility]") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! /client/proc/smite(mob/living/carbon/human/target as mob) set name = "Smite" diff --git a/code/world.dm b/code/world.dm index 404f982adb..b6badeb348 100644 --- a/code/world.dm +++ b/code/world.dm @@ -5,10 +5,8 @@ view = "15x15" cache_lifespan = 7 hub = "Exadv1.spacestation13" - hub_password = "kMZy3U5jJHSiBQjr" name = "/tg/ Station 13" fps = 20 - visibility = 0 #ifdef GC_FAILURE_HARD_LOOKUP loop_checks = FALSE #endif @@ -304,3 +302,12 @@ s += ": [jointext(features, ", ")]" status = s + +/world/proc/update_hub_visibility(new_visibility) + if(new_visibility == GLOB.hub_visibility) + return + GLOB.hub_visibility = new_visibility + if(GLOB.hub_visibility) + hub_password = "kMZy3U5jJHSiBQjr" + else + hub_password = "SORRYNOPASSWORD"