Skip to content

Commit

Permalink
Updates the hub entry (BeeStation#10898)
Browse files Browse the repository at this point in the history
* Updates the server tagline

* Update world.dm

* Call to action

* Auto update

* Fixes the config entry not being included

* Updates the default discord URL since its not a valid URL

* Updates the status to account for the 255 character limit

* Shifts stuff around

* Removes the unused website URL link

* Fixes 1 too many characters
  • Loading branch information
PowerfulBacon authored and DrDuckedGoose committed May 11, 2024
1 parent 03627e1 commit 94ab6f4
Show file tree
Hide file tree
Showing 7 changed files with 72 additions and 33 deletions.
1 change: 1 addition & 0 deletions beestation.dme
Original file line number Diff line number Diff line change
Expand Up @@ -421,6 +421,7 @@
#include "code\controllers\subsystem\fail2topic.dm"
#include "code\controllers\subsystem\fire_burning.dm"
#include "code\controllers\subsystem\garbage.dm"
#include "code\controllers\subsystem\hub.dm"
#include "code\controllers\subsystem\icon_smooth.dm"
#include "code\controllers\subsystem\idlenpcpool.dm"
#include "code\controllers\subsystem\input.dm"
Expand Down
2 changes: 2 additions & 0 deletions code/controllers/configuration/entries/general.dm
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@

/datum/config_entry/string/servername // server name (the name of the game window)

/datum/config_entry/string/servertag // Server tagline for displaying on the hub

/datum/config_entry/string/serversqlname // short form server name used for the DB

/datum/config_entry/string/stationname // station name (the name of the station in-game)
Expand Down
7 changes: 7 additions & 0 deletions code/controllers/subsystem/hub.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
SUBSYSTEM_DEF(hub)
name = "Hub Entry"
flags = SS_NO_INIT
wait = 1 MINUTES

/datum/controller/subsystem/hub/fire(resumed)
world.update_status()
85 changes: 58 additions & 27 deletions code/game/world.dm
Original file line number Diff line number Diff line change
Expand Up @@ -356,43 +356,74 @@ GLOBAL_VAR(restart_counter)
..()

/world/proc/update_status()

var/list/features = list()

if (!GLOB.enter_allowed)
features += "closed"

var/s = ""
var/hostedby
if(config)
var/server_name = CONFIG_GET(string/servername)
if (server_name)
s += "<b>[server_name]</b> &#8212; "

hostedby = CONFIG_GET(string/hostedby)

s += "<b>[station_name()]</b>";
var/discordurl = CONFIG_GET(string/discordurl)
s += " (<a href='[discordurl]'>Discord</a>|<a href='http://beestation13.com'>Website</a>)"

// Remove the https: since // is good enough
var/discordurl = replacetext(CONFIG_GET(string/discordurl), "https:", "")
var/server_name = CONFIG_GET(string/servername)
var/server_tag = CONFIG_GET(string/servertag)
var/station_name = station_name()
var/players = GLOB.clients.len

var/popcaptext = ""
var/popcap = max(CONFIG_GET(number/extreme_popcap), CONFIG_GET(number/hard_popcap), CONFIG_GET(number/soft_popcap))
if (popcap)
popcaptext = "/[popcap]"

game_state = (CONFIG_GET(number/extreme_popcap) && players >= CONFIG_GET(number/extreme_popcap)) //tells the hub if we are full

if (!host && hostedby)
features += "hosted by <b>[hostedby]</b>"
// Determine our character usage
var/character_usage = 86 // Base character usage
// Discord URL is needed
if (discordurl)
character_usage += length(discordurl)
// Server name is needed
if (server_name)
character_usage += length(server_name)
// We also need this stuff
character_usage += length("[players][popcaptext][SSmapping.config?.map_name || "Loading..."][server_tag]")
var/station_name_limit = 255 - character_usage

if (station_name_limit <= 10)
// Too few characters to display the station name
if (discordurl)
if (server_name)
s += "<a href='[discordurl]'><b>[server_name]</b></a><br>"
else
s += "<a href='[discordurl]'><b></b></a><br>"
else
if (server_name)
s += "<b>[server_name]</b><br>"
else
s += "<b>Space Station 13</b><br>"
if (station_name_limit < length(station_name))
// Station name is going to be truncated with ...
if (discordurl)
if (server_name)
s += "<a href='[discordurl]'><b>[server_name] - [copytext(station_name, 1, station_name_limit - 3)]...</b></a><br>"
else
s += "<a href='[discordurl]'><b>[copytext(station_name, 1, station_name_limit - 3)]...</b></a><br>"
else
if (server_name)
s += "<b>[server_name] - [copytext(station_name, 1, station_name_limit - 3)]...</b><br>"
else
s += "<b>[copytext(station_name, 1, station_name_limit - 3)]...</b><br>"
else
// Station name can be displayed in full
if (discordurl)
if (server_name)
s += "<a href='[discordurl]'><b>[server_name] - [station_name]</b></a><br>"
else
s += "<a href='[discordurl]'><b>[station_name]</b></a><br>"
else
if (server_name)
s += "<b>[server_name] - [station_name]</b><br>"
else
s += "<b>[station_name]</b><br>"

if(length(features))
s += ": [jointext(features, ", ")]"
if (server_tag)
s += "[server_tag]<p>"

s += "<br>Time: <b>[gameTimestamp("hh:mm")]</b>"
s += "<br>Alert: <b>[capitalize(get_security_level())]</b>"
s += "<br>Players: <b>[players][popcaptext]</b>"
s += "Time: <b>[gameTimestamp("hh:mm:ss")]</b><br>"
s += "Players: <b>[players][popcaptext]</b><br>"
s += "Map: <b>[SSmapping.config?.map_name || "Loading..."]"

status = s

Expand Down
3 changes: 0 additions & 3 deletions code/modules/admin/admin.dm
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,6 @@
to_chat(world, "<B>New players may now enter the game.</B>")
log_admin("[key_name(usr)] toggled new player game entering.")
message_admins("<span class='adminnotice'>[key_name_admin(usr)] toggled new player game entering.</span>")
world.update_status()
SSblackbox.record_feedback("nested tally", "admin_toggle", 1, list("Toggle Entering", "[GLOB.enter_allowed ? "Enabled" : "Disabled"]")) //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!

/datum/admins/proc/toggleAI()
Expand All @@ -452,7 +451,6 @@
else
to_chat(world, "<B>The AI job is chooseable now.</B>")
log_admin("[key_name(usr)] toggled AI allowed.")
world.update_status()
SSblackbox.record_feedback("nested tally", "admin_toggle", 1, list("Toggle AI", "[!alai ? "Disabled" : "Enabled"]")) //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!

/datum/admins/proc/toggleaban()
Expand All @@ -467,7 +465,6 @@
to_chat(world, "<B>You may no longer respawn :(</B>")
message_admins("<span class='adminnotice'>[key_name_admin(usr)] toggled respawn to [!new_nores ? "On" : "Off"].</span>")
log_admin("[key_name(usr)] toggled respawn to [!new_nores ? "On" : "Off"].")
world.update_status()
SSblackbox.record_feedback("nested tally", "admin_toggle", 1, list("Toggle Respawn", "[!new_nores ? "Enabled" : "Disabled"]")) //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!

/datum/admins/proc/delay()
Expand Down
2 changes: 0 additions & 2 deletions code/modules/admin/battle_royale.dm
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,6 @@ GLOBAL_DATUM(battle_royale, /datum/battle_royale_controller)
//BR finished? Let people play as borgs/golems again
ENABLE_BITFIELD(GLOB.ghost_role_flags, (GHOSTROLE_SPAWNER | GHOSTROLE_SILICONS))

world.update_status()
GLOB.battle_royale = null

//Trigger random events and shit, update the world border
Expand Down Expand Up @@ -275,7 +274,6 @@ GLOBAL_DATUM(battle_royale, /datum/battle_royale_controller)
//Don't let anyone join as posibrains/golems etc
DISABLE_BITFIELD(GLOB.ghost_role_flags, (GHOSTROLE_SPAWNER | GHOSTROLE_SILICONS))

world.update_status()
if(SSticker.current_state < GAME_STATE_PREGAME)
to_chat(world, "<span class=boldannounce>Battle Royale: Waiting for server to be ready...</span>")
SSticker.start_immediately = FALSE
Expand Down
5 changes: 4 additions & 1 deletion config/config.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ $include policies.txt
## Server name: This appears at the top of the screen in-game and in the BYOND hub. Uncomment and replace 'beestation' with the name of your choice.
#@SERVERNAME beestation

## Server Tagline: The tag that will appear on the HUB
@SERVERTAG Join us for a new-player friendly, classic space station 13 roleplaying experience!

## Server SQL name: This is the name used to identify the server to the SQL DB, distinct from SERVERNAME as it must be at most 32 characters.
#@SERVERSQLNAME ss13newbs

Expand Down Expand Up @@ -285,7 +288,7 @@ GITHUBURL https://www.github.com/beestation/beestation-hornet
DONATEURL https://www.patreon.com/user?u=10639001

## Discord Invite
DISCORDURL https://discord.gg/zUe34rs
DISCORDURL https://discord.gg/ss13

## Round specific stats address
## Link to round specific parsed logs; IE statbus. It is appended with the RoundID automatically by ticker/Reboot()
Expand Down

0 comments on commit 94ab6f4

Please sign in to comment.