mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-22 03:27:05 +01:00
Whitelisting to bypass the reroute system.
Note, all ckeys in the ofwhitelist must be lowercase and contain no spaces.
This commit is contained in:
@@ -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).
|
||||
|
||||
@@ -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++
|
||||
|
||||
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user