From 956f10f2d29f60190eb68ce4b4bc6475bf31b90f Mon Sep 17 00:00:00 2001 From: CitadelStationBot Date: Mon, 17 Jul 2017 07:13:45 -0500 Subject: [PATCH] [s]Fixes panic bunker --- code/controllers/configuration.dm | 14 +++++++------- code/modules/client/client_procs.dm | 23 ++++++++++++----------- config/config.txt | 4 ++-- 3 files changed, 21 insertions(+), 20 deletions(-) diff --git a/code/controllers/configuration.dm b/code/controllers/configuration.dm index b3d4324959..c32c481291 100644 --- a/code/controllers/configuration.dm +++ b/code/controllers/configuration.dm @@ -87,9 +87,8 @@ var/check_randomizer = 0 - var/allow_panic_bunker_bounce = 0 //Send new players somewhere else - var/panic_server_name = "somewhere else" - var/panic_address = "byond://" //Reconnect a player this linked server if this server isn't accepting new players + var/panic_server_name + var/panic_address //Reconnect a player this linked server if this server isn't accepting new players //IP Intel vars var/ipintel_email @@ -455,11 +454,12 @@ if("cross_comms_name") cross_name = value if("panic_server_name") - panic_server_name = value + if (value != "\[Put the name here\]") + panic_server_name = value if("panic_server_address") - panic_address = value - if(value != "byond:\\address:port") - allow_panic_bunker_bounce = 1 + if(value != "byond://address:port") + panic_address = value + 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 8b16fd1d68..aa54bb224e 100644 --- a/code/modules/client/client_procs.dm +++ b/code/modules/client/client_procs.dm @@ -284,17 +284,6 @@ GLOBAL_LIST(external_rsc_urls) if (isnum(cached_player_age) && cached_player_age == -1) //first connection player_age = 0 if (isnum(cached_player_age) && cached_player_age == -1) //first connection - if (config.panic_bunker && !holder && !(ckey in GLOB.deadmins)) - 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") - to_chat(src, "Sorry but the server is currently not accepting connections from never before seen players.") - if(config.allow_panic_bunker_bounce && tdata != "redirect") - to_chat(src, "Sending you to [config.panic_server_name].") - winset(src, null, "command=.options") - src << link("[config.panic_address]?redirect") - qdel(src) - return 0 - if (config.notify_new_player_age >= 0) message_admins("New user: [key_name_admin(src)] is connecting here for the first time.") if (config.irc_first_connection_alert) @@ -446,6 +435,18 @@ GLOBAL_LIST(external_rsc_urls) if(!query_client_in_db.Execute()) return if(!query_client_in_db.NextRow()) + if (config.panic_bunker && !holder && !(ckey in GLOB.deadmins)) + 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") + to_chat(src, "Sorry but the server is currently not accepting connections from never before seen players.") + var/list/connectiontopic_a = params2list(connectiontopic) + if(config.panic_address && !connectiontopic_a["redirect"]) + to_chat(src, "Sending you to [config.panic_server_name ? config.panic_server_name : config.panic_address].") + winset(src, null, "command=.options") + src << link("[config.panic_address]?redirect=1") + qdel(src) + return + new_player = 1 account_join_date = sanitizeSQL(findJoinDate()) var/datum/DBQuery/query_add_player = SSdbcore.NewQuery("INSERT INTO [format_table_name("player")] (`ckey`, `firstseen`, `lastseen`, `ip`, `computerid`, `lastadminrank`, `accountjoindate`) VALUES ('[sql_ckey]', Now(), Now(), INET_ATON('[sql_ip]'), '[sql_computerid]', '[sql_admin_rank]', [account_join_date ? "'[account_join_date]'" : "NULL"])") diff --git a/config/config.txt b/config/config.txt index f37be01b10..7497404a89 100644 --- a/config/config.txt +++ b/config/config.txt @@ -262,10 +262,10 @@ NOTIFY_NEW_PLAYER_ACCOUNT_AGE 1 ## If panic bunker is on and a player is rejected (see above), attempt to send them to this connected server (see below) instead. ## You probably want this to be the same as CROSS_SERVER_ADDRESS -PANIC_SERVER_ADDRESS byond://address:port +#PANIC_SERVER_ADDRESS byond://address:port ##Name of the place to send people rejected by the bunker -PANIC_SERVER_NAME [Put the name here] +#PANIC_SERVER_NAME [Put the name here] ## Uncomment to have the changelog file automatically open when a user connects and hasn't seen the latest changelog #AGGRESSIVE_CHANGELOG