From e0324a6fc82536fbc2d4c853c59aebfdc742b1d2 Mon Sep 17 00:00:00 2001 From: Incoming Date: Sun, 4 Dec 2016 21:27:17 -0500 Subject: [PATCH] If a server has both a linked server and the panic bunker on, you can now choose to redirect new players to the linked server instead of denying them outright. You shouldn't use this if BOTH servers are panic bunkered, obviously. --- code/_globalvars/configuration.dm | 1 + code/controllers/configuration.dm | 2 ++ code/modules/client/client_procs.dm | 4 ++++ config/config.txt | 5 +++++ 4 files changed, 12 insertions(+) diff --git a/code/_globalvars/configuration.dm b/code/_globalvars/configuration.dm index 21155f2d2dd..99e394ff6fe 100644 --- a/code/_globalvars/configuration.dm +++ b/code/_globalvars/configuration.dm @@ -29,6 +29,7 @@ var/global/comms_allowed = 0 //By default, the server does not allow messages to //Cross server communications var/global/cross_address = "byond://" //This needs to be global as the message sent contains the comms key. var/global/cross_allowed = 0 //Don't bother attempting to send if the address wasn't set. +var/global/allow_panic_bunker_to_cross = 0 //Reconnect a player to a linked server if this server isn't accepting new players var/global/medal_hub = null var/global/medal_pass = " " diff --git a/code/controllers/configuration.dm b/code/controllers/configuration.dm index 7c33a9962ed..3caa873cb1a 100644 --- a/code/controllers/configuration.dm +++ b/code/controllers/configuration.dm @@ -386,6 +386,8 @@ global.cross_allowed = 1 if("cross_comms_name") cross_name = value + if("send_panic_bunkered_to_cross_server") + global.allow_panic_bunker_to_cross = 1 if("medal_hub_address") global.medal_hub = value if("medal_hub_password") diff --git a/code/modules/client/client_procs.dm b/code/modules/client/client_procs.dm index ef910622f9d..290f4cf5a45 100644 --- a/code/modules/client/client_procs.dm +++ b/code/modules/client/client_procs.dm @@ -196,6 +196,10 @@ var/next_external_rsc = 0 log_access("Failed Login: [key] - New account attempting to connect during panic bunker") message_admins("Failed Login: [key] - New account attempting to connect during panic bunker") src << "Sorry but the server is currently not accepting connections from never before seen players." + if(global.cross_allowed && global.allow_panic_bunker_to_cross) + src << "Sending you to [global.cross_address]." + winset(src, null, "command=.options") + src << link(global.cross_address) qdel(src) return 0 diff --git a/config/config.txt b/config/config.txt index a8cc323f2ce..abe10ad3828 100644 --- a/config/config.txt +++ b/config/config.txt @@ -241,6 +241,11 @@ NOTIFY_NEW_PLAYER_AGE 0 ## Requires database #PANIC_BUNKER +## If panic bunker is on and a player is rejected (see above), attempt to send them to the connected server (see CROSS_SERVER_ADDRESS) instead. +## Do not use this setting if both servers are bunkered and have this setting, players will just bounce endlessly between rejections. +## Requires PANIC_BUNKER and CROSS_SERVER_ADDRESS +#SEND_PANIC_BUNKERED_TO_CROSS_SERVER + ## Uncomment to have the changelog file automatically open when a user connects and hasn't seen the latest changelog #AGGRESSIVE_CHANGELOG