From 5d8505896dfcd93087a86db623d38190be0ef519 Mon Sep 17 00:00:00 2001
From: Mahtra <93822896+MahtraDR@users.noreply.github.com>
Date: Thu, 5 Dec 2024 16:57:27 +1300
Subject: [PATCH] [scripts][dependency] Update for Elanthia Online
Removes custom status URL options, and changes all references to rpherbig's repo to Elanthia Online.
---
dependency.lic | 87 +++-----------------------------------------------
1 file changed, 4 insertions(+), 83 deletions(-)
diff --git a/dependency.lic b/dependency.lic
index fe821267e9..e552b7e74e 100644
--- a/dependency.lic
+++ b/dependency.lic
@@ -10,7 +10,7 @@ require 'ostruct'
require 'digest/sha1'
require 'monitor'
-$DEPENDENCY_VERSION = '1.7.11'
+$DEPENDENCY_VERSION = '2.0'
$MIN_RUBY_VERSION = '3.2.2'
DRINFOMON_IN_CORE_LICH ||= false
DRINFOMON_CORE_LICH_DEFINES ||= []
@@ -196,7 +196,7 @@ class ScriptManager
unless LICH_VERSION.match?(/^5/)
_respond("*****************************************************************************")
_respond("* Unsupported Lich versions detected. *")
- _respond("* Please see https://github.com/rpherbig/dr-scripts/wiki/First-Time-Setup *")
+ _respond("* See https://github.com/elanthia-online/dr-scripts/wiki/First-Time-Setup *")
_respond("* For an update path. *")
_respond("*****************************************************************************")
exit
@@ -206,9 +206,7 @@ class ScriptManager
@paste_bin_token = 'dca351a27a8af501a8d3123e29af7981'
@paste_bin_url = 'https://pastebin.com/api/api_post.php'
@firebase_url = 'https://dr-scripts.firebaseio.com/'
- @status_repo = Settings['status_repo'] || 'rpherbig/dr-scripts'
- @status_branch = Settings['status_branch'] || 'main'
- update_status_url
+ @status_url = 'https://api.github.com/repos/elanthia-online/dr-scripts/git/trees/main'
# Gating setting lich_url on lich version
UserVars.autostart_scripts ||= []
@@ -253,65 +251,6 @@ class ScriptManager
@autostarts = (UserVars.autostart_scripts + Settings['autostart']).uniq
end
- 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'
- 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)
- @status_url = defaulturl
- _respond Lich::Messaging.monsterbold("Using set Status URL. #{defaulturl}")
- elsif url_exist?(mainurl)
- _respond Lich::Messaging.monsterbold("Using alternate Status URL. #{mainurl}")
- @status_url = mainurl
- elsif url_exist?(eo_drscripts)
- _respond Lich::Messaging.monsterbold("Using Elanthia Online Status URL. #{eo_drscripts}")
- @status_url = eo_drscripts
- else
- _respond Lich::Messaging.monsterbold("Could not set Status URL. Please seek help on Discord.")
- end
- end
-
- def url_exist?(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
- res = req.request_head(path || '/')
- res.code != "404" # false if returns 404 - not found
- rescue Errno::ENOENT, URI::InvalidURIError
- false # false if can't find the server, or URI invalid somehow
- end
-
- def set_custom_status_repo(repo, branch)
- @status_repo = repo
- @status_branch = branch
- update_status_url
- end
-
- def set_custom_status_branch(branch)
- @status_branch = branch
- update_status_url
- end
-
- def unset_custom_status
- @status_repo = 'rpherbig/dr-scripts'
- @status_branch = 'main'
- update_status_url
- end
-
- def check_custom_status
- @status_url
- end
-
def add_global_auto(script)
@add_autos << script
end
@@ -351,8 +290,6 @@ class ScriptManager
def run_queue
validate_supported_ruby_version
- Settings['status_repo'] = @status_repo
- Settings['status_branch'] = @status_branch
update = false
unless @add_autos.empty?
@@ -1637,7 +1574,7 @@ def verify_script(script_names)
.reject { |name| Script.exists?(name) }
.each do |name|
echo "Failed to find a script named '#{name}'"
- echo "Please report this to "
+ echo "Please report this to "
echo "or to Discord "
state = false
end
@@ -1728,22 +1665,6 @@ def stop_autostart(script_names)
end
end
-def set_custom_status_repo(repo, branch = 'main')
- $manager.set_custom_status_repo(repo, branch)
-end
-
-def set_custom_status_branch(branch)
- $manager.set_custom_status_branch(branch)
-end
-
-def unset_custom_status
- $manager.unset_custom_status
-end
-
-def check_custom_status
- echo $manager.check_custom_status
-end
-
def setup_profiles
$manager.setup_profiles
end