Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[scripts][dependency][bootstrap] Prep for when drinfomon is in core lich #6947

Merged
merged 2 commits into from
Oct 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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_CORE_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
Loading