Skip to content

Commit

Permalink
[scripts][dependency][bootstrap] Prep for when drinfomon is in core lich
Browse files Browse the repository at this point in the history
  • Loading branch information
MahtraDR committed Oct 26, 2024
1 parent 0e37649 commit 7de48cb
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 5 deletions.
8 changes: 7 additions & 1 deletion bootstrap.lic
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Documentation: https://elanthipedia.play.net/Lich_script_development#bootstrap
=end

$BOOTSTRAP_VERSION = '1.0.1'
$BOOTSTRAP_VERSION = '1.0.2'

class_defs = {
'drinfomon' => :DRINFOMON,
Expand Down Expand Up @@ -60,6 +60,12 @@ end

scripts_to_run = args.flex || []
echo scripts_to_run.to_s if UserVars.bootstrap_debug

if scripts_to_run.include?("drinfomon") && DRINFOMON_IN_CODE_LICH
scripts_to_run -= ['drinfomon']
echo("Removing drinfomon from scripts_to_run") if UserVars.bootstrap_debug
end

until scripts_to_run.empty?
script_to_run = scripts_to_run.shift
respond("BS:#{script_to_run}:#{scripts_to_run}") if UserVars.bootstrap_debug
Expand Down
22 changes: 18 additions & 4 deletions dependency.lic
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@ require 'ostruct'
require 'digest/sha1'
require 'monitor'

$DEPENDENCY_VERSION = '1.7.3'
$DEPENDENCY_VERSION = '1.7.4'
$MIN_RUBY_VERSION = '3.2.2'
DRINFOMON_IN_CORE_LICH ||= false

no_pause_all
no_kill_all
Expand Down Expand Up @@ -1567,6 +1568,10 @@ def custom_require
lambda do |script_names|
script_names = [script_names] unless script_names.is_a?(Array)
respond("CR:starting:#{script_names}") if UserVars.bootstrap_debug
if DRINFOMON_IN_CORE_LICH
echo("DRInfomon in core lich detected. Skipping loading drinfomon.lic") if UserVars.bootstrap_debug
script_names -= ['drinfomon']
end
bootstrapper = force_start_script('bootstrap', script_names)
pause 0.05
while Script.running.include?(bootstrapper)
Expand Down Expand Up @@ -1794,9 +1799,18 @@ force_start_script('bootstrap', ['wipe_constants'])
# Proactively starting DRinfomon as script zero to prevent
# race conditions involving this script which so many other
# scripts depend on, and which is slow to start on its own
echo("Starting DRinfomon, this will take a few seconds.")
custom_require.call('drinfomon')
echo("DRinfomon ready.")
unless DRINFOMON_IN_CORE_LICH
echo("Starting DRinfomon, this will take a few seconds.")

custom_require.call('drinfomon')

echo("DRinfomon ready.")
end

if DRINFOMON_IN_CORE_LICH
Lich::Util.issue_command("exp all 0", /^Circle: \d+/, /^Rested EXP Stored|Unlock Rested Experience|type: AWAKEN/, quiet: true)
Lich::Util.issue_command("info", /^Name/, /^<output class=""/, quiet: true)
end

$manager.check_base_files
$manager.check_data_files
Expand Down

0 comments on commit 7de48cb

Please sign in to comment.