From 40971dfef968afcbbe7ef8bd052cc6e8fa71a2fe Mon Sep 17 00:00:00 2001 From: krampus Date: Tue, 22 Oct 2024 14:00:31 +0300 Subject: [PATCH] Loader fix --- .github/build.project.json | 2 +- .github/loader.deploy.project.json | 2 +- Loader/Version.rbxmx | 2 +- .../Server/Plugins/Astra/Core/Variables.luau | 14 +- MainModule/Server/Plugins/Astra/Version.rbxmx | 2 +- MainModule/Server/Plugins/Astra/init.luau | 164 +++++++++--------- 6 files changed, 91 insertions(+), 95 deletions(-) diff --git a/.github/build.project.json b/.github/build.project.json index 15e4f06..778ce8c 100644 --- a/.github/build.project.json +++ b/.github/build.project.json @@ -5,7 +5,7 @@ "MainModule": { "$path": "../MainModule" }, - "Adonis_Loader": { + "Astra_Loader": { "$className": "Model", "$path": "../Loader" } diff --git a/.github/loader.deploy.project.json b/.github/loader.deploy.project.json index f677edc..f31ab08 100644 --- a/.github/loader.deploy.project.json +++ b/.github/loader.deploy.project.json @@ -4,4 +4,4 @@ "$className": "Folder", "$path": "../Loader" } -} +} \ No newline at end of file diff --git a/Loader/Version.rbxmx b/Loader/Version.rbxmx index 1767d1b..9920289 100644 --- a/Loader/Version.rbxmx +++ b/Loader/Version.rbxmx @@ -8,7 +8,7 @@ Version -1 - 235 + 3.0.1 diff --git a/MainModule/Server/Plugins/Astra/Core/Variables.luau b/MainModule/Server/Plugins/Astra/Core/Variables.luau index a4fb875..237610c 100644 --- a/MainModule/Server/Plugins/Astra/Core/Variables.luau +++ b/MainModule/Server/Plugins/Astra/Core/Variables.luau @@ -15,7 +15,7 @@ return function(Vargs) Moderator = {Name = "SERVER"}; Reason = "The maze wasn't meant for you." }; - server.Variables.Version = script.Parent.Parent.Version.Value; + server.Variables.Version = "v3.0.1" server.Variables.Messages = { Ban = ""; TrelloBan = ""; @@ -31,14 +31,4 @@ return function(Vargs) server.Variables.DonorPass = {658237163,3497976,721481162}; server.Variables.CustomDeps = server.Deps.Kronos; - --TODO: MAKE THIS A TABLE IN SETTINGS AND FETCH IT FROM THERE - -- server.Variables.Messages.Ban = table.concat(server.Settings.BanMessage, "\n") - -- server.Variables.Messages.TrelloBan = table.concat(server.Settings.TrelloBanMessage, "\n") - -- server.Variables.Messages.TimeBan = table.concat(server.Settings.TimeBanMessage, "\n") - -- server.Variables.Messages.GameBan = table.concat(server.Settings.GameBanMessage, "\n") - -- server.Variables.Messages.Lock = table.concat(server.Settings.LockMessage, "\n") - --server.Variables.Messages.Whitelist = table.concat(server.Settings.NotWhitelistedMessage, "\n") - --server.Variables.Messages.FailedJoinFilter = table.concat(server.Settings.FailedJoinFilter, "\n") - - --// WIll just handle it here.... -end +end \ No newline at end of file diff --git a/MainModule/Server/Plugins/Astra/Version.rbxmx b/MainModule/Server/Plugins/Astra/Version.rbxmx index 6e513f3..ca58ef0 100644 --- a/MainModule/Server/Plugins/Astra/Version.rbxmx +++ b/MainModule/Server/Plugins/Astra/Version.rbxmx @@ -10,7 +10,7 @@ Version -1 - v2.7.0 + v3.0.1 \ No newline at end of file diff --git a/MainModule/Server/Plugins/Astra/init.luau b/MainModule/Server/Plugins/Astra/init.luau index 74c06bd..6876ed2 100644 --- a/MainModule/Server/Plugins/Astra/init.luau +++ b/MainModule/Server/Plugins/Astra/init.luau @@ -8,7 +8,7 @@ return function(Vargs) local Admin = server.Admin local Process = server.Process local Settings = server.Settings - local Functions = server.Functions; + local Functions = server.Functions local Commands = server.Commands local Remote = server.Remote local Deps = server.Deps @@ -23,19 +23,23 @@ return function(Vargs) } end - Variables.Version = VersionInstance.Value + pcall(function() + Variables.Version = VersionInstance.Value + end) - Logs.AddLog(Logs.Script, "Loading Astra..."); + Logs.AddLog(Logs.Script, "Loading Astra...") local function loadAstraModule(plugin) - local Success, ErrorMessage = pcall(server.LoadModule, plugin, false, { script = plugin }, true); - - local pluginName = (plugin.Parent) and `{plugin.Parent.Name}/{plugin.Name}` or plugin.Name - + local Success, ErrorMessage = pcall(server.LoadModule, plugin, false, { script = plugin }, true) + + local pluginName = plugin.Parent and `{plugin.Parent.Name}/{plugin.Name}` or plugin.Name + Logs.AddLog(if Success then Logs.Script else Logs.Errors, { - Text = if Success then `Astra Successfully loaded a core module or plugin: {pluginName or ""}` else `Failed to load an Astra core module or plugin: {pluginName or ""}`; - Desc = if Success then `Successfully loaded {pluginName}` else ErrorMessage; - }); + Text = if Success + then `Astra Successfully loaded a core module or plugin: {pluginName or ""}` + else `Failed to load an Astra core module or plugin: {pluginName or ""}`, + Desc = if Success then `Successfully loaded {pluginName}` else ErrorMessage, + }) plugin.Archivable = false --// Some "Security" this is ;) plugin.Parent = nil @@ -48,83 +52,85 @@ return function(Vargs) end for _, plugin in script:FindFirstChild("Core"):GetChildren() do - if plugin:GetAttribute('Disabled') then - continue; - end; - loadAstraModule(plugin); - end; + if plugin:GetAttribute("Disabled") then + continue + end + loadAstraModule(plugin) + end for _, plugin in script.Modules:GetDescendants() do - if string.match(plugin.Name, "^%[Disabled%] ") or plugin:GetAttribute('Disabled') then - continue; - end; + if string.match(plugin.Name, "^%[Disabled%] ") or plugin:GetAttribute("Disabled") then + continue + end + + if plugin:IsA("ModuleScript") and plugin.Parent:IsA("Folder") then + task.spawn(loadAstraModule, plugin) + end + end - if plugin:IsA("ModuleScript") and plugin.Parent:IsA('Folder') then - task.spawn(loadAstraModule,plugin) - end; - end; - if not Settings.CustomKickMessages then Settings.CustomKickMessages = { BanMessage = { - ""; - "▬▬▬▬ Astra ▬▬▬▬"; - ""; - "You are server-banned!"; - "Reason: {reason}"; - "Time: {time}"; - ""; - "▬▬▬▬ BinaryBridge ▬▬▬▬"; - ""; - }; - TrelloBanMessage = { - ""; - "▬▬▬▬ Astra ▬▬▬▬"; - ""; - "You are Trello-Banned!"; - "Reason: {reason}"; - "Time: {time}"; - ""; - "▬▬▬▬ BinaryBridge ▬▬▬▬"; - ""; - }; - TimeBanMessage = { --// Shown if a player is Timebanned in-game - ""; - "▬▬▬▬ Astra ▬▬▬▬"; - ""; - "You are Timebanned!"; - "Reason: {reason}"; - "Time: {time}"; - "Expires: {expiretime}"; - "Time remaining: {remainingtime}"; - ""; - "▬▬▬▬ BinaryBridge ▬▬▬▬"; - ""; - }; + "", + "▬▬▬▬ Astra ▬▬▬▬", + "", + "You are server-banned!", + "Reason: {reason}", + "Time: {time}", + "", + "▬▬▬▬ BinaryBridge ▬▬▬▬", + "", + }, + TrelloBanMessage = { + "", + "▬▬▬▬ Astra ▬▬▬▬", + "", + "You are Trello-Banned!", + "Reason: {reason}", + "Time: {time}", + "", + "▬▬▬▬ BinaryBridge ▬▬▬▬", + "", + }, + TimeBanMessage = { --// Shown if a player is Timebanned in-game + "", + "▬▬▬▬ Astra ▬▬▬▬", + "", + "You are Timebanned!", + "Reason: {reason}", + "Time: {time}", + "Expires: {expiretime}", + "Time remaining: {remainingtime}", + "", + "▬▬▬▬ BinaryBridge ▬▬▬▬", + "", + }, GameBan = { --// Shown if a player tries to join a locked server - ""; - "▬▬▬▬ Astra ▬▬▬▬"; - ""; - "You did not pass a Join Filter"; - "FILTER: {filter}"; - "ERROR: {error}"; - ""; - "▬▬▬▬ BinaryBridge ▬▬▬▬"; - ""; - } ; + "", + "▬▬▬▬ Astra ▬▬▬▬", + "", + "You did not pass a Join Filter", + "FILTER: {filter}", + "ERROR: {error}", + "", + "▬▬▬▬ BinaryBridge ▬▬▬▬", + "", + }, FailedJoinFilter = { --// Shown if a player tries to join a locked server - ""; - "▬▬▬▬ Astra ▬▬▬▬"; - ""; - "You are gamebanned!"; - "Reason: {reason}"; - ""; - "▬▬▬▬ BinaryBridge ▬▬▬▬"; - ""; - } + "", + "▬▬▬▬ Astra ▬▬▬▬", + "", + "You are gamebanned!", + "Reason: {reason}", + "", + "▬▬▬▬ BinaryBridge ▬▬▬▬", + "", + }, } - warn('Settings.CustomKickMessages is not set! Custom kick messages will not work. This message will only display once until the issue is fixed') - end; + warn( + "Settings.CustomKickMessages is not set! Custom kick messages will not work. This message will only display once until the issue is fixed" + ) + end Settings.CustomKickMessages.AntiKickMessage = Variables.AntiKickMessage - Logs.AddLog(Logs.Script, "Done loading Astra Core Modules"); + Logs.AddLog(Logs.Script, "Done loading Astra Core Modules") end