Overflow Rerouting System

This commit adds an overflow rerouting system customizable by modifying
the config. If the config values are set, after X amount of clients have
connected, the server will start rerouting all new players to the
configuration "overflow" server. Note that admins are immune to this, and
therefore will not be rerouted under any circumstance. Players that have
already connected and have a body will not be rerouted either, this will
only affect new players that get sent to the lobby.

It probably would also kick players if an admin sent them to the lobby,
but that's a very special case scenario.
This commit is contained in:
Tigercat2000
2015-05-28 07:08:33 -07:00
parent 613ae3f552
commit 1643b0f118
3 changed files with 27 additions and 1 deletions
+9
View File
@@ -81,6 +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/forbid_singulo_possession = 0
@@ -154,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
/datum/configuration/New()
var/list/L = typesof(/datum/game_mode) - /datum/game_mode
@@ -508,6 +510,13 @@
var/vvalue = text2num(value)
config.starlight = vvalue >= 0 ? vvalue : 0
if("player_reroute_cap")
var/vvalue = text2num(value)
config.player_overflow_cap = vvalue >= 0 ? vvalue : 0
if("overflow_server_url")
config.overflow_server_url = value
else
diary << "Unknown setting in configuration: '[name]'"
+8
View File
@@ -34,3 +34,11 @@
if(client)
handle_privacy_poll()
client.playtitlemusic()
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
var/tally = 0
for(var/client/C in clients)
tally++
if(tally > config.player_overflow_cap)
src << link(config.overflow_server_url)
+10 -1
View File
@@ -273,4 +273,13 @@ EVENT_DELAY_UPPER 15;45;70
EVENT_CUSTOM_START_MAJOR 80;100
## Strength of ambient star light. Set to 0 or less to turn off.
STARLIGHT 0
STARLIGHT 0
## Player rerouting stuff
## If not 0, players can be rerouted to an overflow server after a certain cap is reached
## Cap before players start being rerouted
PLAYER_REROUTE_CAP 0
## Server to reroute to
OVERFLOW_SERVER_URL byond://nanotrasen.se:6666