Skip to content

Commit

Permalink
Revert "Updates master controller and world topic()"
Browse files Browse the repository at this point in the history
  • Loading branch information
GremlingThing authored Jun 28, 2022
1 parent 2180a7c commit acb8519
Show file tree
Hide file tree
Showing 41 changed files with 1,065 additions and 1,374 deletions.
20 changes: 0 additions & 20 deletions code/__DEFINES/MC.dm
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,6 @@
#define START_PROCESSING(Processor, Datum) if (!(Datum.datum_flags & DF_ISPROCESSING)) {Datum.datum_flags |= DF_ISPROCESSING;Processor.processing += Datum}
#define STOP_PROCESSING(Processor, Datum) Datum.datum_flags &= ~DF_ISPROCESSING;Processor.processing -= Datum;Processor.currentrun -= Datum

/// Returns true if the MC is initialized and running.
/// Optional argument init_stage controls what stage the mc must have initializted to count as initialized. Defaults to INITSTAGE_MAX if not specified.
#define MC_RUNNING(INIT_STAGE...) (Master && Master.processing > 0 && Master.current_runlevel && Master.init_stage_completed == (max(min(INITSTAGE_MAX, ##INIT_STAGE), 1)))

#define MC_LOOP_RTN_NEWSTAGES 1
#define MC_LOOP_RTN_GRACEFUL_EXIT 2

//SubSystem flags (Please design any new flags so that the default is off, to make adding flags to subsystems easier)

//subsystem does not initialize.
Expand Down Expand Up @@ -72,26 +65,13 @@
#define SS_SLEEPING 4 //fire() slept.
#define SS_PAUSING 5 //in the middle of pausing

// Subsystem init stages
#define INITSTAGE_EARLY 1 //! Early init stuff that doesn't need to wait for mapload
#define INITSTAGE_MAIN 2 //! Main init stage
#define INITSTAGE_MAX 2 //! Highest initstage.

#define SUBSYSTEM_DEF(X) GLOBAL_REAL(SS##X, /datum/controller/subsystem/##X);\
/datum/controller/subsystem/##X/New(){\
NEW_SS_GLOBAL(SS##X);\
PreInit();\
}\
/datum/controller/subsystem/##X

#define TIMER_SUBSYSTEM_DEF(X) GLOBAL_REAL(SS##X, /datum/controller/subsystem/timer/##X);\
/datum/controller/subsystem/timer/##X/New(){\
NEW_SS_GLOBAL(SS##X);\
PreInit();\
}\
/datum/controller/subsystem/timer/##X/fire() {..() /*just so it shows up on the profiler*/} \
/datum/controller/subsystem/timer/##X

#define PROCESSING_SUBSYSTEM_DEF(X) GLOBAL_REAL(SS##X, /datum/controller/subsystem/processing/##X);\
/datum/controller/subsystem/processing/##X/New(){\
NEW_SS_GLOBAL(SS##X);\
Expand Down
4 changes: 0 additions & 4 deletions code/__DEFINES/_profile.dm

This file was deleted.

6 changes: 0 additions & 6 deletions code/__DEFINES/database.dm

This file was deleted.

3 changes: 3 additions & 0 deletions code/__DEFINES/dcs/signals.dm
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@
#define COMSIG_COMPONENT_UNREGISTER_PARENT "component_unregister_parent"
/// sent to the component itself when registered to a parent
#define COMSIG_COMPONENT_REGISTER_PARENT "component_register_parent"
///Subsystem signals
///From base of datum/controller/subsystem/Initialize: (start_timeofday)
#define COMSIG_SUBSYSTEM_POST_INITIALIZE "subsystem_post_initialize"

// /atom signals
//from base of atom/proc/Initialize(): sent any time a new atom is created
Expand Down
25 changes: 0 additions & 25 deletions code/__DEFINES/dcs/signals/signals_subsystem.dm

This file was deleted.

16 changes: 2 additions & 14 deletions code/__DEFINES/spaceman_dmm.dm
Original file line number Diff line number Diff line change
Expand Up @@ -28,17 +28,5 @@
#define VAR_PROTECTED var
#endif

/proc/auxtools_stack_trace(msg)
CRASH(msg)

/proc/auxtools_expr_stub()
CRASH("auxtools not loaded")

/proc/enable_debugging(mode, port)
CRASH("auxtools not loaded")

/world/Del()
var/debug_server = world.GetConfig("env", "AUXTOOLS_DEBUG_DLL")
if (debug_server)
call(debug_server, "auxtools_shutdown")()
. = ..()
/proc/enable_debugging()
CRASH("Auxtools not found")
3 changes: 1 addition & 2 deletions code/__DEFINES/subsystems.dm
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@
#define INIT_ORDER_MINOR_MAPPING -40
#define INIT_ORDER_PATH -50
#define INIT_ORDER_PERSISTENCE -95
#define INIT_ORDER_INIT_PROFILER -99 //Near the end, logs the costs of initialize
#define INIT_ORDER_DEMO -99 // o avoid a bunch of changes related to initialization being written, do this last
#define INIT_ORDER_CHAT -100 //Should be last to ensure chat remains smooth during init.


Expand All @@ -125,7 +125,6 @@
#define FIRE_PRIORITY_RESEARCH 10
#define FIRE_PRIORITY_VIS 10
#define FIRE_PRIORITY_GARBAGE 15
#define FIRE_PRIORITY_DATABASE 16
#define FIRE_PRIORITY_WET_FLOORS 20
#define FIRE_PRIORITY_AIR 20
#define FIRE_PRIORITY_PROCESS 25
Expand Down
3 changes: 3 additions & 0 deletions code/__HELPERS/_extools_api.dm
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@

/proc/extools_finalize_logging()

/proc/auxtools_stack_trace(msg)
CRASH(msg)

GLOBAL_LIST_EMPTY(auxtools_initialized)

#define AUXTOOLS_CHECK(LIB)\
Expand Down
10 changes: 0 additions & 10 deletions code/__HELPERS/_lists.dm
Original file line number Diff line number Diff line change
Expand Up @@ -831,13 +831,3 @@
return (call(cmp)(L[i],A) > 0) ? i : i+1
else
return i

/**
* Removes any null entries from the list
* Returns TRUE if the list had nulls, FALSE otherwise
**/
/proc/list_clear_nulls(list/list_to_clear)
var/start_len = list_to_clear.len
var/list/new_list = new(start_len)
list_to_clear -= new_list
return list_to_clear.len < start_len
10 changes: 10 additions & 0 deletions code/__HELPERS/roundend.dm
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,16 @@
var/info = statspage ? "<a href='?action=openLink&link=[url_encode(statspage)][GLOB.round_id]'>[GLOB.round_id]</a>" : GLOB.round_id
parts += "[FOURSPACES]Round ID: <b>[info]</b>"

var/list/voting_results = SSvote.stored_gamemode_votes

if(length(voting_results))
parts += "[FOURSPACES]Voting: "
var/total_score = 0
for(var/choice in voting_results)
var/score = voting_results[choice]
total_score += score
parts += "[FOURSPACES][FOURSPACES][choice]: [score]"

parts += "[FOURSPACES]Round Duration: <B>[DisplayTimeText(world.time - SSticker.round_start_time)]</B>"
//parts += "[FOURSPACES]Station Integrity: <B>[mode.station_was_nuked ? "<span class='redtext'>Destroyed</span>" : "[popcount["station_integrity"]]%"]</B>"
var/total_players = GLOB.joined_player_list.len
Expand Down
13 changes: 7 additions & 6 deletions code/__HELPERS/unsorted.dm
Original file line number Diff line number Diff line change
Expand Up @@ -1099,23 +1099,24 @@ GLOBAL_REAL_VAR(list/stack_trace_storage)
. = stack_trace_storage
stack_trace_storage = null

//Key thing that stops lag. Cornerstone of performance in ss13, Just sitting here, in unsorted.dm. Now with dedicated file!
//Key thing that stops lag. Cornerstone of performance in ss13, Just sitting here, in unsorted.dm.

///Increases delay as the server gets more overloaded, as sleeps aren't cheap and sleeping only to wake up and sleep again is wasteful
//Increases delay as the server gets more overloaded,
//as sleeps aren't cheap and sleeping only to wake up and sleep again is wasteful
#define DELTA_CALC max(((max(TICK_USAGE, world.cpu) / 100) * max(Master.sleep_delta-1,1)), 1)

///returns the number of ticks slept
//returns the number of ticks slept
/proc/stoplag(initial_delay)
if (!Master || Master.init_stage_completed < INITSTAGE_MAX)
if (!Master || !(Master.current_runlevel & RUNLEVELS_DEFAULT))
sleep(world.tick_lag)
return 1
if (!initial_delay)
initial_delay = world.tick_lag
. = 0
var/i = DS2TICKS(initial_delay)
do
. += CEILING(i * DELTA_CALC, 1)
sleep(i * world.tick_lag * DELTA_CALC)
. += CEILING(i*DELTA_CALC, 1)
sleep(i*world.tick_lag*DELTA_CALC)
i *= 2
while (TICK_USAGE > min(TICK_LIMIT_TO_RUN, Master.current_ticklimit))

Expand Down
13 changes: 0 additions & 13 deletions code/_debugger.dm

This file was deleted.

1 change: 0 additions & 1 deletion code/_globalvars/lists/mobs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ GLOBAL_LIST_EMPTY(alive_mob_list) //all alive mobs, including clientless. Excl
GLOBAL_LIST_EMPTY(drones_list)
GLOBAL_LIST_EMPTY(dead_mob_list) //all dead mobs, including clientless. Excludes /mob/dead/new_player
GLOBAL_LIST_EMPTY(joined_player_list) //all clients that have joined the game at round-start or as a latejoin.
GLOBAL_LIST_EMPTY(new_player_list) //all /mob/dead/new_player, in theory all should have clients and those that don't are in the process of spawning and get deleted when done.
GLOBAL_LIST_EMPTY(silicon_mobs) //all silicon mobs
GLOBAL_LIST_EMPTY(mob_living_list) //all instances of /mob/living and subtypes
GLOBAL_LIST_EMPTY(carbon_list) //all instances of /mob/living/carbon and subtypes, notably does not contain brains or simple animals
Expand Down
3 changes: 3 additions & 0 deletions code/controllers/configuration/configuration.dm
Original file line number Diff line number Diff line change
Expand Up @@ -422,6 +422,9 @@ Example config:
if(probabilities[M.config_tag]<=0)
qdel(M)
continue
if(CONFIG_GET(flag/modetier_voting) && !(M.config_tag in SSvote.stored_modetier_results))
qdel(M)
continue
if(min_pop[M.config_tag])
M.required_players = min_pop[M.config_tag]
if(max_pop[M.config_tag])
Expand Down
12 changes: 5 additions & 7 deletions code/controllers/configuration/entries/dbconfig.dm
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
protection = CONFIG_ENTRY_LOCKED | CONFIG_ENTRY_HIDDEN

/datum/config_entry/number/query_debug_log_timeout
default = 70
config_entry_value = 70
min_val = 1
protection = CONFIG_ENTRY_LOCKED
deprecated_by = /datum/config_entry/number/blocking_query_timeout
Expand All @@ -36,19 +36,17 @@
return value

/datum/config_entry/number/async_query_timeout
default = 10
config_entry_value = 10
min_val = 0
protection = CONFIG_ENTRY_LOCKED

/datum/config_entry/number/blocking_query_timeout
default = 5
config_entry_value = 5
min_val = 0
protection = CONFIG_ENTRY_LOCKED

/datum/config_entry/number/bsql_thread_limit
default = 50
config_entry_value = 50
min_val = 1

/datum/config_entry/number/max_concurrent_queries
default = 25
min_val = 1
/datum/config_entry/flag/bsql_debug
9 changes: 0 additions & 9 deletions code/controllers/configuration/entries/general.dm
Original file line number Diff line number Diff line change
Expand Up @@ -519,12 +519,3 @@
// via send2chat("Hello world.", CONFIG_GET(string/discord_channel_serverstatus))
/datum/config_entry/string/discord_channel_serverstatus
config_entry_value = "server_status"

/datum/config_entry/number/hard_deletes_overrun_threshold
integer = FALSE
min_val = 0
default = 0.5

/datum/config_entry/number/hard_deletes_overrun_limit
default = 0
min_val = 0
Loading

0 comments on commit acb8519

Please sign in to comment.