mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-29 08:08:49 +01:00
Hubstuff (#50422)
cl Qustinnus add: Hub visibility can now automatically turn on/off based on population (config-based) /cl did this for the headmins
This commit is contained in:
@@ -39,6 +39,11 @@
|
||||
|
||||
/datum/config_entry/flag/hub // if the game appears on the hub or not
|
||||
|
||||
/datum/config_entry/number/max_hub_pop //At what pop to take hub off the server
|
||||
config_entry_value = 0 //0 means disabled
|
||||
integer = TRUE
|
||||
min_val = 0
|
||||
|
||||
/datum/config_entry/flag/log_ooc // log OOC channel
|
||||
|
||||
/datum/config_entry/flag/log_access // log login/logout
|
||||
|
||||
@@ -90,4 +90,15 @@ SUBSYSTEM_DEF(server_maint)
|
||||
if(tgsversion)
|
||||
SSblackbox.record_feedback("text", "server_tools", 1, tgsversion.raw_parameter)
|
||||
|
||||
|
||||
/datum/controller/subsystem/server_maint/proc/UpdateHubStatus()
|
||||
if(!CONFIG_GET(flag/hub) || !CONFIG_GET(number/max_hub_pop))
|
||||
return FALSE //no point, hub / auto hub controls are disabled
|
||||
|
||||
var/max_pop = CONFIG_GET(number/max_hub_pop)
|
||||
|
||||
if(GLOB.clients.len > max_pop)
|
||||
world.update_hub_visibility(FALSE)
|
||||
else
|
||||
world.update_hub_visibility(TRUE)
|
||||
#undef PING_BUFFER_TIME
|
||||
|
||||
@@ -464,6 +464,7 @@ GLOBAL_LIST_EMPTY(external_rsc_urls)
|
||||
GLOB.directory -= ckey
|
||||
log_access("Logout: [key_name(src)]")
|
||||
GLOB.ahelp_tickets.ClientLogout(src)
|
||||
SSserver_maint.UpdateHubStatus()
|
||||
if(credits)
|
||||
QDEL_LIST(credits)
|
||||
if(holder)
|
||||
@@ -595,6 +596,9 @@ GLOBAL_LIST_EMPTY(external_rsc_urls)
|
||||
var/datum/DBQuery/query_log_connection = SSdbcore.NewQuery("INSERT INTO `[format_table_name("connection_log")]` (`id`,`datetime`,`server_ip`,`server_port`,`round_id`,`ckey`,`ip`,`computerid`) VALUES(null,Now(),INET_ATON(IF('[world.internet_address]' LIKE '', '0', '[world.internet_address]')),'[world.port]','[GLOB.round_id]','[sql_ckey]',INET_ATON('[sql_ip]'),'[sql_computerid]')")
|
||||
query_log_connection.Execute()
|
||||
qdel(query_log_connection)
|
||||
|
||||
SSserver_maint.UpdateHubStatus()
|
||||
|
||||
if(new_player)
|
||||
player_age = -1
|
||||
. = player_age
|
||||
|
||||
Reference in New Issue
Block a user