Skip to content

Commit

Permalink
Loader fix
Browse files Browse the repository at this point in the history
  • Loading branch information
EasternBloxxer committed Oct 22, 2024
1 parent f488fb1 commit 40971df
Show file tree
Hide file tree
Showing 6 changed files with 91 additions and 95 deletions.
2 changes: 1 addition & 1 deletion .github/build.project.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"MainModule": {
"$path": "../MainModule"
},
"Adonis_Loader": {
"Astra_Loader": {
"$className": "Model",
"$path": "../Loader"
}
Expand Down
2 changes: 1 addition & 1 deletion .github/loader.deploy.project.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
"$className": "Folder",
"$path": "../Loader"
}
}
}
2 changes: 1 addition & 1 deletion Loader/Version.rbxmx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<string name="Name">Version</string>
<int64 name="SourceAssetId">-1</int64>
<BinaryString name="Tags"></BinaryString>
<double name="Value">235</double>
<double name="Value">3.0.1</double>
</Properties>
</Item>
</roblox>
14 changes: 2 additions & 12 deletions MainModule/Server/Plugins/Astra/Core/Variables.luau
Original file line number Diff line number Diff line change
Expand Up @@ -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 = "";
Expand All @@ -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
2 changes: 1 addition & 1 deletion MainModule/Server/Plugins/Astra/Version.rbxmx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<string name="Name">Version</string>
<int64 name="SourceAssetId">-1</int64>
<BinaryString name="Tags"></BinaryString>
<string name="Value">v2.7.0</string>
<string name="Value">v3.0.1</string>
</Properties>
</Item>
</roblox>
164 changes: 85 additions & 79 deletions MainModule/Server/Plugins/Astra/init.luau
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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

0 comments on commit 40971df

Please sign in to comment.