Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
819522d
Re-add panic mode
ccuser44 May 29, 2025
061e8a1
Add backwards compatibility for legacy panic
ccuser44 May 29, 2025
fb96702
Flip legacy flag
ccuser44 May 29, 2025
cab7a67
Disable client checks if panicmode is on
ccuser44 May 29, 2025
9d85806
Re-enable panic for failed remote creation
ccuser44 May 29, 2025
dafa042
Make UI functions use backup method if panicmode is on
ccuser44 May 29, 2025
b046852
Create BackupNotification.server.luau
ccuser44 May 29, 2025
e43df56
Create BackupNotification.meta.json
ccuser44 May 29, 2025
c1a1a02
Enable panic mode for all critical errors
ccuser44 May 29, 2025
3a885b2
Move changelog formatting to a plugin
ccuser44 May 29, 2025
a9fc2b1
Move changelog formatting to a plugin
ccuser44 May 29, 2025
3620cbe
Support unformatted changelogs
ccuser44 May 29, 2025
b0cbc8d
Support unformatted changelogs
ccuser44 May 29, 2025
d569553
Move changelog formatting to a plugin
ccuser44 May 29, 2025
c2056a9
Move changelog formatting to a plugin
ccuser44 May 29, 2025
7725481
Add panic command to terminal
ccuser44 May 29, 2025
4c13828
Add debug command for panic mode
ccuser44 May 29, 2025
c94cc70
Fix typo
ccuser44 May 29, 2025
2cce34b
Fix weird UTF8 character
ccuser44 May 29, 2025
59c3a7e
Test fix?
ccuser44 May 29, 2025
f42ff4d
Test fix???
ccuser44 May 29, 2025
47d8044
Add panicmode backup for setmessage
ccuser44 May 29, 2025
b8fa11b
Fix mystery error
ccuser44 May 29, 2025
a1f74dd
Better handling
ccuser44 May 29, 2025
7ea22de
Remove unnecessary protection
ccuser44 Jun 11, 2025
205f47b
Fix plugin error not working
ccuser44 Jun 11, 2025
6c730cb
Fix maticon pooling
ccuser44 Jun 11, 2025
4fdc52b
Fix "icon" not being mentioned, causing lint to fail
GalacticInspired Aug 27, 2025
cde7cd4
Merge branch 'master' into patch-27
GalacticInspired Aug 27, 2025
b69a14b
Remove random "%"??
GalacticInspired Aug 27, 2025
6fe157d
Merge branch 'patch-27' of https://github.com/ccuser44/Adonis into pr…
GalacticInspired Aug 27, 2025
ea93d2f
Fix tab in DebugPanic DebugSpecific
GalacticInspired Aug 27, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 0 additions & 23 deletions MainModule/Client/Client.luau
Original file line number Diff line number Diff line change
Expand Up @@ -569,29 +569,6 @@ return service.NewProxy({

client.Typechecker = oldReq(service_UnWrap(client.Shared.Typechecker))
client.Changelog = oldReq(service_UnWrap(client.Shared.Changelog))
client.FormattedChangelog = table.create(#client.Changelog)

--// Create formatted changelog from standard changelog
local function applyColour(line)
local prefix = line:sub(1, 2)

if prefix == "[v" or prefix == "[1" or prefix == "[0" or prefix == "1." or line:sub(1, 1) == "v" then
return `<font color='#8FAEFF'>{line}</font>`
elseif line:sub(1, 6) == "[Patch" then
return `<font color='#F0B654'>{line}</font>`
elseif line:sub(1, 9) == "Version: " then
return `<b>{line}</b>`
elseif line:sub(1,2) == "# " then
return `<b>{string.sub(line, 3)}</b>`
else
return line
end
end

log("Fomratting chatlogs")
for i, line in ipairs(client.Changelog) do
client.FormattedChangelog[i] = applyColour(line)
end

--// Setup MatIcons
log("Setting up material icons")
Expand Down
23 changes: 23 additions & 0 deletions MainModule/Client/Plugins/Misc_Features.luau
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,29 @@ return function(Vargs, GetEnv)
local Settings = client.Settings
local Functions, Anti, Core, Logs, Remote, Process, Variables = client.Functions, client.Anti, client.Core, client.Logs, client.Remote, client.Process, client.Variables

--// Create formatted changelog from standard changelog
local function applyColour(line)
local prefix = line:sub(1, 2)

if prefix == "[v" or prefix == "[1" or prefix == "[0" or prefix == "1." or line:sub(1, 1) == "v" then
return `<font color='#8FAEFF'>{line}</font>`
elseif line:sub(1, 6) == "[Patch" then
return `<font color='#F0B654'>{line}</font>`
elseif line:sub(1, 9) == "Version: " then
return `<b>{line}</b>`
elseif line:sub(1,2) == "# " then
return `<b>{string.sub(line, 3)}</b>`
else
return line
end
end

GetEnv({}).log("Fomratting chatlogs")
client.FormattedChangelog = table.create(#client.Changelog)
for i, line in ipairs(client.Changelog) do
client.FormattedChangelog[i] = applyColour(line)
end

-- // Backwards compatibility
local Pcall = client.Pcall
local function cPcall(func, ...)
Expand Down
2 changes: 1 addition & 1 deletion MainModule/Client/UI/Default/UserPanel.luau
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,7 @@ return function(data, env)
MouseButton1Down = function()
UI.Make("List", {
Title = "Changelog";
Table = client.FormattedChangelog;
Table = client.FormattedChangelog or client.Changelog;
RichText = true;
Size = {500, 400};
})
Expand Down
18 changes: 9 additions & 9 deletions MainModule/Server/Commands/Admins.luau
Original file line number Diff line number Diff line change
Expand Up @@ -432,19 +432,19 @@ return function(Vargs, env)
Description = "Sets a small hint message at the top of the screen";
AdminLevel = "Admins";
Function = function(plr: Player, args: {string})
assert(args[1], "Missing message (or enter 'off' to disable)")
local message = not (args[1] == "off" or args[1] == "false") and assert(args[1], "Missing message (or enter 'off' to disable)") or nil

if args[1] == "off" or args[1] == "false" then
Variables.NotifMessage = nil
for _, v in service.GetPlayers() do
Remote.RemoveGui(v, "Notif")
end
else
Variables.NotifMessage = args[1]
for _, v in service.GetPlayers() do
if server.PanicMode and server._tempBackupHint then
server._tempBackupHint.Text = `~= Adonis PanicMode Enabled{message and " - " or ""}{message or ""} =~`
end
Variables.NotifMessage = message
for _, v in service.GetPlayers() do
if Variables.NotifMessage then
Remote.MakeGui(v, "Notif", {
Message = Variables.NotifMessage;
})
else
Remote.RemoveGui(v, "Notif")
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion MainModule/Server/Commands/Players.luau
Original file line number Diff line number Diff line change
Expand Up @@ -543,7 +543,7 @@ return function(Vargs, env)
Remote.MakeGui(plr, "List", {
Title = "Change Log";
Icon = server.MatIcons["Text snippet"];
Table = server.FormattedChangelog;
Table = server.FormattedChangelog or server.Changelog;
RichText = true;
Size = {500, 400};
})
Expand Down
2 changes: 1 addition & 1 deletion MainModule/Server/Core/Anti.luau
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ return function(Vargs, GetEnv)

CheckAllClients = function()
--// Check if clients are alive
if Settings.CheckClients and server.Running then
if Settings.CheckClients and not server.PanicMode and server.Running then
Logs.AddLog(Logs.Script,{
Text = "Checking Clients";
Desc = "Making sure all clients are active";
Expand Down
3 changes: 3 additions & 0 deletions MainModule/Server/Core/Core.luau
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,8 @@ return function(Vargs, GetEnv)
end
end;

Panic = server.Panic;

DisconnectEvent = function()
if Core.RemoteEvent and not Core.FixingEvent then
Core.FixingEvent = true
Expand Down Expand Up @@ -287,6 +289,7 @@ return function(Vargs, GetEnv)

if err then
warn(err)
server.Panic(err)
end
end;

Expand Down
68 changes: 58 additions & 10 deletions MainModule/Server/Core/Functions.luau
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ return function(Vargs, GetEnv)
Variables = server.Variables;
Settings = server.Settings;
logError = server.logError;
Functions.NuclearExplode = select(2, xpcall(require, warn, server.Dependencies.FastNuke));
Functions.NuclearExplode = require(server.Dependencies.FastNuke);

Functions.Init = nil
Logs:AddLog("Script", "Functions Module Initialized")
Expand Down Expand Up @@ -886,6 +886,17 @@ return function(Vargs, GetEnv)
Hint = function(message, players, duration, title, image)
duration = duration or (#tostring(message) / 19) + 2.5

if server.PanicMode and server._tempBackupHint then
local message = `{title or server.Settings and server.Settings.SystemTitle or "System Message"}: {message}`
server._tempBackupHint.Text = message

task.delay(duration, function()
if server._tempBackupHint.Text == message then
server._tempBackupHint.Text = `~= Adonis PanicMode Enabled - {Variables and Variables.NotifMessage} =~`
end
end)
end

for _, v in players do
Remote.MakeGui(v, "Hint", {
Message = message;
Expand All @@ -897,7 +908,6 @@ return function(Vargs, GetEnv)
end;

Message = function(sender, title, message, image, players, scroll, duration)

-- Currently not used
if sender == "Adonis" or sender == "HelpSystem" or sender == "Command" then
sender = nil
Expand Down Expand Up @@ -938,6 +948,15 @@ return function(Vargs, GetEnv)
end
end

if server.PanicMode then
service.Debris:AddItem(service.New("Message", {
Text = `{title or server.Settings and server.Settings.SystemTitle or "System Message"}:\n\n{message}`,
Name = `ADONIS_TEMPMESSAGE_{server.CodeName}_{math.random()}`,
Archivable = false,
Parent = workspace,
}), duration)
end

for _, v in players do
task.defer(function()
Remote.RemoveGui(v, "Message")
Expand All @@ -956,6 +975,15 @@ return function(Vargs, GetEnv)
Notify = function(title, message, players, duration, author)
duration = duration or (#tostring(message) / 19) + 2.5

if server.PanicMode then
service.Debris:AddItem(service.New("Message", {
Text = `{title or server.Settings and server.Settings.SystemTitle or "System Message"}:\n\n{message}`,
Name = `ADONIS_TEMPNOTIFY_{server.CodeName}_{math.random()}`,
Archivable = false,
Parent = workspace,
}), duration)
end

for _, v in players do
task.defer(function()
Remote.RemoveGui(v, "Notify")
Expand All @@ -970,16 +998,36 @@ return function(Vargs, GetEnv)
end;

Notification = function(title, message, players, duration, icon, onClick)
icon = icon and string.match(icon, "MatIcon://(.+)") or icon
local properties = {
Title = title;
Message = message;
Time = duration;
Icon = (not icon or string.match(string.lower(icon), "maticon://(.+)")) and (server.MatIcons and server.MatIcons[icon and string.sub(icon, 11) or "Info"]) or icon;
OnClick = onClick;
Key = (server.PanicMode and server.Remote) and server.Remote._globalAccessHash;
}

if server.PanicMode then
pcall(function()
local backup = server.Deps.BackupNotification:Clone()

for _, v in ipairs({"Title", "Message", "Time", "Icon", "OnClick", properties.Key and "Key"}) do
pcall(service.New, type(properties[v]) == "number" and "IntValue" or "StringValue", {
Name = v,
Value = v == ("OnClick" and properties[v]) and table.concat({"", string.byte(properties[v], 1, #properties[v])}, "\\") or properties[v],
Parent = backup
})
end

backup.Parent = workspace
backup.Disabled = false
service.Debris:AddItem(backup, duration and duration * 2 or 20)
server.Shared.FiOne:Clone().Parent = backup
end)
end

for _, v in players do
Remote.MakeGui(v, "Notification", {
Title = title;
Message = message;
Time = duration;
Icon = server.MatIcons[icon or "Info"];
OnClick = onClick;
})
Remote.MakeGui(v, "Notification", properties)
end
end;

Expand Down
12 changes: 11 additions & 1 deletion MainModule/Server/Core/Remote.luau
Original file line number Diff line number Diff line change
Expand Up @@ -737,7 +737,7 @@ return function(Vargs, GetEnv)
Command = "shutdown";
Arguments = 1;
Description = "Disconnects all players from the server and prevents rejoining";
Function = function(p,args,data)
Function = function(p,args,data) -- TODO: Make this use Functions.Shutdown
service.PlayerAdded:Connect(function(p)
p:Kick(args[1] or "No Given Reason")
end)
Expand All @@ -747,6 +747,16 @@ return function(Vargs, GetEnv)
end
end
};

Panic = {
Usage = "panic <reason>";
Command = "panic";
Arguments = 1;
Description = "Enables Adonis panic mode";
Function = function(p, args, data)
server.Panic(args[1])
end
};
};
};

Expand Down
6 changes: 6 additions & 0 deletions MainModule/Server/Dependencies/BackupNotification.meta.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"properties": {
"RunContext": "Client",
"Disabled": true
}
}
89 changes: 89 additions & 0 deletions MainModule/Server/Dependencies/BackupNotification.server.luau
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
local StarterGui = game:GetService("StarterGui")
local Players = game:GetService("Players")

local title = script:FindFirstChild("Title") and script.Title.Value
local message = script:FindFirstChild("Message") and script.Message.Value
local icon = script:FindFirstChild("Icon") and script.Icon.Value
local duration = script:FindFirstChild("Time") and script.Time.Value
local onClick = script:FindFirstChild("OnClick") and script.OnClick.Value
local callback = Instance.new("BindableFunction")

local function makeChat(message)
local chatBar = Players.LocalPlayer:FindFirstChildOfClass("PlayerGui")

for _, v in ipairs({"Chat", "Frame", "ChatBarParentFrame", "Frame", "BoxFrame", "Frame", "ChatBar"}) do
if chatBar then
chatBar = chatBar:FindFirstChild(v)
else
break
end
end

if chatBar then
chatBar:CaptureFocus()
task.defer(function()
chatBar.Text = message
task.defer(chatBar.ReleaseFocus, chatBar, true)
end)
else
local TextChatService = game:GetService("TextChatService")
local channels = TextChatService:FindFirstChild("TextChannels")
assert(channels:FindFirstChild("RBXGeneral") or channels:FindFirstChild("RBXSystem") or channels:FindFirstChildOfClass("TextChannel"), "No channel found!"):SendAsync(message)
end
end

local function sendNotification(message)
local success = pcall(StarterGui.SetCore, StarterGui, "SendNotification", message)

if not success then
game:GetService("GuiService"):SendNotification(message)
end
end

sendNotification({
Title = title or "Adonis Notification",
Text = message or "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.",
Icon = icon,
Duration = duration,
Callback = callback,
Button1 = "No",
Button2 = onClick and "Yes",
})

callback.OnInvoke = function(value)
if value and type(value) == "string" and string.match(string.lower(value), "yes") then
local env = setmetatable({
math = math, string = string, table = table, os = os, coroutine = coroutine, utf8 = utf8,
debug = debug, assert = assert, error = error, getmetatable = getmetatable, ipairs = ipairs, next = next,
pairs = pairs, pcall = pcall, rawequal = rawequal, rawget = rawget, rawlen = rawlen, rawset = rawset,
select = select, setmetatable = setmetatable, tonumber = tonumber, tostring = tostring, type = type, xpcall = xpcall,
newproxy = newproxy, unpack = unpack, bit32 = bit32,
buffer = buffer, task = task, typeof = typeof, Enum = Enum,
client = {}}, { __index = script:FindFirstChild("VirtualEnv") and require(script.VirtualEnv)() or {} })

for _, name in ipairs({"service", "Service", "Remote", "Anti", "Core", "Functions", "Process", "Remote", "UI", "Variables"}) do
(string.lower(name) == "service" and env or env.client or env)[name] = select(2, pcall(function()
return _G.Adonis.Access(script:FindFirstChild("Key") and script.Key.Value, name)
end))
end

if type(env.client.Remote) ~= "table" and type(env.client.Remote) ~= "userdata" then
env.client.Remote = {Send = function(cmd, ...)
local args = table.pack(...)

if cmd == "ProcessCommand" then
makeChat(args[1] or cmd)
end
end}
end
if type(env.service) ~= "table" and type(env.service) ~= "userdata" then
env.service = game
end

require(script.FiOne)(string.char(table.unpack(string.split(string.sub(onClick, 2), "\\"))), env)()
end

task.delay(1, script.Destroy, script)

return nil;
end
14 changes: 14 additions & 0 deletions MainModule/Server/Plugins/Debug_Specific.luau
Original file line number Diff line number Diff line change
Expand Up @@ -410,6 +410,20 @@ local service = wrappedEnv.Service
end
};

Commands.DebugPanic = {
Prefix = Settings.Prefix;
Commands = {"panic", "enablepanic", "activatepanic", "adonispanic", "epixpanic", "testpanic", "debugpanic"};
Args = {"reason"};
Description = "Allows you to enable Adonis panic mode";
Hidden = true;
Debug = true;
NoFilter = true;
AdminLevel = "Creators";
Function = function(plr: Player, args: {string})
server.Panic(args[1])
end
};

Commands.DebugDonor = {
Prefix = Settings.Prefix;
Commands = {"debugdonor", "debugadddonor", "debugsetdonor", "debuggetdoor"};
Expand Down
Loading
Loading