Skip to content

Commit

Permalink
Merge pull request Baystation12#35041 from Spookerton/spkrtn/cng/remo…
Browse files Browse the repository at this point in the history
…ve-serverurl

clean up server location config
  • Loading branch information
MuckerMayhem authored Jan 11, 2025
2 parents 33d1af8 + 153c751 commit 38f704e
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 33 deletions.
17 changes: 5 additions & 12 deletions code/controllers/configuration.dm
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@
/// server name (for world name / status)
var/static/server_name = "Space Station 13"

/// generate numeric suffix based on server port
var/static/server_suffix = FALSE

/// for topic status requests
var/static/game_version = "Baystation"

Expand Down Expand Up @@ -196,9 +193,7 @@

var/static/debugparanoid = FALSE

var/static/serverurl

var/static/server
var/static/server_address

var/static/banappeals

Expand Down Expand Up @@ -633,14 +628,12 @@
respawn_menu_delay = respawn_menu_delay > 0 ? respawn_menu_delay : 0
if ("server_name")
server_name = value
if ("serversuffix")
server_suffix = TRUE
if ("hostedby")
hostedby = value
if ("serverurl")
serverurl = value
if ("server")
server = value
if ("server_address")
server_address = value
if (copytext(server_address, 1, 9) != "byond://")
server_address = "byond://[server_address]"
if ("banappeals")
banappeals = value
if ("wiki_url")
Expand Down
15 changes: 7 additions & 8 deletions code/game/world.dm
Original file line number Diff line number Diff line change
Expand Up @@ -447,14 +447,13 @@ GLOBAL_VAR_INIT(world_topic_last, world.timeofday)

Master.Shutdown()

var/datum/chatOutput/co
for(var/client/C in GLOB.clients)
co = C.chatOutput
if(co)
co.ehjax_send(data = "roundrestart")
if(config.server) //if you set a server location in config.txt, it sends you there instead of trying to reconnect to the same world address. -- NeoFite
for(var/client/C in GLOB.clients)
send_link(C, "byond://[config.server]")
var/datum/chatOutput/chat_output
for (var/client/client in GLOB.clients)
chat_output = client.chatOutput
if (chat_output)
chat_output.ehjax_send(data = "roundrestart")
if (config.server_address)
send_link(client, config.server_address)

if(config.wait_for_sigusr1_reboot && reason != 3)
text2file("foo", "reboot_called")
Expand Down
10 changes: 3 additions & 7 deletions code/modules/ext_scripts/irc.dm
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,9 @@
export2irc(params)

/proc/get_world_url()
. = "byond://"
if(config.serverurl)
. += config.serverurl
else if(config.server)
. += config.server
else
. += "[world.address]:[world.port]"
if (config.server_address)
return config.server_address
return "byond://[world.address]:[world.port]"

/proc/send_to_admin_discord(type, message)
if(config.admin_discord && config.excom_address)
Expand Down
8 changes: 2 additions & 6 deletions config/example/config.txt
Original file line number Diff line number Diff line change
Expand Up @@ -195,12 +195,8 @@ GUEST_BAN
## Uncomment to 1 to jobban, leave commented out to allow these positions for everyone (but see GUEST_JOBBAN above and regular jobbans)
# USEWHITELIST

## set a server location for world reboot. Don't include the byond://, just give the address and port.
#SERVER server.net:port

## set a server URL for the IRC bot to use; like SERVER, don't include the byond://
## Unlike SERVER, this one shouldn't break auto-reconnect
#SERVERURL server.net:port
## Set a server location for world rejoins. May be either "address:port" or "byond://address:port".
#SERVER_ADDRESS server.address:port

## Wiki address
## Where your server's documentation lives
Expand Down

0 comments on commit 38f704e

Please sign in to comment.