From 225e102fa13393be513a5b70178490c10b6a89cd Mon Sep 17 00:00:00 2001 From: Sky Date: Fri, 8 Oct 2021 13:35:47 -0400 Subject: [PATCH] v229 --- Loader/Config/Settings.lua | 11 +- .../Client/UI/Default/Notification.rbxmx | 41 +- MainModule/Client/UI/Default/UserPanel.lua | 10 +- MainModule/Client/UI/Default/Window.rbxmx | 124 ++--- MainModule/Client/UI/Rounded.rbxmx | 508 +++++++++++++----- MainModule/Server/Commands/Admins.lua | 26 +- MainModule/Server/Commands/Fun.lua | 10 +- MainModule/Server/Commands/Moderators.lua | 40 +- MainModule/Server/Core/Admin.lua | 47 +- .../Server/Dependencies/DefaultSettings.lua | 11 +- MainModule/Server/Shared/Changelog.lua | 39 +- MainModule/Server/Shared/Service.lua | 4 + 12 files changed, 637 insertions(+), 234 deletions(-) diff --git a/Loader/Config/Settings.lua b/Loader/Config/Settings.lua index 2251c3ec34..11468400ea 100644 --- a/Loader/Config/Settings.lua +++ b/Loader/Config/Settings.lua @@ -9,7 +9,7 @@ local descs = {}; --// Contains settings descriptions -------------- -- SETTINGS -- - -------------- + -------------- --[[ --// Basic Lua Info @@ -206,6 +206,12 @@ local descs = {}; --// Contains settings descriptions -- "ban:200,300" --// Makes it so :ban is only usable by levels 200 and 300 specifically (nothing higher or lower or in between) }; -- Format: {"Command:NewLevel"; "Command:Customrank1,Customrank2,Customrank3";} + --// Use the below table to define "pre-set" command aliases + --// Command aliases; Format: {[":alias ..."] = ":command ..."} + settings.Aliases = { + [":examplealias "] = ":ff | :fling | :fire " --// Order arguments appear in alias string determines their required order in the command message when ran later + }; + settings.Banned = {}; -- List of people banned from the game Format: {"Username"; "Username:UserId"; UserId; "Group:GroupId:GroupRank"; "Group:GroupId"; "Item:ItemID"; "GamePass:GamePassID";} settings.Muted = {}; -- List of people muted Format: {"Username"; "Username:UserId"; UserId; "Group:GroupId:GroupRank"; "Group:GroupId"; "Item:ItemID"; "GamePass:GamePassID";} settings.Blacklist = {}; -- List of people banned from using admin Format: {"Username"; "Username:UserId"; UserId; "Group:GroupId:GroupRank"; "Group:GroupId"; "Item:ItemID"; "GamePass:GamePassID";} @@ -348,6 +354,8 @@ local descs = {}; --// Contains settings descriptions descs.Creators = [[ Anyone to be identified as a place owner; Format: {"Username"; "Username:UserId"; UserId; "Group:GroupId:GroupRank"; "Group:GroupId"; "Item:ItemID";} ]] descs.Permissions = [[ Command permissions; Format: {"Command:NewLevel";} ]] + descs.Aliases = [[ Command aliases; Format: {[":alias ..."] = ":command ..."} ]] + descs.Commands = [[ Custom commands ]] descs.Banned = [[ List of people banned from the game; Format: {"Username"; "Username:UserId"; UserId; "Group:GroupId:GroupRank"; "Group:GroupId"; "Item:ItemID";} ]] descs.Muted = [[ List of people muted; Format: {"Username"; "Username:UserId"; UserId; "Group:GroupId:GroupRank"; "Group:GroupId"; "Item:ItemID";} ]] @@ -445,6 +453,7 @@ local descs = {}; --// Contains settings descriptions --"Creators"; " "; "Permissions"; + --"Aliases"; --"Commands"; " "; "Banned"; diff --git a/MainModule/Client/UI/Default/Notification.rbxmx b/MainModule/Client/UI/Default/Notification.rbxmx index c1ddbb29c3..dce4197786 100644 --- a/MainModule/Client/UI/Default/Notification.rbxmx +++ b/MainModule/Client/UI/Default/Notification.rbxmx @@ -2,7 +2,7 @@ true null nil - + false @@ -56,19 +56,19 @@ true 9 - + Config -1 - + Code - {9DD68714-7FBF-4E41-B6CE-BCB169D849C8} + {E696A2BA-1BCA-4FEE-8F31-220766604DE3} - + AllowMultiple @@ -235,7 +236,7 @@ end]]> true - + CanKeepAlive @@ -245,7 +246,7 @@ end]]> - + false @@ -299,7 +300,7 @@ end]]> true 1 - + true @@ -380,7 +381,7 @@ end]]> 10 - + true @@ -460,7 +461,7 @@ end]]> true 10 - + 20 @@ -471,7 +472,7 @@ end]]> - + false @@ -548,7 +549,7 @@ end]]> 10 - + false @@ -625,7 +626,7 @@ end]]> 10 - + false @@ -715,4 +716,4 @@ end]]> - + \ No newline at end of file diff --git a/MainModule/Client/UI/Default/UserPanel.lua b/MainModule/Client/UI/Default/UserPanel.lua index 642d969615..38e90f44c0 100644 --- a/MainModule/Client/UI/Default/UserPanel.lua +++ b/MainModule/Client/UI/Default/UserPanel.lua @@ -45,7 +45,7 @@ return function(data) local window = client.UI.Make("Window",{ Name = "UserPanel"; Title = "Adonis"; - Icon = "rbxassetid://4335479121"; + Icon = "rbxassetid://7681261289"; --"rbxassetid://7681088830"; --"rbxassetid://7681233602"; --"rbxassetid://7681048299"; Size = {465, 325}; AllowMultiple = false; OnClose = function() @@ -353,9 +353,9 @@ return function(data) Size = UDim2.new(0, 18, 0, 18); Position = UDim2.new(1, -22, 0, 4); }) - + end - + --// Donor Tab do @@ -1127,7 +1127,7 @@ return function(data) end end }) - + orgTextTransparency = removeButton.TextTransparency if removeButton.AutoButtonColor then -- considers certain themes with AutoButtonColor = false autoButtonColor = true @@ -1467,7 +1467,7 @@ return function(data) }) end end - elseif not canEditTables[setting] then + elseif not canEditTables[setting] then gameTab:Add("TextLabel", { Text = " "..setting..": "; ToolTip = desc; diff --git a/MainModule/Client/UI/Default/Window.rbxmx b/MainModule/Client/UI/Default/Window.rbxmx index a6c3c57a29..145ea2b2be 100644 --- a/MainModule/Client/UI/Default/Window.rbxmx +++ b/MainModule/Client/UI/Default/Window.rbxmx @@ -2,7 +2,7 @@ true null nil - + false @@ -16,7 +16,7 @@ 0 - + false @@ -92,7 +92,7 @@ false 2 - + true @@ -179,7 +179,7 @@ 2 - + Desc @@ -189,7 +189,7 @@ - + false @@ -243,7 +243,7 @@ false 2 - + Percentage @@ -252,7 +252,7 @@ 0 - + false @@ -307,7 +307,7 @@ 2 - + false @@ -395,7 +395,7 @@ 2 - + false @@ -484,7 +484,7 @@ - + false @@ -538,7 +538,7 @@ false 1 - + true @@ -619,7 +619,7 @@ 1 - + true @@ -713,7 +713,7 @@ 1 - + false @@ -769,14 +769,14 @@ - + Config -1 - + CanKeepAlive @@ -785,7 +785,7 @@ true - + AllowMultiple @@ -794,12 +794,12 @@ true - + Code - {D3ADB31E-582B-4AC1-89DB-C1BEA60D38FC} + {0438BE1E-CCDB-4442-A532-B46D59DFE6D2} - + false @@ -2561,7 +2561,7 @@ end]]> false 2 - + true @@ -2642,7 +2642,7 @@ end]]> 2 - + Desc @@ -2652,7 +2652,7 @@ end]]> - + false @@ -2728,7 +2728,7 @@ end]]> false 2 - + true @@ -2809,7 +2809,7 @@ end]]> 2 - + Desc @@ -2819,7 +2819,7 @@ end]]> - + true @@ -2899,7 +2899,7 @@ end]]> true 1 - + true @@ -2979,7 +2979,7 @@ end]]> true 2 - + false @@ -3068,7 +3068,7 @@ end]]> - + true @@ -3162,7 +3162,7 @@ end]]> 2 - + true @@ -3243,7 +3243,7 @@ end]]> 2 - + true @@ -3323,7 +3323,7 @@ end]]> true 2 - + false @@ -3401,7 +3401,7 @@ end]]> - + false @@ -3437,9 +3437,9 @@ end]]> null 0 - 26 + 24 0 - 0 + 1 false null @@ -3478,7 +3478,7 @@ end]]> 9 - + false @@ -3532,7 +3532,7 @@ end]]> true 1 - + false @@ -3626,7 +3626,7 @@ end]]> 1 - + false @@ -3720,7 +3720,7 @@ end]]> 1 - + false @@ -3808,7 +3808,7 @@ end]]> 1 - + false @@ -3896,7 +3896,7 @@ end]]> 1 - + false @@ -3990,7 +3990,7 @@ end]]> 1 - + false @@ -4084,7 +4084,7 @@ end]]> 1 - + false @@ -4178,7 +4178,7 @@ end]]> 1 - + false @@ -4272,7 +4272,7 @@ end]]> 1 - + true @@ -4353,7 +4353,7 @@ end]]> 1 - + false @@ -4447,7 +4447,7 @@ end]]> 1 - + false @@ -4543,7 +4543,7 @@ end]]> - + Check @@ -4552,7 +4552,7 @@ end]]> true - + false @@ -4606,7 +4606,7 @@ end]]> false 1 - + false @@ -4687,7 +4687,7 @@ end]]> 1 - + false @@ -4743,7 +4743,7 @@ end]]> - + false @@ -4819,7 +4819,7 @@ end]]> false 2 - + true @@ -4900,7 +4900,7 @@ end]]> 2 - + Desc @@ -4910,7 +4910,7 @@ end]]> - + false @@ -4964,7 +4964,7 @@ end]]> false 2 - + Desc @@ -4973,7 +4973,7 @@ end]]> TestDesc - + false @@ -5050,7 +5050,7 @@ end]]> 2 - + false @@ -5128,7 +5128,7 @@ end]]> - + true @@ -5209,7 +5209,7 @@ end]]> 2 - + false @@ -5263,7 +5263,7 @@ end]]> false 999999 - + false @@ -5340,7 +5340,7 @@ end]]> 999999 - + @@ -5354,4 +5354,4 @@ end]]> - + \ No newline at end of file diff --git a/MainModule/Client/UI/Rounded.rbxmx b/MainModule/Client/UI/Rounded.rbxmx index 7aa7ca2bc9..75c8448135 100644 --- a/MainModule/Client/UI/Rounded.rbxmx +++ b/MainModule/Client/UI/Rounded.rbxmx @@ -2,14 +2,14 @@ true null nil - + Rounded -1 - + Base_Theme @@ -18,7 +18,7 @@ Default - + false @@ -72,14 +72,14 @@ true 9 - + Config -1 - + AllowMultiple @@ -88,7 +88,7 @@ true - + CanKeepAlive @@ -98,7 +98,7 @@ - + false @@ -152,7 +152,7 @@ true 1 - + true @@ -232,7 +232,7 @@ true 10 - + @@ -245,7 +245,7 @@ - + true @@ -326,7 +326,7 @@ 10 - + false @@ -362,9 +362,9 @@ null 0 - 5 + 30 0 - 5 + 8 false null @@ -373,7 +373,7 @@ null 1 - 0 + -25 0 15 @@ -403,7 +403,7 @@ 10 - + false @@ -480,8 +480,272 @@ 10 + + + false + + 0 + 0 + + + true + 0 + + 1 + 1 + 1 + + 1 + + 0.105882362 + 0.164705887 + 0.207843155 + + 0 + 0 + false + false + rbxassetid://7510999669 + + 1 + 1 + 1 + + + 0 + 0 + + + 0 + 0 + + 0 + 0 + Icon + null + null + null + null + + 0 + 5 + 0 + 5 + + 0 + null + 0 + 0 + false + null + + 0 + 20 + 0 + 20 + + 0 + + + 0 + 0 + + + 0 + 0 + + + 1 + -1 + + + 1 + 0 + 1 + 0 + + true + 10 + + + + + false + + 0 + 0 + + + true + 0 + + 1 + 1 + 1 + + 1 + + 0.105882362 + 0.164705887 + 0.207843155 + + 0 + 0 + false + false + rbxassetid://7510999669 + + 1 + 1 + 1 + + + 0 + 0 + + + 0 + 0 + + 0 + 0 + Icon + null + null + null + null + + 0 + 5 + 0 + 5 + + 0 + null + 0 + 0 + false + null + + 0 + 20 + 0 + 20 + + 0 + + + 0 + 0 + + + 0 + 0 + + + 1 + -1 + + + 1 + 0 + 1 + 0 + + true + 10 + + + + + false + + 0 + 0 + + + true + 0 + + 1 + 1 + 1 + + 1 + + 0.105882362 + 0.164705887 + 0.207843155 + + 0 + 0 + false + false + rbxassetid://7510999669 + + 1 + 1 + 1 + + + 0 + 0 + + + 0 + 0 + + 0 + 0 + Icon + null + null + null + null + + 0 + 5 + 0 + 5 + + 0 + null + 0 + 0 + false + null + + 0 + 20 + 0 + 20 + + 0 + + + 0 + 0 + + + 0 + 0 + + + 1 + -1 + + + 1 + 0 + 1 + 0 + + true + 10 + + - + @@ -494,7 +758,7 @@ - + false @@ -508,7 +772,7 @@ 0 - + false @@ -562,7 +826,7 @@ true 1 - + false @@ -643,7 +907,7 @@ 2 - + true @@ -729,7 +993,7 @@ true 1 - + @@ -742,7 +1006,7 @@ - + false @@ -823,7 +1087,7 @@ 2 - + @@ -836,7 +1100,7 @@ - + true @@ -917,14 +1181,14 @@ 3 - + Config -1 - + CanKeepAlive @@ -933,7 +1197,7 @@ false - + @@ -1157,7 +1421,7 @@ end]]> - + AllowMultiple @@ -1168,7 +1432,7 @@ end]]> - + false @@ -1182,7 +1446,7 @@ end]]> 0 - + false @@ -1236,7 +1500,7 @@ end]]> true 10 - + false @@ -1313,7 +1577,7 @@ end]]> 11 - + false @@ -1390,7 +1654,7 @@ end]]> 12 - + @@ -1402,7 +1666,7 @@ end]]> - + false @@ -1480,14 +1744,14 @@ end]]> - + Config -1 - + @@ -1533,7 +1797,7 @@ end]]> - + AllowMultiple @@ -1542,7 +1806,7 @@ end]]> true - + CanKeepAlive @@ -1553,7 +1817,7 @@ end]]> - + false @@ -1567,7 +1831,7 @@ end]]> 0 - + false @@ -1643,7 +1907,7 @@ end]]> false 2 - + true @@ -1730,7 +1994,7 @@ end]]> 2 - + Desc @@ -1740,7 +2004,7 @@ end]]> - + false @@ -1794,7 +2058,7 @@ end]]> false 2 - + Percentage @@ -1803,7 +2067,7 @@ end]]> 0 - + false @@ -1858,7 +2122,7 @@ end]]> 2 - + false @@ -1946,7 +2210,7 @@ end]]> 2 - + false @@ -2035,7 +2299,7 @@ end]]> - + false @@ -2089,7 +2353,7 @@ end]]> false 999999 - + false @@ -2166,7 +2430,7 @@ end]]> 999999 - + @@ -2179,7 +2443,7 @@ end]]> - + false @@ -2233,7 +2497,7 @@ end]]> false 1 - + true @@ -2314,7 +2578,7 @@ end]]> 1 - + true @@ -2408,7 +2672,7 @@ end]]> 1 - + false @@ -2464,14 +2728,14 @@ end]]> - + Config -1 - + CanKeepAlive @@ -2480,7 +2744,7 @@ end]]> true - + AllowMultiple @@ -2489,7 +2753,7 @@ end]]> true - + @@ -2575,7 +2839,7 @@ end]]> - + false @@ -2651,7 +2915,7 @@ end]]> false 2 - + true @@ -2732,7 +2996,7 @@ end]]> 2 - + Desc @@ -2742,7 +3006,7 @@ end]]> - + false @@ -2818,7 +3082,7 @@ end]]> false 2 - + true @@ -2899,7 +3163,7 @@ end]]> 2 - + Desc @@ -2909,7 +3173,7 @@ end]]> - + true @@ -2989,7 +3253,7 @@ end]]> true 1 - + true @@ -3069,7 +3333,7 @@ end]]> true 2 - + false @@ -3157,7 +3421,7 @@ end]]> 10 - + @@ -3170,7 +3434,7 @@ end]]> - + true @@ -3221,7 +3485,7 @@ end]]> null 0 - 6 + 8 0 8 @@ -3235,9 +3499,9 @@ end]]> null 0 - 14 + 16 0 - 14 + 16 0 @@ -3264,7 +3528,7 @@ end]]> 2 - + true @@ -3344,7 +3608,7 @@ end]]> true 2 - + @@ -3356,7 +3620,7 @@ end]]> - + false @@ -3434,7 +3698,7 @@ end]]> - + true @@ -3514,7 +3778,7 @@ end]]> true 2 - + false @@ -3591,7 +3855,7 @@ end]]> 10 - + @@ -3604,7 +3868,7 @@ end]]> - + false @@ -3640,9 +3904,9 @@ end]]> null 0 - 26 + 30 0 - 2 + 3 false null @@ -3681,7 +3945,7 @@ end]]> 9 - + false @@ -3735,7 +3999,7 @@ end]]> true 1 - + false @@ -3829,7 +4093,7 @@ end]]> 1 - + false @@ -3923,7 +4187,7 @@ end]]> 1 - + false @@ -4011,7 +4275,7 @@ end]]> 1 - + false @@ -4099,7 +4363,7 @@ end]]> 1 - + false @@ -4193,7 +4457,7 @@ end]]> 1 - + false @@ -4287,7 +4551,7 @@ end]]> 1 - + false @@ -4381,7 +4645,7 @@ end]]> 1 - + false @@ -4475,7 +4739,7 @@ end]]> 1 - + true @@ -4556,7 +4820,7 @@ end]]> 2 - + false @@ -4650,7 +4914,7 @@ end]]> 1 - + false @@ -4744,7 +5008,7 @@ end]]> 1 - + @@ -4756,7 +5020,7 @@ end]]> - + false @@ -4810,7 +5074,7 @@ end]]> true 1 - + @@ -4824,7 +5088,7 @@ end]]> - + @@ -4837,7 +5101,7 @@ end]]> - + Check @@ -4846,7 +5110,7 @@ end]]> true - + false @@ -4900,7 +5164,7 @@ end]]> false 1 - + false @@ -4981,7 +5245,7 @@ end]]> 1 - + false @@ -5037,7 +5301,7 @@ end]]> - + false @@ -5113,7 +5377,7 @@ end]]> false 2 - + true @@ -5194,7 +5458,7 @@ end]]> 2 - + Desc @@ -5204,7 +5468,7 @@ end]]> - + false @@ -5258,7 +5522,7 @@ end]]> false 2 - + Desc @@ -5267,7 +5531,7 @@ end]]> TestDesc - + false @@ -5344,7 +5608,7 @@ end]]> 2 - + false @@ -5422,7 +5686,7 @@ end]]> - + true @@ -5502,7 +5766,7 @@ end]]> true 2 - + @@ -5516,7 +5780,7 @@ end]]> - + false @@ -5530,14 +5794,14 @@ end]]> 0 - + Config -1 - + AllowMultiple @@ -5546,7 +5810,7 @@ end]]> true - + CanKeepAlive @@ -5555,7 +5819,7 @@ end]]> true - + @@ -5669,7 +5933,7 @@ end]]> - + false @@ -5723,7 +5987,7 @@ end]]> true 9 - + @@ -5735,7 +5999,7 @@ end]]> - + false @@ -5789,7 +6053,7 @@ end]]> true 9000000 - + false @@ -5866,7 +6130,7 @@ end]]> 9000000 - + false @@ -5943,7 +6207,7 @@ end]]> 9000000 - + @@ -5959,4 +6223,4 @@ end]]> - + \ No newline at end of file diff --git a/MainModule/Server/Commands/Admins.lua b/MainModule/Server/Commands/Admins.lua index 20e5acda2a..521a62de53 100644 --- a/MainModule/Server/Commands/Admins.lua +++ b/MainModule/Server/Commands/Admins.lua @@ -1296,18 +1296,30 @@ return function(Vargs, env) local list = trello.getListObj(lists,{"Banlist","Ban List","Bans"}) local level = data.PlayerData.Level + local reason = string.format("Administrator: %s\nReason: %s", plr.Name, (args[2] or "N/A")) + for _, v in pairs(service.GetPlayers(plr,args[1], { - DontError = false; - IsServer = false; - IsKicking = true; - UseFakePlayer = true; + DontError = false; + IsServer = false; + IsKicking = true; + UseFakePlayer = true; })) do + if level > Admin.GetLevel(v) then - trello.makeCard(list.id, + trello.makeCard( + list.id, string.format("%s:%d", (v and tostring(v.Name) or tostring(v)), tostring(v.UserId)), - string.format("Administrator: %s\nReason: %s", plr.Name, (args[2] or "N/A")) + reason ) - Functions.Hint("Trello banned ".. (v and tostring(v.Name) or tostring(v)), {plr}) + + --Functions.Hint("Trello banned ".. (v and tostring(v.Name) or tostring(v)), {plr}) + pcall(function() plr:Kick(reason) end) + Remote.MakeGui(p,"Notification",{ + Title = "Notification"; + Message = "Trello banned ".. (v and tostring(v.Name) or tostring(v)); + Icon = "rbxassetid://7536784790"; + Time = 5; + }) end end diff --git a/MainModule/Server/Commands/Fun.lua b/MainModule/Server/Commands/Fun.lua index 39808a8842..d8697347ff 100644 --- a/MainModule/Server/Commands/Fun.lua +++ b/MainModule/Server/Commands/Fun.lua @@ -156,9 +156,9 @@ return function(Vargs, env) Function = function(plr,args) --// Apparently Rojo doesn't handle mesh parts very well, so I'm loading this remotely (using require to bypass insertservice restrictions) --// The model is free to take so feel free to that 👍 - --// Here's the URL https://www.roblox.com/library/7405942066/AssetModule + --// Here's the URL https://www.roblox.com/library/7679952474/AssetModule - local rAssets = require(7405942066); + local rAssets = require(7679952474); --// This apparently caches, so don't delete anything else future usage breaks local gerald = rAssets.Gerald; for i,v in pairs(service.GetPlayers(plr,args[1])) do @@ -171,8 +171,6 @@ return function(Vargs, env) end end end - - rAssets:Destroy(); --// Dunno if this is actually going to help anything but why not end }; @@ -4482,7 +4480,7 @@ return function(Vargs, env) end end }; - + BlurEffect = { Prefix = Settings.Prefix; Commands = {"blur";"screenblur";"blureffect"}; @@ -4660,7 +4658,7 @@ return function(Vargs, env) if info.AssetTypeId == 8 or (info.AssetTypeId >= 41 and info.AssetTypeId <= 47) then local hat = service.Insert(id) assert(hat,"Invalid ID") - + for i,v in pairs(service.GetPlayers(plr, args[1])) do if v.Character and hat then hat:Clone().Parent = v.Character diff --git a/MainModule/Server/Commands/Moderators.lua b/MainModule/Server/Commands/Moderators.lua index c92ef11e2a..35bcda8d06 100644 --- a/MainModule/Server/Commands/Moderators.lua +++ b/MainModule/Server/Commands/Moderators.lua @@ -393,8 +393,44 @@ return function(Vargs, env) Message = args[2]; }) - Remote.MakeGui(plr, "Hint", { + Remote.MakeGui(p,"Notification",{ + Title = "Notification"; Message = "Warned ".. v.Name; + Icon = "rbxassetid://7536784790"; + Time = 5; + }) + end + end + end + }; + + RemoveWarning = { + Prefix = Settings.Prefix; + Commands = {"removewarning"}; + Args = {"player","message";}; + Filter = false; + Description = "Removes the specified warning from the target player(s)"; + AdminLevel = "Moderators"; + Function = function(plr, args, data) + assert(args[1] and args[2], "Argument missing or nil") + + local plrLevel = data.PlayerData.Level + for _, v in ipairs(service.GetPlayers(plr, args[1])) do + local targLevel = Admin.GetLevel(v) + if plrLevel > targLevel then + local data = Core.GetPlayer(v) + + for i,v in ipairs(data.Warnings) do + if v.Message:lower() == args[2]:lower() then + table.remove(data.Warnings, i) + end + end + + Remote.MakeGui(p,"Notification",{ + Title = "Notification"; + Message = "Removed warning from ".. v.Name; + Icon = "rbxassetid://7536784790"; + Time = 5; }) end end @@ -5256,7 +5292,7 @@ return function(Vargs, env) if not v or v.Parent ~= service.Players then service.StopLoop(UserId .. "LOOPHEAL") end - + local Character = v.Character if Character then local Humanoid = Character:FindFirstChildOfClass("Humanoid") diff --git a/MainModule/Server/Core/Admin.lua b/MainModule/Server/Core/Admin.lua index 25b724fb02..c57ac6322f 100644 --- a/MainModule/Server/Core/Admin.lua +++ b/MainModule/Server/Core/Admin.lua @@ -158,30 +158,48 @@ return function(Vargs) end end) + local function stripArgPlaceholders(alias) + return service.Trim(alias:gsub("<%S+>", "")) + end + local function FormatAliasArgs(alias, aliasCmd, msg) local uniqueArgs = {} local argTab = {} local numArgs = 0; - --local cmdArgs = - for arg in string.gmatch(aliasCmd, "<(%S+)>") do + --// First try to extract args info from the alias + for arg in string.gmatch(alias, "<(%S+)>") do if arg ~= "" and arg ~= " " then local arg = "<".. arg ..">" - if not uniqueArgs[arg] then --// Get only unique placeholder args, repeats will be matched to the same arg pos + if not uniqueArgs[arg] then numArgs = numArgs+1; - uniqueArgs[arg] = true; --// :cmd + uniqueArgs[arg] = true; table.insert(argTab, arg) end end end + --// If no args in alias string, check the command string instead and try to guess args based on order of appearance + if numArgs == 0 then + for arg in string.gmatch(aliasCmd, "<(%S+)>") do + if arg ~= "" and arg ~= " " then + local arg = "<".. arg ..">" + if not uniqueArgs[arg] then --// Get only unique placeholder args, repeats will be matched to the same arg pos + numArgs = numArgs+1; + uniqueArgs[arg] = true; --// :cmd + table.insert(argTab, arg) + end + end + end + end + local suppliedArgs = Admin.GetArgs(msg, numArgs) -- User supplied args (when running :alias arg) local out = aliasCmd; for i,argType in next,argTab do local replaceWith = suppliedArgs[i] if replaceWith then - out = string.gsub(out, argType, replaceWith) + out = string.gsub(out, service.EscapeSpecialCharacters(argType), replaceWith) end end @@ -956,16 +974,31 @@ return function(Vargs) end; AliasFormat = function(aliases, msg) + local foundPlayerAlias = false; --// Check if there's a player-defined alias first then ifnot check settings aliases if aliases then for alias,cmd in pairs(aliases) do - if not Admin.CheckAliasBlacklist(alias) then - if string.match(msg, "^"..alias) or string.match(msg, "%s".. alias) then + local tAlias = stripArgPlaceholders(alias) + if not Admin.CheckAliasBlacklist(tAlias) then + local escAlias = service.EscapeSpecialCharacters(tAlias) + if string.match(msg, "^"..escAlias) or string.match(msg, "%s".. escAlias) then msg = FormatAliasArgs(alias, cmd, msg); end end end end + --if not foundPlayerAlias then + for alias,cmd in pairs(Settings.Aliases) do + local tAlias = stripArgPlaceholders(alias) + if not Admin.CheckAliasBlacklist(tAlias) then + local escAlias = service.EscapeSpecialCharacters(tAlias) + if string.match(msg, "^"..escAlias) or string.match(msg, "%s".. escAlias) then + msg = FormatAliasArgs(alias, cmd, msg); + end + end + end + --end + return msg end; diff --git a/MainModule/Server/Dependencies/DefaultSettings.lua b/MainModule/Server/Dependencies/DefaultSettings.lua index 2251c3ec34..11468400ea 100644 --- a/MainModule/Server/Dependencies/DefaultSettings.lua +++ b/MainModule/Server/Dependencies/DefaultSettings.lua @@ -9,7 +9,7 @@ local descs = {}; --// Contains settings descriptions -------------- -- SETTINGS -- - -------------- + -------------- --[[ --// Basic Lua Info @@ -206,6 +206,12 @@ local descs = {}; --// Contains settings descriptions -- "ban:200,300" --// Makes it so :ban is only usable by levels 200 and 300 specifically (nothing higher or lower or in between) }; -- Format: {"Command:NewLevel"; "Command:Customrank1,Customrank2,Customrank3";} + --// Use the below table to define "pre-set" command aliases + --// Command aliases; Format: {[":alias ..."] = ":command ..."} + settings.Aliases = { + [":examplealias "] = ":ff | :fling | :fire " --// Order arguments appear in alias string determines their required order in the command message when ran later + }; + settings.Banned = {}; -- List of people banned from the game Format: {"Username"; "Username:UserId"; UserId; "Group:GroupId:GroupRank"; "Group:GroupId"; "Item:ItemID"; "GamePass:GamePassID";} settings.Muted = {}; -- List of people muted Format: {"Username"; "Username:UserId"; UserId; "Group:GroupId:GroupRank"; "Group:GroupId"; "Item:ItemID"; "GamePass:GamePassID";} settings.Blacklist = {}; -- List of people banned from using admin Format: {"Username"; "Username:UserId"; UserId; "Group:GroupId:GroupRank"; "Group:GroupId"; "Item:ItemID"; "GamePass:GamePassID";} @@ -348,6 +354,8 @@ local descs = {}; --// Contains settings descriptions descs.Creators = [[ Anyone to be identified as a place owner; Format: {"Username"; "Username:UserId"; UserId; "Group:GroupId:GroupRank"; "Group:GroupId"; "Item:ItemID";} ]] descs.Permissions = [[ Command permissions; Format: {"Command:NewLevel";} ]] + descs.Aliases = [[ Command aliases; Format: {[":alias ..."] = ":command ..."} ]] + descs.Commands = [[ Custom commands ]] descs.Banned = [[ List of people banned from the game; Format: {"Username"; "Username:UserId"; UserId; "Group:GroupId:GroupRank"; "Group:GroupId"; "Item:ItemID";} ]] descs.Muted = [[ List of people muted; Format: {"Username"; "Username:UserId"; UserId; "Group:GroupId:GroupRank"; "Group:GroupId"; "Item:ItemID";} ]] @@ -445,6 +453,7 @@ local descs = {}; --// Contains settings descriptions --"Creators"; " "; "Permissions"; + --"Aliases"; --"Commands"; " "; "Banned"; diff --git a/MainModule/Server/Shared/Changelog.lua b/MainModule/Server/Shared/Changelog.lua index a5de9b5c71..24a1ea286f 100644 --- a/MainModule/Server/Shared/Changelog.lua +++ b/MainModule/Server/Shared/Changelog.lua @@ -1,7 +1,44 @@ return { - "Version: 228"; + "Version: 229"; "*Drag edges to expand*"; ""; + "[v229 10.8.2021 13:35 EST]"; + "*Fixed an issue with icons in notifications caused by a merge"; + "*Fixed an issue where :gerald could only be used once"; + "*Added ':removewarning player warning_message'"; + "*Added Settings.Aliases"; + "*Special characters are now escaped in alises"; + "*Alias arguments can now be defined as part of the alias string (eg, ':somealias ' -> ':ff | :fire ')"; + "(Git/fxeP1) TrelloBan fix, Commands/PlayerFinders/Track Command changes #515"; + "(Git/alau740) Notifications for some commands, add some music #513"; + "(Git/alau740) Add missing icons, add '@username' to ':usage' #508"; + "(Git/ccuser44) Removed some pre-fe code #507"; + "(Git/jaydensar, joritochip, LolloDev5123) Various GitHub repo-specific changes"; + "(Git/Expertcoders) Notification icons #505"; + "(Git/ccuser44) Reintroduced vanilla loadstring usage (when available) #504"; + "(Git/alau740) :cmdinfo now shows admin rank for command, fix cmd alias typo #499"; + "(Git/fxeP1) Map resotre/backup fix, HideChatCmd fixes, Anti Responding fix(?) #496"; + "(Git/alau740) Add timeban alias :tempban #495"; + "(Git/Expertcoderz) Replaced :inspect with !profile #494"; + "(Git/ccuser44) Fixed ban naming #492"; + "(Git/alau740) Update init.lua #491"; + "(Git/alau740) Confirm prompt to :clearplayerdata, add option to disable cross-server commands, global time messages, misc other stuff #490"; + "(Git/Expertcoderz) Add !rank, !brickcolors, !materials, updated !usage #489"; + "(Git/LolloDev5123) ...A lot of changes: #488"; + "***Optimize some messages displayed to the player or logged"; + "***Added testfilter command"; + "***AdonisEncrypt functionality"; + "***Add reason to time/temp ban"; + "***Anti-exploit notifications"; + "***Synapse chunk error detection & AE lookFor table updates"; + "***Automatically update list when search text changes"; + "***:restart (Soft shutdown)"; + "***Make :puke have more vomit"; + "***Remove very short admin aliases (:pa, :oa, etc)"; + "(Git/Expertcoderz) Userpanel update #487"; + "(Git/fxeP1) Fixed yielding/errors on refresh/respawn #486"; + "(Git/alau740) Selectable text for Aero and Unity themes, fix incomplete title in datastore warning #484"; + ""; "[v228 9.8.2021 15:40 EST]"; "*Fixed :hat"; "*Added :gerald"; diff --git a/MainModule/Server/Shared/Service.lua b/MainModule/Server/Shared/Service.lua index 6d176f9792..a29190fb6b 100644 --- a/MainModule/Server/Shared/Service.lua +++ b/MainModule/Server/Shared/Service.lua @@ -735,6 +735,10 @@ return function(errorHandler, eventChecker, fenceSpecific) return new or "Filter Error" end; + EscapeSpecialCharacters = function(x) + return x:gsub("([^%w])", "%%%1") + end; + MetaFunc = function(func) return service.NewProxy { __call = function(tab,...)