diff --git a/MainModule/Server/Commands/Admins.luau b/MainModule/Server/Commands/Admins.luau index dd12dd9099..7fa610adf2 100644 --- a/MainModule/Server/Commands/Admins.luau +++ b/MainModule/Server/Commands/Admins.luau @@ -1328,7 +1328,7 @@ return function(Vargs, env) }) local nlogs = #logs - if nlogs > 1000 then + if nlogs > Logs.OldCommandLogsLimit then table.remove(logs, nlogs) end diff --git a/MainModule/Server/Core/Logs.luau b/MainModule/Server/Core/Logs.luau index 966e9b3e94..91b571690e 100644 --- a/MainModule/Server/Core/Logs.luau +++ b/MainModule/Server/Core/Logs.luau @@ -14,7 +14,6 @@ return function(Vargs, GetEnv) local service = Vargs.Service; local DLL = server.DLL; - local MaxLogs = 1000 local Functions, Admin, Anti, Core, HTTP, Logs, Remote, Process, Variables, Settings local function Init() Functions = server.Functions; @@ -27,8 +26,7 @@ return function(Vargs, GetEnv) Process = server.Process; Variables = server.Variables; Settings = server.Settings; - - MaxLogs = Settings.MaxLogs; + Logs.MaxLogs = Settings.MaxLogs; Logs.Init = nil; Logs:AddLog("Script", "Logging Module Initialized"); @@ -47,6 +45,7 @@ return function(Vargs, GetEnv) Exploit = if UseDLL then DLL.new() else {}; Errors = if UseDLL then DLL.new() else {}; DateTime = if UseDLL then DLL.new() else {}; + MaxLogs = 1000; TempUpdaters = {}; OldCommandLogsLimit = 1000; --// Maximum number of command logs to save to the datastore (the higher the number, the longer the server will take to close) @@ -91,10 +90,10 @@ return function(Vargs, GetEnv) end if tab.__meta == "DLL" then - tab:AddToStartAndRemoveEndIfEnd(log, MaxLogs) + tab:AddToStartAndRemoveEndIfEnd(log, Logs.MaxLogs) else table.insert(tab, 1, log) - if #tab > tonumber(MaxLogs) then + if #tab > tonumber(Logs.MaxLogs) then table.remove(tab, #tab) end end diff --git a/MainModule/Server/Plugins/Server-SoftShutdown.luau b/MainModule/Server/Plugins/Server-SoftShutdown.luau index d04f28ce49..4c5cc16f3d 100644 --- a/MainModule/Server/Plugins/Server-SoftShutdown.luau +++ b/MainModule/Server/Plugins/Server-SoftShutdown.luau @@ -158,7 +158,7 @@ return function(Vargs, GetEnv) }) end - if #logs > 1000 then + if #logs > Logs.OldCommandLogsLimit then table.remove(logs, #logs) end