mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2025-12-25 17:12:12 +00:00
Merge pull request #31374 from MrStonedOne/highpopmode
High pop reduced MC processing mode.
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
#define CONFIG_DEF(X) /datum/config_entry/##X { resident_file = CURRENT_RESIDENT_FILE }; /datum/config_entry/##X
|
||||
#define CONFIG_GET(X) global.config.Get(/datum/config_entry/##X)
|
||||
#define CONFIG_SET(X, Y) global.config.Set(/datum/config_entry/##X, ##Y)
|
||||
#define CONFIG_TWEAK(X) /datum/config_entry/##X
|
||||
|
||||
#define CONFIG_MAPS_FILE "maps.txt"
|
||||
|
||||
|
||||
@@ -348,4 +348,27 @@ CONFIG_DEF(number/error_msg_delay) // How long to wait between messaging admins
|
||||
|
||||
CONFIG_DEF(flag/irc_announce_new_game)
|
||||
|
||||
CONFIG_DEF(flag/debug_admin_hrefs)
|
||||
CONFIG_DEF(flag/debug_admin_hrefs)
|
||||
|
||||
|
||||
CONFIG_DEF(number/mc_tick_rate/base_mc_tick_rate)
|
||||
integer = FALSE
|
||||
value = 1
|
||||
|
||||
CONFIG_DEF(number/mc_tick_rate/high_pop_mc_tick_rate)
|
||||
integer = FALSE
|
||||
value = 1.1
|
||||
|
||||
CONFIG_DEF(number/mc_tick_rate/high_pop_mc_mode_amount)
|
||||
value = 65
|
||||
|
||||
CONFIG_DEF(number/mc_tick_rate/disable_high_pop_mc_mode_amount)
|
||||
value = 60
|
||||
|
||||
CONFIG_TWEAK(number/mc_tick_rate)
|
||||
abstract_type = /datum/config_entry/number/mc_tick_rate
|
||||
|
||||
CONFIG_TWEAK(number/mc_tick_rate/ValidateAndSet(str_val))
|
||||
. = ..()
|
||||
if (.)
|
||||
Master.UpdateTickRate()
|
||||
|
||||
@@ -573,3 +573,13 @@ GLOBAL_REAL(Master, /datum/controller/master) = new
|
||||
for(var/S in subsystems)
|
||||
var/datum/controller/subsystem/SS = S
|
||||
SS.StopLoadingMap()
|
||||
|
||||
|
||||
/datum/controller/master/proc/UpdateTickRate()
|
||||
if (!processing)
|
||||
return
|
||||
var/client_count = length(GLOB.clients)
|
||||
if (client_count < CONFIG_GET(number/mc_tick_rate/disable_high_pop_mc_mode_amount))
|
||||
processing = CONFIG_GET(number/mc_tick_rate/base_mc_tick_rate)
|
||||
else if (client_count > CONFIG_GET(number/mc_tick_rate/high_pop_mc_mode_amount))
|
||||
processing = CONFIG_GET(number/mc_tick_rate/high_pop_mc_tick_rate)
|
||||
@@ -350,6 +350,8 @@ GLOBAL_LIST(external_rsc_urls)
|
||||
if (menuitem)
|
||||
menuitem.Load_checked(src)
|
||||
|
||||
Master.UpdateTickRate()
|
||||
|
||||
//////////////
|
||||
//DISCONNECT//
|
||||
//////////////
|
||||
@@ -386,6 +388,7 @@ GLOBAL_LIST(external_rsc_urls)
|
||||
if(movingmob != null)
|
||||
movingmob.client_mobs_in_contents -= mob
|
||||
UNSETEMPTY(movingmob.client_mobs_in_contents)
|
||||
Master.UpdateTickRate()
|
||||
return ..()
|
||||
|
||||
/client/Destroy()
|
||||
|
||||
Reference in New Issue
Block a user