From c05bc09076db8f69f9b7497873ae440945b4edb9 Mon Sep 17 00:00:00 2001 From: Dimenpsyonal <64012878+Dimenpsyonal@users.noreply.github.com> Date: Mon, 15 Jan 2024 09:36:07 +0000 Subject: [PATCH] v242 * Fix missing $ * Update Functions.lua (#1326) * Added FPS Command (#1308) * Added FPS command * Added the command * Removed cPcall * Changed game:getservice() to service By: SuperCater Co-authored-by: Cater <84566931+SuperCater@users.noreply.github.com> * Update Debug_Specific.lua (#1337) * Revert regressions introduced in #1313 and #1308 (#1339) * Merge resetatmosphere to resetlighting (#1340) * Fix naming error in #1297 (#1341) * Updates :starterscript + 2 new related commands This adds a name argument to :starterscript and adds :starterscripts and :removestarterscript * Fix naming error * Fixed :Jail bug not unjailing after set time (#1342) * Update Version to v242 * Update Changelog to v242 * Fix FPS gui (#1338) * Fix FPS gui * Update FPS.lua * Update FPS.lua * Update Admin.lua (#1343) * v242 changelog(2) * Make disabling linkedlists a loader flag (#1335) * Change linkedlist toggle * Removed linkedlist toggle from settings * Make disabling linkedlists a loader flag * Update Logs.lua * Improve bug report form (#1345) * Improve bug report form * Update Bug_Report.yml * Fix typo * Update Changelog version to v242 * Very Big Change (#1349) * Notify admins what rank they are upon joining (#1303) * Notify admins what rank they are upon joining * Use string interpolation * Update Process.lua --------- Co-authored-by: Dimenpsyonal <64012878+Dimenpsyonal@users.noreply.github.com> * Make givepoints an alias (#1334) * Add legacy aliases of player points * Remove legacy player poinst command * Update Variables.lua * Fix typo * Update Admin.lua * Fix typo * Fix typo * Update Core.lua * Finally fix script * Added in-game Script Editor (#1315) * Added remote commands * Update Remote.lua * Added ScriptEditor command * Added ScriptEditor UI module * Added ScriptEditor to variables * Fixed an error in logging * Update !playerinfo command - Get Render Resolution (#1287) * Update Profile.lua - Render Resolution * Update Functions.lua - Enable getting client render resolution Uses CurrentCamera.ViewportSize to get the resolution. * Add new additions: v242 Changelog --------- Co-authored-by: burger <72227790+bwrbur@users.noreply.github.com> Co-authored-by: kaiserandaxl <122803145+kaiserandaxl@users.noreply.github.com> Co-authored-by: Cater <84566931+SuperCater@users.noreply.github.com> Co-authored-by: ccuser44 <68124053+ccuser44@users.noreply.github.com> Co-authored-by: EasternBloxxer Co-authored-by: EasternBloxxer <54174182+EasternBloxxer@users.noreply.github.com> Co-authored-by: Alistair Lau <77434904+alau740@users.noreply.github.com> Co-authored-by: Wilson Simanjuntak --- .github/ISSUE_TEMPLATE/Bug_Report.yml | 11 +- Loader/Version.model.json | 2 +- MainModule/Client/Core/Functions.lua | 1 + MainModule/Client/UI/Default/FPS.lua | 48 ++ MainModule/Client/UI/Default/Profile.lua | 1 + MainModule/Client/UI/Default/ScriptEditor.lua | 86 ++ .../Client/UI/TransBlack/PrivateMessage.rbxmx | 764 ++++++++++++++++++ MainModule/Server/Commands/Admins.lua | 2 +- MainModule/Server/Commands/Creators.lua | 79 +- MainModule/Server/Commands/Moderators.lua | 18 +- MainModule/Server/Commands/Players.lua | 34 +- MainModule/Server/Core/Admin.lua | 4 +- MainModule/Server/Core/Core.lua | 2 + MainModule/Server/Core/Functions.lua | 2 +- MainModule/Server/Core/Logs.lua | 2 +- MainModule/Server/Core/Process.lua | 50 +- MainModule/Server/Core/Remote.lua | 40 + MainModule/Server/Core/Variables.lua | 3 + .../Server/Dependencies/DefaultSettings.lua | 3 - MainModule/Server/Plugins/Debug_Specific.lua | 3 +- MainModule/Server/Plugins/Misc_Features.lua | 9 + MainModule/Server/Server.lua | 1 + MainModule/Server/Shared/Changelog.lua | 21 +- 23 files changed, 1100 insertions(+), 86 deletions(-) create mode 100644 MainModule/Client/UI/Default/FPS.lua create mode 100644 MainModule/Client/UI/Default/ScriptEditor.lua create mode 100644 MainModule/Client/UI/TransBlack/PrivateMessage.rbxmx diff --git a/.github/ISSUE_TEMPLATE/Bug_Report.yml b/.github/ISSUE_TEMPLATE/Bug_Report.yml index 298749b610..839804428c 100644 --- a/.github/ISSUE_TEMPLATE/Bug_Report.yml +++ b/.github/ISSUE_TEMPLATE/Bug_Report.yml @@ -19,6 +19,12 @@ body: default: 0 validations: required: true + - type: input + id: loader-version + attributes: + label: Loader version + description: If your issue is related to loader/settings and you do not provide this we may not be able to solve your issue. Paste the value from `Adonis_Loader > Version > .Value` ![Version VALUE](https://media.discordapp.net/attachments/834826232565727282/1194191940640587836/image.png) + placeholder: Value of the version variable. "Latest" is invalid as unbeknownst you may not be using the latest loader for many reasons - type: dropdown id: segment attributes: @@ -30,6 +36,7 @@ body: - Documentation - GitHub Repository - Anti-Exploit + - Trello - Other validations: required: true @@ -45,5 +52,5 @@ body: id: logs attributes: label: Relevant log output - description: Please copy and paste any relevant log output, if any. - render: shell \ No newline at end of file + description: Please copy and paste any relevant log output, if any. From studiologs/devconsole and/or `:scriptlogs`\&`:errorlogs` + render: shell diff --git a/Loader/Version.model.json b/Loader/Version.model.json index 274bcf1a46..f5149b408a 100644 --- a/Loader/Version.model.json +++ b/Loader/Version.model.json @@ -1,6 +1,6 @@ { "ClassName": "NumberValue", "Properties": { - "Value": 241 + "Value": 242 } } diff --git a/MainModule/Client/Core/Functions.lua b/MainModule/Client/Core/Functions.lua index 754310b1d0..f786a57c94 100644 --- a/MainModule/Client/Core/Functions.lua +++ b/MainModule/Client/Core/Functions.lua @@ -1868,6 +1868,7 @@ return function(Vargs, GetEnv) for _, p in props do data[p] = service.UserInputService[p] end + data["Resolution"] = workspace.CurrentCamera.ViewportSize.X.." x "..workspace.CurrentCamera.ViewportSize.Y return data end; }; diff --git a/MainModule/Client/UI/Default/FPS.lua b/MainModule/Client/UI/Default/FPS.lua new file mode 100644 index 0000000000..3d3d28d0f9 --- /dev/null +++ b/MainModule/Client/UI/Default/FPS.lua @@ -0,0 +1,48 @@ +client,service = nil,nil + +return function(data,env) + if env then + setfenv(1, env) + end + + local gfps = true + local gTable + + --warn(math.floor(1/game:GetService("RunService").RenderStepped:Wait())) + + local window = client.UI.Make("Window",{ + Name = "FPS"; + Title = "FPS"; + Icon = client.MatIcons.Leaderboard; + Size = {150, 70}; + Position = UDim2.new(0, 10, 1, -80); + AllowMultiple = false; + NoHide = true; + Walls = true; + SizeLocked = true; + CanKeepAlive = true; + OnClose = function() + gfps = false + end + }) + + if window then + local label = window:Add("TextLabel",{ + Text = "..."; + BackgroundTransparency = 1; + TextSize = 20; + Size = UDim2.new(1, 0, 1, 0); + Position = UDim2.new(0, 0, 0, 0); + --TextScaled = true; + --TextWrapped = true; + }) + + gTable = window.gTable + window:Ready() + + repeat + label.Text = `Render: {math.round(1/service["RunService"].RenderStepped:Wait())} fps\nPhysics: {math.round(workspace:GetRealPhysicsFPS())} fps` + task.wait(1) + until not gfps or not gTable.Active + end +end diff --git a/MainModule/Client/UI/Default/Profile.lua b/MainModule/Client/UI/Default/Profile.lua index 36859f943b..c50b1e052f 100644 --- a/MainModule/Client/UI/Default/Profile.lua +++ b/MainModule/Client/UI/Default/Profile.lua @@ -388,6 +388,7 @@ return function(data, env) {"Mouse Delta Sensitivity", data.GameData.MouseDeltaSensitivity, "The scale of the delta (change) output of the user’s Mouse"}, {"Mouse Enabled", boolToStr(data.GameData.MouseEnabled), "Whether the user’s device has a mouse available"}, -- NEEDS REFRESHABILITY {"OnScreenKeyboardVisible", data.GameData.OnScreenKeyboardVisible, "Whether an on-screen keyboard is currently visible on the user’s screen"}, + {"Render Resolution", data.GameData.Resolution, "The render resolution on user's current device. May not reflect real resolution on high-DPI devices."}, {"Touch Enabled", boolToStr(data.GameData.TouchEnabled), "Whether the user’s current device has a touch-screen available"}, {"VR Enabled", boolToStr(data.GameData.VREnabled), "Whether the user is using a virtual reality headset"}, {"Source Place ID", data.GameData.SourcePlaceId, "The ID of the place from which the player was teleported to this game, if applicable"}, diff --git a/MainModule/Client/UI/Default/ScriptEditor.lua b/MainModule/Client/UI/Default/ScriptEditor.lua new file mode 100644 index 0000000000..8d7ff804f8 --- /dev/null +++ b/MainModule/Client/UI/Default/ScriptEditor.lua @@ -0,0 +1,86 @@ +client,service = nil,nil +return function(data, env) + if env then + setfenv(1, env) + end + + local Save = nil + local Run = nil + + local window = client.UI.Make("Window",{ + Title = `Editing - {data.Name}`; + Name = "CommandBox"; + Icon = client.MatIcons.Code; + Size = {500, 300}; + MinSize = {300,250}; + OnClose = function() + Save() + end, + }) + + local Frame: ScrollingFrame = window:Add("ScrollingFrame",{ + Name = "Editor"; + Size = UDim2.new(1, -10, 1, -10); + BackgroundTransparency = 1; + }) + + local Text: TextBox = Frame:Add("TextBox",{ + Name = "Script"; + Size = UDim2.new(1, -10, 1, -10); + Position = UDim2.new(0, 5, 0, 5); + BackgroundTransparency = 1; + Text = data.Script or [[print("Hello World")]]; + PlaceholderText = ""; + TextYAlignment = "Top"; + TextXAlignment = "Left"; + MultiLine = true; + ClearTextOnFocus = false; + Font = Enum.Font.Code; + TextSize = 16; + }) + + local SaveButton: TextButton = window:Add("TextButton",{ + Name = "Save"; + Text = "Save"; + Size = UDim2.new(0, 40, 0, 20); + Position = UDim2.new(1, 0, 1, -25); + AnchorPoint = Vector2.new(1, 1); + }) + + local RunButton: TextButton = window:Add("TextButton",{ + Name = "Run"; + Text = "Run"; + Size = UDim2.new(0, 40, 0, 20); + Position = UDim2.new(1, 0, 1, 0); + AnchorPoint = Vector2.new(1, 1); + }) + + Text:GetPropertyChangedSignal("TextBounds"):Connect(function() + Frame:ResizeCanvas(true,true) + end) + + Save = function() + client.Remote.Send("SaveScript",{ + Name = data.Name; + Text = Text.Text + }) + end + + Run = function() + client.Remote.Send("SaveScript",{ + Name = data.Name; + Text = Text.Text + }) + client.Remote.Send("RunScript",{data.Name}) + end + + SaveButton.MouseButton1Click:Connect(function() + Save() + end) + + RunButton.MouseButton1Click:Connect(function() + Run() + end) + + window:Ready() +end diff --git a/MainModule/Client/UI/TransBlack/PrivateMessage.rbxmx b/MainModule/Client/UI/TransBlack/PrivateMessage.rbxmx new file mode 100644 index 0000000000..074dc548c9 --- /dev/null +++ b/MainModule/Client/UI/TransBlack/PrivateMessage.rbxmx @@ -0,0 +1,764 @@ + + true + null + nil + + + + true + 0 + true + false + 0 + true + PrivateMessage + true + null + 1 + 2 + 0 + 0 + 0 + 0 + false + -1 + + 0 + + + + true + + 0 + 0 + + + true + 0 + + 0 + 0 + 0 + + 0.300000012 + + 0.105882362 + 0.164705887 + 0.207843155 + + 0 + 0 + 0 + false + false + true + true + 0 + Frame + null + null + null + null + + 0.5 + -150 + 0.5 + -100 + + null + 0 + false + 0 + 0 + 0 + 0 + false + null + 0 + + 0 + 300 + 0 + 180 + + 0 + -1 + 0 + + true + 1 + + + + false + + 0 + 0 + + + true + 0 + + 0.164705887 + 0.164705887 + 0.164705887 + + 1 + + 0.105882362 + 0.164705887 + 0.207843155 + + 0 + 1 + 0 + false + false + false + + rbxasset://fonts/families/SourceSansPro.json + 400 + + rbxasset://fonts/SourceSansPro-Regular.ttf + + true + 0 + 1 + + + -1 + Title + null + null + null + null + + 0 + 30 + 0 + 5 + + false + null + 0 + false + 0 + 0 + 0 + 0 + false + null + 0 + + 1 + -60 + 0 + 20 + + 0 + -1 + + Private Message from Player1 + + 1 + 1 + 1 + + 0 + true + 18 + + 0 + 0 + 0 + + 1 + 0 + 0 + true + 2 + 1 + true + 1 + + + + + true + + 0 + 0 + + + true + true + 0 + + 0.164705887 + 0.164705887 + 0.164705887 + + 1 + + 0 + 0 + 0 + + 0 + 0 + 0 + false + false + false + + rbxasset://fonts/families/SourceSansPro.json + 400 + + rbxasset://fonts/SourceSansPro-Regular.ttf + + true + 0 + 1 + + + -1 + false + Close + null + null + null + null + + 0 + 5 + 1 + -30 + + false + null + 0 + true + false + 0 + 0 + 0 + 0 + false + null + 0 + + 0 + 100 + 0 + 25 + + 0 + -1 + 0 + + Close + + 1 + 1 + 1 + + 0 + false + 18 + + 0 + 0 + 0 + + 1 + 0 + 0 + true + 2 + 1 + true + 1 + + + + + true + + 0 + 0 + + + true + true + 0 + + 0.164705887 + 0.164705887 + 0.164705887 + + 1 + + 0 + 0 + 0 + + 0 + 0 + 0 + false + false + false + + rbxasset://fonts/families/SourceSansPro.json + 400 + + rbxasset://fonts/SourceSansPro-Regular.ttf + + true + 0 + 1 + + + -1 + false + Reply + null + null + null + null + + 1 + -105 + 1 + -30 + + false + null + 0 + true + false + 0 + 0 + 0 + 0 + false + null + 0 + + 0 + 100 + 0 + 25 + + 0 + -1 + 0 + + Reply + + 1 + 1 + 1 + + 0 + false + 18 + + 0 + 0 + 0 + + 1 + 0 + 0 + true + 2 + 1 + true + 1 + + + + + true + + 0 + 0 + + + true + 0 + + 0 + 0 + 0 + + 1 + + 0.105882362 + 0.164705887 + 0.207843155 + + 0 + 0 + 0 + true + false + false + true + 0 + Frame + null + null + null + null + + 0 + 0 + 0 + 30 + + null + 0 + false + 0 + 0 + 0 + 0 + false + null + 0 + + 1 + 0 + 1 + -60 + + 0 + -1 + 0 + + true + 1 + + + + true + + 0 + 0 + + + true + 0 + + 0 + 0 + 0 + + 0.5 + + 0.105882362 + 0.164705887 + 0.207843155 + + 0 + 0 + 0 + true + true + false + false + + rbxasset://fonts/families/SourceSansPro.json + 300 + + rbxasset://fonts/SourceSansPro-Light.ttf + + true + 0 + 1 + + + -1 + false + ReplyBox + null + null + null + null + + 0.699999988 + 0.699999988 + 0.699999988 + + + + 0 + 0 + 0 + 120 + + false + null + 0 + true + 0 + 0 + 0 + 0 + false + null + 0 + true + + 1 + 0 + 0 + 25 + + 0 + -1 + + Enter Message + + 1 + 1 + 1 + + 0 + true + true + 24 + + 0 + 0 + 0 + + 1 + 0 + 0 + true + 2 + 0 + true + 1 + + + + + false + + 0 + 0 + + + true + 0 + + 0 + 0 + 0 + + 0.5 + + 0.105882362 + 0.164705887 + 0.207843155 + + 0 + 0 + 0 + false + false + false + + rbxasset://fonts/families/SourceSansPro.json + 400 + + rbxasset://fonts/SourceSansPro-Regular.ttf + + true + 0 + 1 + + + -1 + Message + null + null + null + null + + 0 + 0 + 0 + 0 + + false + null + 0 + false + 0 + 0 + 0 + 0 + false + null + 0 + + 1 + 0 + 0 + 120 + + 0 + -1 + + hi + + 1 + 1 + 1 + + 0 + true + 36 + + 0 + 0 + 0 + + 1 + 0 + 0 + true + 2 + 1 + true + 1 + + + + + + + + 0 + false + Config + -1 + + + + + + 0 + false + AllowMultiple + -1 + + true + + + + + + 0 + false + + Code + {FD498A43-E78B-41BE-9F96-522ACED9FBE1} + 0 then + gui:Destroy() + Remote.Send('PrivateMessage', replyTicket, player, ReplyBox.Text) + -- client.Remote.Send('PrivateMessage','Reply from '..localplayer.Name,player,localplayer,service.Filter(ReplyBox.Text,localplayer,player)) + client.UI.Make("Hint", {Message = "Reply sent"}) + else + ReplyBox.Text='Enter text then hit enter or "reply"' + end + end + + Frame.Visible = false + + ReplyBox.Visible = true + Reply.Visible = true + + Message.Text = message + Title.Text = title + + ReplyBox.FocusLost:connect(function(enterPressed) + if enterPressed then + send() + end + end) + + Close.MouseButton1Click:connect(function() + gui:Destroy() + end) + + Reply.MouseButton1Click:connect(function() + if not replying then + replying = true + Frame:TweenSize(UDim2.new(0,300,0,280),nil,nil,0.5) + ReplyBox:CaptureFocus() + else + send() + end + end) + + client.UI.Make("Notification",{ + Title = "New Message"; + Message = "New Message from "..player.Name..". Click to here to view."; + Time = false; + OnClick = function() gTable:Ready() Frame.Visible = true end; + OnClose = function() gTable:Destroy() end; + OnIgnore = function() gTable:Destroy() end; + }) +end]]> + -1 + + + + + + + 0 + false + CanKeepAlive + -1 + + true + + + + + \ No newline at end of file diff --git a/MainModule/Server/Commands/Admins.lua b/MainModule/Server/Commands/Admins.lua index fc49d23f3f..f4758379d8 100644 --- a/MainModule/Server/Commands/Admins.lua +++ b/MainModule/Server/Commands/Admins.lua @@ -1048,7 +1048,7 @@ return function(Vargs, env) assert(args[1], "No starterscript name provided!") for _,v : Instance in service.StarterGui:GetChildren() do - if v:IsA("LocalScript") and v.Name:find("[Athena]") then + if v:IsA("LocalScript") and v.Name:find("[Adonis]") then if v.Name:gsub("%[Adonis%] ", ""):lower() == args[1]:lower() or args[1]:lower() == "all" then service.Delete(v) Functions.Hint("Removed starter script "..v.Name, {plr}) diff --git a/MainModule/Server/Commands/Creators.lua b/MainModule/Server/Commands/Creators.lua index 007fe0c4f3..262bebbc2b 100644 --- a/MainModule/Server/Commands/Creators.lua +++ b/MainModule/Server/Commands/Creators.lua @@ -135,21 +135,6 @@ return function(Vargs, env) end }; - GivePlayerPoints = { --// obsolete since ROBLOX discontinued player points - Prefix = Settings.Prefix; - Commands = {"giveppoints", "giveplayerpoints", "sendplayerpoints"}; - Args = {"player", "amount"}; - Hidden = true; - Description = "Lets you give player points"; - AdminLevel = "Creators"; - Function = function(plr: Player, args: {string}) - local amount = assert(tonumber(args[2]), "Invalid/no amount provided (argument #2 must be a number)") - for _, v in service.GetPlayers(plr, args[1]) do - local ran, failed = pcall(service.PointsService.AwardPoints, service.PointsService, v.UserId, amount) - end - end - }; - Settings = { Prefix = ""; Commands = {":adonissettings", `{Settings.Prefix}settings`, `{Settings.Prefix}adonissettings`}; @@ -256,6 +241,70 @@ return function(Vargs, env) end }; + ScriptEditor = { + Prefix = Settings.Prefix; + Commands = {"scripteditor", "se"}; + Args = {"new/edit/delete/run","name"}; + Description = "Opens Script editor"; + AdminLevel = "Creators"; + Function = function(plr: Player, args: {string}) + assert(Settings.CodeExecution, "CodeExecution must be enabled for this command to work") + local Operation = assert(args[1], "Operation not defined (argument #1)") + local Name = assert(args[2], "Name not defined (argument #2)") + local se = Variables.ScriptEditor[tostring(plr.UserId)] + if not se then + se = {} + Variables.ScriptEditor[tostring(plr.UserId)] = se + end + + if Operation:lower() == "new" then + se[Name] = { + Script = false; + } + + Commands.ScriptEditor.Function(plr,{"edit",Name}) + elseif Operation:lower() == "edit" then + Remote.MakeGui(plr, "ScriptEditor",{ + Name = Name; + Script = se[Name].Script + }) + elseif Operation:lower() == "delete" then + assert(se[Name], "No script found") + + se[Name] = nil + elseif Operation:lower() == "run" then + assert(se[Name], "No script found") + + local oError = error + local newenv = setfenv(getfenv(),{ + print = function(...) local args, str = table.pack(...), "" for i = 1, args.n do str ..= `{(i > 1 and " " or "")}{args[i]}` end Remote.MakeGui(plr, "Output",{Title = 'Output'; Message = `PRINT: {str}`}) end; + warn = function(...) local args, str = table.pack(...), "" for i = 1, args.n do str ..= `{(i > 1 and " " or "")}{args[i]}` end Remote.MakeGui(plr, "Output",{Title = 'Output'; Message = `WARN: {str}`}) end; + error = function(reason, level) + if level ~= nil and type(level) ~= "number" then + oError(string.format("bad argument #2 to 'error' (number expected, got %s)", type(level)), 2) + end + + Remote.MakeGui(plr, "Output",{Title = 'Output'; Message = `LUA_DEMAND_ERROR: {reason}`}) + oError(`Adonis ScriptEditor error: {reason}`, (level or 1) + 1) + end; + }) + + service.TrackTask(`Thread: ScriptEditor: {plr.UserId}: {Name}`,function() + local func,err = Core.Loadstring(se[Name]["Script"], newenv) + if func then + local Succ,Err = pcall(function() + func() + end) + + Remote.MakeGui(plr,'Output',{Title = 'Output'; Message = Err}) + else + Remote.MakeGui(plr,'Output',{Title = 'Output'; Message = err}) + end + end) + end + end, + } + --[[ TaskManager = { --// Unfinished Prefix = Settings.Prefix; diff --git a/MainModule/Server/Commands/Moderators.lua b/MainModule/Server/Commands/Moderators.lua index 1a248c1144..2f71ea61a5 100644 --- a/MainModule/Server/Commands/Moderators.lua +++ b/MainModule/Server/Commands/Moderators.lua @@ -2379,7 +2379,7 @@ return function(Vargs, env) ResetLighting = { Prefix = Settings.Prefix; - Commands = {"fix", "resetlighting", "undisco", "unflash", "fixlighting"}; + Commands = {"fix", "resetlighting", "undisco", "unflash", "fixlighting", "resetatmosphere", "fixatmosphere"}; Args = {}; Description = "Reset lighting back to the setting it had on server start"; AdminLevel = "Moderators"; @@ -2398,16 +2398,8 @@ return function(Vargs, env) if Variables.OriginalLightingSettings.Sky then Variables.OriginalLightingSettings.Sky:Clone().Parent = service.Lighting end - end - }; - ResetAtmosphere = { - Prefix = Settings.Prefix; - Commands = {"resetatmosphere", "fixatmosphere"}; - Args = {}; - Description = "Resets atmosphere back to the setting it had on server start"; - AdminLevel = "Moderators"; - Function = function(plr: Player, args: {string}) + -- Atmosphere if service.Lighting:FindFirstChildWhichIsA("Atmosphere") then Variables.OriginalAtmosphereSettings = { Name = service.Lighting:FindFirstChildWhichIsA("Atmosphere").Name, @@ -2430,8 +2422,6 @@ return function(Vargs, env) Atmosphere.Glare = Variables.OriginalAtmosphereSettings.Glare Atmosphere.Haze = Variables.OriginalAtmosphereSettings.Haze end - else - Functions.Hint("Atmosphere doesn't exist!", {plr}) end end }; @@ -2788,7 +2778,7 @@ return function(Vargs, env) if os.time() < jail.EndTime and Model.Parent == workspace and Variables.Jails[ind] == jail then task.wait(1) else - Commands.UnJail.Function(plr,v.Name) + Commands.UnJail.Function(plr,{v.Name}) break end end @@ -2836,7 +2826,7 @@ return function(Vargs, env) end end }; - + BubbleChat = { Prefix = Settings.Prefix; Commands = {"bchat", "dchat", "bubblechat", "dialogchat"}; diff --git a/MainModule/Server/Commands/Players.lua b/MainModule/Server/Commands/Players.lua index fffec88367..7bac817595 100644 --- a/MainModule/Server/Commands/Players.lua +++ b/MainModule/Server/Commands/Players.lua @@ -151,7 +151,14 @@ return function(Vargs, env) Description = "Sends yourself a notification"; AdminLevel = "Players"; Function = function(plr: Player, args: {string}) - Functions.Notification("Notification", assert(args[2], "Missing message"), {plr}, tonumber(assert(args[1], "Missing time amount")), "MatIcon://Notifications") + assert(args[1], "Missing time amount") + assert(args[2], "Missing message") + Remote.MakeGui(plr, "Notification", { + Title = "Notification"; + Icon = server.MatIcons["Notifications"]; + Message = args[2]; + Time = tonumber(args[1]); + }) end }; @@ -301,6 +308,17 @@ return function(Vargs, env) Remote.MakeGui(plr, "Ping") end }; + + Fps = { + Prefix = Settings.PlayerPrefix; + Commands = {"fps","framespersecond"}; + Args = {}; + Description = "Shows your current fps (frames per second)"; + AdminLevel = "Players"; + Function = function(plr: Player, args: {string}) + Remote.MakeGui(plr,"FPS") + end, + }; ServerSpeed = { Prefix = Settings.PlayerPrefix; @@ -390,7 +408,12 @@ return function(Vargs, env) answered = true Commands.Teleport.Function(plr, {p.Name, `@{plr.Name}`}) else - Functions.Notification("Help Request", "Another admin has already responded to this request!", {plr}, 5, "MatIcon://Mail") + Remote.MakeGui(p, "Notification", { + Title = "Help Request"; + Message = "Another admin has already responded to this request!"; + Icon = server.MatIcons.Mail; + Time = 5; + }) end end end @@ -615,7 +638,12 @@ return function(Vargs, env) data.CustomTheme = args[1] playerData.Client = data Core.SavePlayer(plr, playerData) - Functions.Notification("Theme Changed", if args[1] then `UI theme set to '{args[1]}'!` else "UI theme reset to default.", {plr}, 5, "MatIcon://Palette") + Remote.MakeGui(plr, "Notification", { + Title = "Theme Changed"; + Icon = server.MatIcons.Palette; + Message = if args[1] then `UI theme set to '{args[1]}'!` else "UI theme reset to default."; + Time = 5; + }) Remote.LoadCode(plr, `client.Variables.CustomTheme = {if args[1] then `[[{args[1]}]]` else "nil"}`) end }; diff --git a/MainModule/Server/Core/Admin.lua b/MainModule/Server/Core/Admin.lua index 5d71751dcd..5093732e62 100644 --- a/MainModule/Server/Core/Admin.lua +++ b/MainModule/Server/Core/Admin.lua @@ -1014,7 +1014,7 @@ return function(Vargs, GetEnv) if ban.EndTime-os.time() <= 0 then table.remove(Core.Variables.TimeBans, ind) else - return true, `\n Reason: {ban.Reason or "(No reason provided.)"}\n Banned until {service.FormatTime(ban.EndTime, {WithWrittenDate = true})}` + return true, `\n {ban.Reason or "(No reason provided.)"}\n | Banned until {service.FormatTime(ban.EndTime, {WithWrittenDate = true})}` end end end @@ -1471,7 +1471,7 @@ return function(Vargs, GetEnv) end --if not foundPlayerAlias then - for alias, cmd in Settings.Aliases do + for alias, cmd in Variables.Aliases do local tAlias = stripArgPlaceholders(alias) if not CheckAliasBlacklist(tAlias) then local escAlias = EscapeSpecialCharacters(tAlias) diff --git a/MainModule/Server/Core/Core.lua b/MainModule/Server/Core/Core.lua index af5fb6c463..f88893ce9f 100644 --- a/MainModule/Server/Core/Core.lua +++ b/MainModule/Server/Core/Core.lua @@ -1483,6 +1483,8 @@ return function(Vargs, GetEnv) Message = MetaFunc(Functions.Message, true); RunCommandAsNonAdmin = MetaFunc(Admin.RunCommandAsNonAdmin, true); + + GetPlayers = MetaFunc(Functions.GetPlayers, true); } if Core.DebugMode == true then diff --git a/MainModule/Server/Core/Functions.lua b/MainModule/Server/Core/Functions.lua index 1278d1ef4d..6b4889b0dd 100644 --- a/MainModule/Server/Core/Functions.lua +++ b/MainModule/Server/Core/Functions.lua @@ -1316,7 +1316,7 @@ return function(Vargs, GetEnv) end; Trim = function(str) - return string.match(str, "^%s*(.-)%s*$") + return string.match(str, "^%s*([^%.]-)%s*$") end; RoundToPlace = function(num, places) diff --git a/MainModule/Server/Core/Logs.lua b/MainModule/Server/Core/Logs.lua index 8dce56f3f8..3941bf5d25 100644 --- a/MainModule/Server/Core/Logs.lua +++ b/MainModule/Server/Core/Logs.lua @@ -34,7 +34,7 @@ return function(Vargs, GetEnv) Logs:AddLog("Script", "Logging Module Initialized"); end; - local UseDLL = server.Settings.UseLinkedListsInLogs == true or server.Settings.UseLinkedListsInLogs == nil + local UseDLL = not (server.Settings.UseLinkedListsInLogs == false or server.DisableLinkedListsInLogs) server.Logs = { Init = Init; diff --git a/MainModule/Server/Core/Process.lua b/MainModule/Server/Core/Process.lua index 0758b9b9fd..015ace4567 100644 --- a/MainModule/Server/Core/Process.lua +++ b/MainModule/Server/Core/Process.lua @@ -865,7 +865,7 @@ return function(Vargs, GetEnv) FinishLoading = function(p) local PlayerData = Core.GetPlayer(p) - local level = Admin.GetLevel(p) + local level, rank = Admin.GetLevel(p) local key = tostring(p.UserId) --// Fire player added @@ -950,44 +950,20 @@ return function(Vargs, GetEnv) local newVer = (level > 300) and tonumber(string.match(server.Changelog[1], "Version: (.*)")) if Settings.Notification then - Remote.MakeGui(p, "Notification", { - Title = "Welcome."; - Message = "Click here for commands."; - Icon = server.MatIcons["Verified user"]; - Time = 15; - OnClick = Core.Bytecode(`client.Remote.Send('ProcessCommand','{Settings.Prefix}cmds')`); - }) + + task.wait(1) + Functions.Notification("Welcome.", `Your rank is {rank} ({level}). Click here for commands.`, {p}, 15, "MatIcon://Verified user", Core.Bytecode(`client.Remote.Send('ProcessCommand','{Settings.Prefix}cmds')`)) if oldVer and newVer and newVer > oldVer then - task.wait(1) - Remote.MakeGui(p, "Notification", { - Title = "Updated!"; - Message = "Click to view the changelog."; - Icon = server.MatIcons.Description; - Time = 10; - OnClick = Core.Bytecode(`client.Remote.Send('ProcessCommand','{Settings.Prefix}changelog')`); - }) + task.delay(1, Functions.Notification, "Updated!", "Click to view the changelog.", {p}, 10, "MatIcon://Description", Core.Bytecode(`client.Remote.Send('ProcessCommand','{Settings.Prefix}changelog')`)) end if level > 300 and Core.DebugMode == true then - task.wait(1) - Remote.MakeGui(p, "Notification", { - Title = "Debug Mode Enabled"; - Message = "Adonis is currently running in Debug Mode."; - Icon = server.MatIcons["Bug report"]; - Time = 10; - OnClick = Core.Bytecode(`client.Remote.Send('ProcessCommand','{Settings.Prefix}debugcmds')`); - }) + task.delay(1, Functions.Notification, "Debug Mode Enabled", "Adonis is currently running in Debug Mode.", {p}, 10, "MatIcon://Bug report", Core.Bytecode(`client.Remote.Send('ProcessCommand','{Settings.Prefix}debugcmds')`)) end if level > 300 and Settings.DataStoreKey == Defaults.Settings.DataStoreKey and Core.DebugMode == false then - task.wait(1) - Remote.MakeGui(p, "Notification", { - Title = "Warning!"; - Message = "Using default datastore key!"; - Icon = server.MatIcons.Description; - Time = 10; - OnClick = Core.Bytecode([[ + task.delay(1, Functions.Notification, "Warning!", "Using default datastore key!", {p}, 15, "MatIcon://Description", Core.Bytecode([[ local window = client.UI.Make("Window", { Title = "How to change the DataStore key"; Size = {700,300}; @@ -999,18 +975,12 @@ return function(Vargs, GetEnv) }) window:Ready() - ]]); - }) + ]])) end if level >= 300 and #Settings.Messages > 0 then - for _,Message in pairs(Settings.Messages) do - task.wait(1) - Remote.MakeGui(p,"Notification",{ - Title = "Message"; - Message = tostring(Message); - Time = math.round((#Message/19)+2.5); - }) + for _, Message in Settings.Messages do + task.delay(1, Functions.Notification, "Message", tostring(Message), {p}, math.round((#Message/19)+2.5)) end end end diff --git a/MainModule/Server/Core/Remote.lua b/MainModule/Server/Core/Remote.lua index bcc5f20c47..aeaae43939 100644 --- a/MainModule/Server/Core/Remote.lua +++ b/MainModule/Server/Core/Remote.lua @@ -1012,6 +1012,46 @@ return function(Vargs, GetEnv) Anti.Detected(p, "info", `Invalid PrivateMessage ticket! Got: {args[2]}`) end end; + + SaveScript = function(p: Player, args: {}) + local se = Variables.ScriptEditor[tostring(p.UserId)] + local Name = args[1]["Name"] + local Variable = se[Name] + + Variable.Script = args[1]["Text"] + end, + RunScript = function(p: Player, args: {}) + local se = Variables.ScriptEditor[tostring(p.UserId)] + local Name = args[1][1] + local Variable = se[Name] + + local oError = error + local newenv = GetEnv(getfenv(),{ + print = function(...) local args, str = table.pack(...), "" for i = 1, args.n do str ..= `{(i > 1 and " " or "")}{args[i]}` end Remote.Terminal.LiveOutput(p, `PRINT: {str}`) end; + warn = function(...) local args, str = table.pack(...), "" for i = 1, args.n do str ..= `{(i > 1 and " " or "")}{args[i]}` end Remote.Terminal.LiveOutput(p, `WARN: {str}`) end; + error = function(reason, level) + if level ~= nil and type(level) ~= "number" then + oError(string.format("bad argument #2 to 'error' (number expected, got %s)", type(level)), 2) + end + + Remote.MakeGui(p, "Output",{Title = 'Output'; Message = `LUA_DEMAND_ERROR: {reason}`}) + oError(`Adonis ScriptEditor error: {reason}`, (level or 1) + 1) + end; + }) + + service.TrackTask(`Thread: ScriptEditor: {p.UserId}: {Name}`,function() + local func,err = Core.Loadstring(Variable["Script"], newenv) + if func then + local Succ,Err = pcall(function() + func() + end) + + Remote.MakeGui(p,'Output',{Title = 'Output'; Message = Err}) + else + Remote.MakeGui(p,'Output',{Title = 'Output'; Message = err}) + end + end) + end, }; NewSession = function(sessionType: string) diff --git a/MainModule/Server/Core/Variables.lua b/MainModule/Server/Core/Variables.lua index b95953956a..42dd55e81e 100644 --- a/MainModule/Server/Core/Variables.lua +++ b/MainModule/Server/Core/Variables.lua @@ -32,6 +32,7 @@ return function(Vargs, GetEnv) for _, v in Settings.MusicList or {} do table.insert(Variables.MusicList, v) end for _, v in Settings.InsertList or {} do table.insert(Variables.InsertList, v) end for _, v in Settings.CapeList or {} do table.insert(Variables.Capes, v) end + for k, v in Settings.Aliases or {} do Variables.Aliases[k] = v end Variables.Init = nil Logs:AddLog("Script", "Variables Module Initialized") @@ -55,7 +56,9 @@ return function(Vargs, GetEnv) AuthorizedToReply = {}, FrozenObjects = {}, ScriptBuilder = {}, + ScriptEditor = {}, CachedDonors = {}, + Aliases = {}, BanMessage = "Banned", PlayerJoinFilters = {}; LockMessage = "Not Whitelisted", diff --git a/MainModule/Server/Dependencies/DefaultSettings.lua b/MainModule/Server/Dependencies/DefaultSettings.lua index 1d6580b3b1..7c56b3f149 100644 --- a/MainModule/Server/Dependencies/DefaultSettings.lua +++ b/MainModule/Server/Dependencies/DefaultSettings.lua @@ -290,7 +290,6 @@ settings.SystemTitle = "System Message" -- Title to display in :sm and :bc settings.MaxLogs = 5000 -- Maximum logs to save before deleting the oldest settings.SaveCommandLogs = true -- If command logs are saved to the datastores -settings.UseLinkedListsInLogs = true -- If true then log system uses a linked-list system to store logs instead of tables - severely improves server performance & allows for large logs with little to no impact except slightly increased memory usage settings.Notification = true -- Whether or not to show the "You're an admin" and "Updated" notifications settings.SongHint = true -- Display a hint with the current song name and ID when a song is played via :music settings.TopBarShift = false -- By default hints and notifications will appear from the top edge of the window. Set this to true if you don't want hints/notifications to appear in that region. @@ -462,7 +461,6 @@ descs.SystemTitle = [[ Title to display in :sm ]] descs.CreatorPowers = [[ Gives me creator-level admin; This is strictly used for debugging; I can't debug without access to the script and specific owner commands ]] descs.MaxLogs = [[ Maximum logs to save before deleting the oldest; Too high can lag the game ]] descs.SaveCommandLogs = [[ If command logs are saved to the datastores ]] -descs.UseLinkedListsInLogs = [[ If true then log system uses a linked-list system to store logs instead of tables - severely improves server performance & allows for large logs with little to no impact except slightly increased memory usage ]] descs.Notification = [[ Whether or not to show the "You're an admin" and "Updated" notifications ]] descs.CodeExecution = [[ Enables the use of code execution in Adonis; Scripting related and a few other commands require this ]] descs.SongHint = [[ Display a hint with the current song name and ID when a song is played via :music ]] @@ -603,7 +601,6 @@ order = { " "; "MaxLogs"; "SaveCommandLogs"; - "UseLinkedListsInLogs"; "Notification"; "SongHint"; "TopBarShift"; diff --git a/MainModule/Server/Plugins/Debug_Specific.lua b/MainModule/Server/Plugins/Debug_Specific.lua index b3481df2ce..cedd8e9e94 100644 --- a/MainModule/Server/Plugins/Debug_Specific.lua +++ b/MainModule/Server/Plugins/Debug_Specific.lua @@ -364,7 +364,6 @@ local service = wrappedEnv.Service NoFilter = true; AdminLevel = "Creators"; Function = function(plr: Player, args: {string}) - --error("Disabled", 0) --[[local ans = Remote.GetGui(plr, "YesNoPrompt", { Icon = server.MatIcons.Warning; Question = "Are you sure you want to load this script into the server env?"; @@ -387,7 +386,7 @@ local service = wrappedEnv.Service Prefix = Settings.Prefix; Commands = {"debuganti", "debuganticheat", "debugcheat", "debugantiexploit", "debugexploit", "debugantihack", "debughack"}; Args = {"player", "action", "info"}; - Description = "Shows you how to use some syntax related things"; + Description = "Allows you to make a mock anti cheat detection"; Hidden = true; AdminLevel = "Creators"; Function = function(plr: Player, args: {string}) diff --git a/MainModule/Server/Plugins/Misc_Features.lua b/MainModule/Server/Plugins/Misc_Features.lua index 5b1ca7b29e..c5f5605241 100644 --- a/MainModule/Server/Plugins/Misc_Features.lua +++ b/MainModule/Server/Plugins/Misc_Features.lua @@ -49,6 +49,15 @@ return function(Vargs, GetEnv) end; return table.concat(Res) end; + for k, v in {-- Legacy aliases + [":giveppoints "] = ":script local Players = game:GetService(\"Players\") for _, v in ipairs(_G.Adonis.GetPlayers(Players:GetPlayers()[math.random(1, #Players:GetPlayers())], \"\")) do game:GetService(\"PointsService\"):AwardPoints(v.UserId, ) end", + [":giveplayerpoints "] = ":script local Players = game:GetService(\"Players\") for _, v in ipairs(_G.Adonis.GetPlayers(Players:GetPlayers()[math.random(1, #Players:GetPlayers())], \"\")) do game:GetService(\"PointsService\"):AwardPoints(v.UserId, ) end", + [":sendplayerpoints "] = ":script local Players = game:GetService(\"Players\") for _, v in ipairs(_G.Adonis.GetPlayers(Players:GetPlayers()[math.random(1, #Players:GetPlayers())], \"\")) do game:GetService(\"PointsService\"):AwardPoints(v.UserId, ) end", + } do + if not Variables.Aliases[k] then + Variables.Aliases[k] = v + end + end Logs:AddLog("Script", "Misc Features Module Loaded") end diff --git a/MainModule/Server/Server.lua b/MainModule/Server/Server.lua index 817cc3b9ca..aca85f5a3c 100644 --- a/MainModule/Server/Server.lua +++ b/MainModule/Server/Server.lua @@ -553,6 +553,7 @@ return service.NewProxy({ server.LoadModule = LoadModule server.LoadPackage = LoadPackage server.ServiceSpecific = ServiceSpecific + server.DisableLinkedListsInLogs = data.DisableLinkedListsInLogs server.Shared = Folder.Shared server.ServerPlugins = data.ServerPlugins diff --git a/MainModule/Server/Shared/Changelog.lua b/MainModule/Server/Shared/Changelog.lua index 3db246e839..7d986a9068 100644 --- a/MainModule/Server/Shared/Changelog.lua +++ b/MainModule/Server/Shared/Changelog.lua @@ -1,8 +1,27 @@ return { - "Version: 241"; + "Version: 242"; "*Drag edges to expand*"; "*Report bugs/issues on our GitHub repository*"; ""; + "[v242 2024-01-14 12:10 UTC] @Dimenpsyonal"; + "Add new pipe model"; + "(Git/kaiserandaxl) Add !FPS Command (#1308)"; + "(Git/kaiserandaxl) Add in-game Script Editor (#1315)"; + "(Git/bwrbur) Fix String Matching (#1326)"; + "(Git/ccuser44) Update Debug_Specific (#1337)"; + "(Git/ccuser44) Revert regressions introduced in #1313 and #1308 (#1339)"; + "(Git/ccuser44) Merge resetatmosphere to resetlighting (#1340)"; + "(Git/SuperCater) Fix naming error in :starterscript (#1341)"; + "(Git/kaiserandaxl) Fix :Jail bug not unjailing after set time (#1342)"; + "(Git/ccuser44) Fix FPS gui (#1338)"; + "(Git/EasternBloxxer) Fix Duplicate Display of Reason in Kick Message (#1343)"; + "(Git/ccuser44) Make disabling linkedlists a loader flag (#1335)"; + "(Git/ccuser44) Improve bug report form (#1345)"; + "(Git/EasternBloxxer) Fix PrivateMessage for TranksBlack (#1349)"; + "(Git/alau740) Notify admins what rank they are upon joining (#1303)"; + "(Git/ccuser44) Make givepoints an alias (#1334)"; + "(Git/wilsontulus) Update !playerinfo command - Get Render Resolution (#1287)"; + ""; "[v241 2024-01-08 12:06 UTC] @Dimenpsyonal"; "Command Box now scrolls (#1307)"; ":BuyItem now only blocks limiteds (#1223)";