From f24af4140a2f84a0fbbd55141d5f5c6447bc3213 Mon Sep 17 00:00:00 2001 From: Rob Palkowski Date: Mon, 7 May 2012 18:40:07 -0700 Subject: [PATCH] Allow server to initialize the world without any players connected. Without this patch, the first user had to wait for the server to actually initialize the game. During this time the main window of the client is not responsive to input. Now, when the first player connects, they will see a fully initialized and responsive lobby. --- code/game/algorithm.dm | 3 +-- code/game/cellautomata.dm | 4 +--- code/game/master_controller.dm | 8 +++++++- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/code/game/algorithm.dm b/code/game/algorithm.dm index 2b1740237a5..814643af6a3 100644 --- a/code/game/algorithm.dm +++ b/code/game/algorithm.dm @@ -27,7 +27,6 @@ Today, these people were mean: LoadBans() process_teleport_locs() //Sets up the wizard teleport locations process_ghost_teleport_locs() //Sets up ghost teleport locations. - sleep_offline = 1 if (config.kick_inactive) spawn(30) @@ -201,4 +200,4 @@ proc/countJob(rank) var/mob/M = T.host if(M.client && M.machine == subject) subject.attack_hand(M) -*/ \ No newline at end of file +*/ diff --git a/code/game/cellautomata.dm b/code/game/cellautomata.dm index b05d22e526d..a862f4cc681 100644 --- a/code/game/cellautomata.dm +++ b/code/game/cellautomata.dm @@ -106,8 +106,6 @@ ..() - sleep(50) - plmaster = new /obj/effect/overlay( ) plmaster.icon = 'tile_effects.dmi' plmaster.icon_state = "plasma" @@ -196,4 +194,4 @@ /obj/effect/decal/point/point() set src in oview() set hidden = 1 - return \ No newline at end of file + return diff --git a/code/game/master_controller.dm b/code/game/master_controller.dm index 8d59a0f3d0e..c6e237935a7 100644 --- a/code/game/master_controller.dm +++ b/code/game/master_controller.dm @@ -47,6 +47,12 @@ datum/controller/game_controller world.tick_lag = config.Ticklag + // Sleep for about 5 seconds to allow background initialization procs to finish + sleep(50) + + // Now that the game is world is fully initialized, pause server until a user connects. + world.sleep_offline = 1 + setup_objects() setupgenetics() @@ -235,4 +241,4 @@ datum/controller/game_controller else for (var/mob/M in world) if (M.client && M.client.holder) - M << " The Master Controller has fired. Automatic restart aborted." \ No newline at end of file + M << " The Master Controller has fired. Automatic restart aborted."