Skip to content

Commit

Permalink
Merge pull request #6981 from MahtraDR/dependency_fix
Browse files Browse the repository at this point in the history
[scripts][dependency} Fixes bad status_url
  • Loading branch information
MahtraDR authored Nov 13, 2024
2 parents 89a2573 + a00a344 commit 5e6d1f4
Showing 1 changed file with 9 additions and 11 deletions.
20 changes: 9 additions & 11 deletions dependency.lic
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ require 'ostruct'
require 'digest/sha1'
require 'monitor'

$DEPENDENCY_VERSION = '1.7.7'
$DEPENDENCY_VERSION = '1.7.9'
$MIN_RUBY_VERSION = '3.2.2'
DRINFOMON_IN_CORE_LICH ||= false

Expand Down Expand Up @@ -244,14 +244,14 @@ class ScriptManager
def update_status_url
defaulturl = 'https://api.github.com/repos/' + @status_repo + '/git/trees/' + @status_branch
mainurl = 'https://api.github.com/repos/rpherbig/dr-scripts/git/trees/main'
fallbackurl = 'https://api.github.com/repos/rpherbig/dr-scripts/git/trees/main'
eo_drscripts = 'https://api.github.com/repos/elanthia-online/dr-scripts/git/trees/main'

unless url_exist?(defaulturl)
_respond Lich::Messaging.monsterbold("Default URL #{defaulturl} not responding. Using an alternate repo+branch combination.")
_respond Lich::Messaging.monsterbold("Unsetting custom repo settings, if any.")
Settings['status_repo'] = nil if Settings['status_repo']
Settings['status_branch'] = nil if Settings['status_branch']
Settings.save
end

if url_exist?(defaulturl)
Expand All @@ -260,9 +260,6 @@ class ScriptManager
elsif url_exist?(mainurl)
_respond Lich::Messaging.monsterbold("Using alternate Status URL. #{mainurl}")
@status_url = mainurl
elsif url_exist?(fallbackurl)
_respond Lich::Messaging.monsterbold("Using fallback Status URL. #{fallbackurl}")
@status_url = fallbackurl
elsif url_exist?(eo_drscripts)
_respond Lich::Messaging.monsterbold("Using Elanthia Online Status URL. #{eo_drscripts}")
@status_url = eo_drscripts
Expand All @@ -272,7 +269,7 @@ class ScriptManager
end

def url_exist?(url_string)
url = URI.parse(url_string)
url = URI.parse(URI::Parser.new.escape(url_string))
req = Net::HTTP.new(url.host, url.port)
req.use_ssl = (url.scheme == 'https')
path = url.path
Expand Down Expand Up @@ -1606,8 +1603,8 @@ def custom_require
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']
echo("DRInfomon in core lich detected. Skipping loading drinfomon and commons") if UserVars.bootstrap_debug
script_names -= %W(drinfomon common common-arcana common-crafting common-healing common-healing-data common-items common-money common-moonmage common-summoning common-theurgy common-travel common-validation events slackbot equipmanager spellmonitor)
end
bootstrapper = force_start_script('bootstrap', script_names)
pause 0.05
Expand Down Expand Up @@ -1734,6 +1731,7 @@ def setup_profiles
end

def setup_data
echo("Force checking scripts/data files.")
$manager.setup_data
end

Expand Down Expand Up @@ -1783,7 +1781,7 @@ end

def update_d
echo('Restarting Dependency in 2 seconds...')
force_start_script('bootstrap', ['wipe_constants'])
force_start_script('bootstrap', ['wipe_constants']) unless DRINFOMON_IN_CORE_LICH
before_dying do
sleep 2
force_start_script('dependency')
Expand Down Expand Up @@ -1833,7 +1831,7 @@ end

full_install if install

force_start_script('bootstrap', ['wipe_constants'])
force_start_script('bootstrap', ['wipe_constants']) unless DRINFOMON_IN_CORE_LICH

# Proactively starting DRinfomon as script zero to prevent
# race conditions involving this script which so many other
Expand All @@ -1849,7 +1847,7 @@ 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)
Lich::Util.issue_command("ability", /^You (know the Berserks|recall the spells you have learned from your training)/, /^You (recall that you have 9 training sessions|can use SPELL STANCE [HELP])/, quiet: true)
Lich::Util.issue_command("ability", /^You (know the Berserks|recall the spells you have learned from your training)/, /^You (recall that you have \d+ training sessions|can use SPELL STANCE \[HELP\]|have \d+ available slot)/, quiet: true)
end

$manager.check_base_files
Expand Down

0 comments on commit 5e6d1f4

Please sign in to comment.