diff --git a/code/controllers/configuration.dm b/code/controllers/configuration.dm index 7fe7af96553..5aec63c8129 100644 --- a/code/controllers/configuration.dm +++ b/code/controllers/configuration.dm @@ -81,8 +81,7 @@ var/forumurl = "http://baystation12.net/forums/" var/media_base_url = "http://nanotrasen.se/media" // http://ss13.nexisonline.net/media - var/overflow_server_url = "byond://nanotrasen.se:6666" - + var/overflow_server_url var/forbid_singulo_possession = 0 //game_options.txt configs @@ -156,6 +155,7 @@ var/starlight = 0 // Whether space turfs have ambient light or not var/allow_holidays = 0 var/player_overflow_cap = 0 //number of players before the server starts rerouting + var/list/overflow_whitelist = list() //whitelist for overflow /datum/configuration/New() var/list/L = typesof(/datum/game_mode) - /datum/game_mode @@ -654,6 +654,19 @@ else diary << "Unknown setting in configuration: '[name]'" +/datum/configuration/proc/loadoverflowwhitelist(filename) + var/list/Lines = file2list(filename) + for(var/t in Lines) + if(!t) continue + + t = trim(t) + if (length(t) == 0) + continue + else if (copytext(t, 1, 2) == "#") + continue + + config.overflow_whitelist += t + /datum/configuration/proc/pick_mode(mode_name) // I wish I didn't have to instance the game modes in order to look up // their information, but it is the only way (at least that I know of). diff --git a/code/modules/mob/new_player/login.dm b/code/modules/mob/new_player/login.dm index 967e830248e..53946a3eb1d 100644 --- a/code/modules/mob/new_player/login.dm +++ b/code/modules/mob/new_player/login.dm @@ -37,6 +37,7 @@ if(config.player_overflow_cap && config.overflow_server_url) //Overflow rerouting, if set, forces players to be moved to a different server once a player cap is reached. Less rough than a pure kick. if(src.client.holder) return //admins are immune to overflow rerouting + if(config.overflow_whitelist.Find(lowertext(src.ckey))) return //Whitelisted people are immune to overflow rerouting. var/tally = 0 for(var/client/C in clients) tally++ diff --git a/code/world.dm b/code/world.dm index d216b314751..e1e99b18d2f 100644 --- a/code/world.dm +++ b/code/world.dm @@ -313,6 +313,7 @@ var/world_topic_spam_protect_time = world.timeofday config.load("config/game_options.txt","game_options") config.loadsql("config/dbconfig.txt") config.loadforumsql("config/forumdbconfig.txt") + config.loadoverflowwhitelist("config/ofwhitelist.txt") // apply some settings from config.. /hook/startup/proc/loadMods() diff --git a/config/example/ofwhitelist.txt b/config/example/ofwhitelist.txt new file mode 100644 index 00000000000..7588d3b698e --- /dev/null +++ b/config/example/ofwhitelist.txt @@ -0,0 +1,2 @@ +#Any ckeys in this file will be ignored by the overflow system. +example142 \ No newline at end of file