diff --git a/Novetus/NovetusCore/StorageAndFunctions/GlobalPaths.cs b/Novetus/NovetusCore/StorageAndFunctions/GlobalPaths.cs index 63e508a..bb357f5 100644 --- a/Novetus/NovetusCore/StorageAndFunctions/GlobalPaths.cs +++ b/Novetus/NovetusCore/StorageAndFunctions/GlobalPaths.cs @@ -112,6 +112,7 @@ public class GlobalPaths public static readonly string ConsoleHelpFileName = "consolehelp.txt"; public static readonly string ClientScriptDocumentationFileName = "documentation.txt"; public static readonly string AddonLoaderFileName = "AddonLoader.lua"; + public static readonly string AssetFixerPatternFileName = "assetfixer_pattern.txt"; #endregion } #endregion diff --git a/Novetus/NovetusCore/StorageAndFunctions/NovetusFuncs.cs b/Novetus/NovetusCore/StorageAndFunctions/NovetusFuncs.cs index 06b7e7b..3b247af 100644 --- a/Novetus/NovetusCore/StorageAndFunctions/NovetusFuncs.cs +++ b/Novetus/NovetusCore/StorageAndFunctions/NovetusFuncs.cs @@ -275,7 +275,14 @@ public class NovetusFuncs .Replace(baseurl + "/item.aspx?id=", str2); //...because scripts mess it up. + string id = fixedUrl.After("id="); + if (id.Contains("&version=")) + { + string ver = id.After("&version="); + id = id.Replace("&version=" + ver, ""); + } + string fixedID = Regex.Replace(id, "[^0-9]", ""); //really fucking hacky. diff --git a/Novetus/NovetusLauncher/Forms/SDK/AssetFixer.cs b/Novetus/NovetusLauncher/Forms/SDK/AssetFixer.cs index e1fd694..d6689ac 100644 --- a/Novetus/NovetusLauncher/Forms/SDK/AssetFixer.cs +++ b/Novetus/NovetusLauncher/Forms/SDK/AssetFixer.cs @@ -202,58 +202,64 @@ public partial class AssetFixer : Form { //https://stackoverflow.com/questions/10576686/c-sharp-regex-pattern-to-extract-urls-from-given-string-not-full-html-urls-but List links = new List(); - var linkParser = new Regex(@"https?:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_\+.~#?&//=;\[\]]*)", RegexOptions.Compiled | RegexOptions.IgnoreCase); - foreach (Match m in linkParser.Matches(line)) + + if (File.Exists(GlobalPaths.ConfigDir + "\\" + GlobalPaths.AssetFixerPatternFileName)) { - string link = m.Value; - links.Add(link); - } + string pattern = File.ReadAllText(GlobalPaths.ConfigDir + "\\" + GlobalPaths.AssetFixerPatternFileName); - foreach (string link in links) - { - if (link.Contains(".png") || link.Contains(".jpg") || link.Contains(".jpeg")) + var linkParser = new Regex(pattern, RegexOptions.Compiled | RegexOptions.IgnoreCase); + foreach (Match m in linkParser.Matches(line)) { - continue; + string link = m.Value; + links.Add(link); } - if (link.Contains("my-roblox-character-item")) + foreach (string link in links) { - continue; - } + if (link.Contains(".png") || link.Contains(".jpg") || link.Contains(".jpeg")) + { + continue; + } - string urlFixed = ""; + if (link.Contains("my-roblox-character-item")) + { + continue; + } - if (useURLs) - { - string oldurl = line; - urlFixed = NovetusFuncs.FixURLString(oldurl, url); - } - else - { - string newurl = ((!link.Contains("http://") || !link.Contains("https://")) ? "https://" : "") - + "assetdelivery.roblox.com/v1/asset/?id="; - string urlReplaced = newurl.Contains("https://") ? link.Replace("http://", "").Replace("https://", "") : link.Replace("http://", "https://"); - urlFixed = NovetusFuncs.FixURLString(urlReplaced, newurl); - } + string urlFixed = ""; - string peram = "id="; - - if (urlFixed.Contains(peram)) - { if (useURLs) { - file[index - 1] = file[index - 1].Replace(link, urlFixed); + string oldurl = line; + urlFixed = NovetusFuncs.FixURLString(oldurl, url); } else { - string IDVal = urlFixed.After(peram); - RobloxXML.DownloadFilesFromNode(urlFixed, savefilepath, "", IDVal); - file[index - 1] = file[index - 1].Replace(link, inGameDir + IDVal); + string newurl = ((!link.Contains("http://") || !link.Contains("https://")) ? "https://" : "") + + "assetdelivery.roblox.com/v1/asset/?id="; + string urlReplaced = newurl.Contains("https://") ? link.Replace("http://", "").Replace("https://", "") : link.Replace("http://", "https://"); + urlFixed = NovetusFuncs.FixURLString(urlReplaced, newurl); + } + + string peram = "id="; + + if (urlFixed.Contains(peram)) + { + if (useURLs) + { + file[index - 1] = file[index - 1].Replace(link, urlFixed); + } + else + { + string IDVal = urlFixed.After(peram); + RobloxXML.DownloadFilesFromNode(urlFixed, savefilepath, "", IDVal); + file[index - 1] = file[index - 1].Replace(link, inGameDir + IDVal); + } } } - } - ProgressChangedEvent(); + ProgressChangedEvent(); + } } else { diff --git a/changelog.txt b/changelog.txt index 6c338ad..044c367 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,3 +1,12 @@ +1.3 Snapshot v22.8337.28204.1 +Enhancements: +- Added the following Place Contest (Halloween 2022) entries: + - Atomic - Spooking Out +- The Asset Fixer's Regex pattern is now accessible in config/assetfixer_pattern.txt. + +Fixes: +- Fixed the Asset Fixer incorrectly removing end quotes in scripts. (") +---------------------------------------------------------------------------- 1.3 Snapshot v22.8327.19048.1 Notes: - Cut 2012M temporarily to focus on fixing bugs for the next update's release. diff --git a/scripts/assetfixer_gauntlet.lua b/scripts/assetfixer_gauntlet.lua new file mode 100644 index 0000000..3141e63 --- /dev/null +++ b/scripts/assetfixer_gauntlet.lua @@ -0,0 +1,61 @@ +-- link - single quote +'https://assetdelivery.roblox.com/v1/asset?id=1818' +-- link - double quote +"https://assetdelivery.roblox.com/v1/asset?id=1818" +-- xml +https://assetdelivery.roblox.com/v1/asset?id=1818 + +-- link - single quote, w/ space +'https://assetdelivery.roblox.com/v1/asset?id=1818 ' +-- link - double quote, w/ space +"https://assetdelivery.roblox.com/v1/asset?id=1818 " +-- xml, w/ space +https://assetdelivery.roblox.com/v1/asset?id=1818 + +--just the link. no spaces. +https://assetdelivery.roblox.com/v1/asset?id=1818 +--a variation of a roblox link +http://www.roblox.com/asset/?version=1&id=1818 +--another variation of a roblox link +http://www.roblox.com/asset/?version=1&id=1818 +--another possible variation +http://www.roblox.com/asset/?id=1818&version=1 +--another one +http://www.roblox.com/asset/?id=1818&version=1 +--quotation link +"http://www.roblox.com/asset/?id=[ID]" + +-- script snippet +game:GetService("ContentProvider"):Preload("http://www.roblox.com/asset/?id="..images[m]) +l.Image = "http://www.roblox.com/asset/?id="..images[m] + +--spooking out snippet +{"Boing", "http://novetus.me/asset?id=12222124", 2.509},--2 + +--recreated menderman snippet +mesh7.MeshId = "http://www.roblox.com/asset/?id=17659272" +mesh7.MeshId = "http://www.roblox.com/asset/?id=17659272" + +--snippet from survive the spheres +Badges = {[0] = 30058718, [100] = 29890585, [200] = 29918752, [400] = 30057939} +Playing = {} +Tutorial = {"http://www.roblox.com/asset/?id=30093873", "http://www.roblox.com/asset/?id=30093900", "http://www.roblox.com/asset/?id=30093954", "http://www.roblox.com/asset/?id=30094010", "http://www.roblox.com/asset/?id=30094028", "http://www.roblox.com/asset/?id=30094049"} +BallName = "bawlz" +Base = workspace.Base +CountDownTime = 15 +Siz = 8 +Size = Vector3.new(Siz, Siz, Siz) +Multiplier = 1 +SuckSpeed = 1.5 +SuckSoundId = "http://www.roblox.com/asset/?id=10722059" +TickSoundId = "rbxasset://sounds\\clickfast.wav" +PingSoundId = "http://www.roblox.com/asset/?id=13114759" +HorrorSoundId = "http://www.roblox.com/asset/?id=2767085" +LostSoundId = "http://www.roblox.com/asset/?id=13378571" +WonSoundId = "http://www.roblox.com/asset/?id=15632562" +EatTime = 2 +BallMass = 15000 +copyrate = 15 +Powerups = {} +Lobby = script.Parent.Lobby +VipId = 28197859 \ No newline at end of file diff --git a/scripts/batch/github_sync.bat b/scripts/batch/github_sync.bat index 0305011..e6183a9 100644 --- a/scripts/batch/github_sync.bat +++ b/scripts/batch/github_sync.bat @@ -146,6 +146,7 @@ XCOPY "%cd%\clean_junk.bat" "%scriptsdir%\batch" /y XCOPY "%cd%\github_sync.bat" "%scriptsdir%\batch" /y XCOPY "%cd%\create_lite.bat" "%scriptsdir%\batch" /y XCOPY "%cd%\liteexclude.txt" "%scriptsdir%\batch" /y +XCOPY "%cd%\assetfixer_gauntlet.lua" "%scriptsdir%" /y XCOPY "%cd%\Novetus\Novetus_dependency_installer.bat" "%scriptsdir%\batch" /y XCOPY "%cd%\litefiles\Novetus_dependency_installer.bat" "%scriptsdir%\batch\Novetus_dependency_installer_lite.bat*" /y XCOPY "%cd%\Novetus\Novetus_launcher_legacy.bat" "%scriptsdir%\batch" /y diff --git a/scripts/launcher/splashes.txt b/scripts/launcher/splashes.txt index a7fb191..d379168 100644 --- a/scripts/launcher/splashes.txt +++ b/scripts/launcher/splashes.txt @@ -238,4 +238,5 @@ Everything is possible with Lava Gang. Don't fence me in! Pick it Up!|Ima Say Ma Namowa Put it Down!|Ima Say Ma Namowa -Down with Monogon! \ No newline at end of file +Down with Monogon! +allows the user to use W... \ No newline at end of file