Compare commits
No commits in common. "Main" and "v1.1.2" have entirely different histories.
19
CHANGELOG.md
19
CHANGELOG.md
|
|
@ -20,21 +20,4 @@ I will use this area to keep up with what i did last.
|
|||
|
||||
## [Release 1.1.2]
|
||||
|
||||
- Combined the 2 dev tool resources togethter to make one total tool for easier maintaining
|
||||
|
||||
## [Release 1.1.3]
|
||||
|
||||
- Updated snippets for SLF to align with new coding processes
|
||||
- Updated templates for resource builder to build to new coding process
|
||||
|
||||
## [Release 1.1.4]
|
||||
|
||||
- Updated logging functions on all scripts and snippets to allow for the new on the fly log change.
|
||||
|
||||
## [Release 1.1.5]
|
||||
- The Christina update
|
||||
- Added in cleaner snippets for SLF and updated templates to match when creating a new resource.
|
||||
|
||||
## [Release 1.1.6]
|
||||
- Updated all resources generated to have new dependencies on SPH and SDB
|
||||
- Updated to new html code for splashscreens
|
||||
- Combined the 2 dev tool resources togethter to make one total tool for easier maintaining
|
||||
|
|
@ -2,7 +2,7 @@
|
|||
"name": "cstmgames-fivem-snippets",
|
||||
"displayName": "CSTMGames FiveM Dev Tools",
|
||||
"description": "Development tools for FiveM",
|
||||
"version": "1.1.6",
|
||||
"version": "1.1.2",
|
||||
"author": {
|
||||
"name": "Chase Eller",
|
||||
"email": "chase@cstmgames.com",
|
||||
|
|
|
|||
|
|
@ -1,29 +1,23 @@
|
|||
{
|
||||
"Setup SLF Vars": {
|
||||
"prefix": "SLFVARS",
|
||||
"body": [
|
||||
"local CLASS = \"CHANGEME\"--This is the name that the logging framework will use to display your logs in the correct manner",
|
||||
"local LOG_LEVEL = GetResourceMetadata(GetCurrentResourceName(), \"log_level\", 0)",
|
||||
"local RESOURCE_CODE = GetResourceMetadata(GetCurrentResourceName(), \"resource_code\", 0)"
|
||||
],
|
||||
"description": ""
|
||||
},
|
||||
"Log to SLF": {
|
||||
"prefix": "Log",
|
||||
"body": "Log(\"${1:Your Log Message Here}\", ${2|4,3,2,1|})$0",
|
||||
"description": "Sets up basic Log function for use with SLF"
|
||||
},
|
||||
"Log to Discord": {
|
||||
"prefix": "DisLogCall",
|
||||
"prefix": "DisLog",
|
||||
"body": "DisLog(\"${1:Your Error Text Here}\")$0",
|
||||
"description": "SLF Function to log error to Discord."
|
||||
},
|
||||
"DISLOG FUNCTION": {
|
||||
"prefix": "DISLOG",
|
||||
"body": [
|
||||
"local function DisLog(message)",
|
||||
" local line = debug.getinfo(2, \"l\").currentline",
|
||||
" local name = debug.getinfo(2, \"n\").name",
|
||||
" if name == \"fn\" then",
|
||||
" name = \"Thread\"",
|
||||
" end",
|
||||
" local value = \"{\"..CLASS..\".\"..name..\"(\"..line..\")} \"..message",
|
||||
" exports.SLF:LogServerToDiscord(RESOURCE_CODE, message)",
|
||||
"end"
|
||||
],
|
||||
"description": "DISLOG FUNCTION"
|
||||
},
|
||||
"Sets up a basic Citizen Thread for CFX": {
|
||||
"prefix": "thread",
|
||||
"body": [
|
||||
|
|
@ -54,77 +48,39 @@
|
|||
],
|
||||
"description": "Sets up command to be registered"
|
||||
},
|
||||
"SLF Functions and Vars for server.": {
|
||||
"prefix": "SLFSERVER",
|
||||
"Server Side SLF Function": {
|
||||
"prefix": "slfserver",
|
||||
"body": [
|
||||
"--SLF CONSTANTS",
|
||||
"local CLASS = \"CHANGEME\"--This is the name that the logging framework will use to display your logs in the correct manner",
|
||||
"local LOG_LEVEL = GetResourceMetadata(GetCurrentResourceName(), \"log_level\", 0)",
|
||||
"local RESOURCE_CODE = GetResourceMetadata(GetCurrentResourceName(), \"resource_code\", 0)",
|
||||
"------------------------------------------------------------------------------------------------",
|
||||
"---Used to send logs to the server console",
|
||||
"---@param message any Preformatted message or VARIABLES to be sent to log",
|
||||
"---@param logLevel integer Level of log, 1-Error, 2-Warn, 3-Info, 4-Debug",
|
||||
"local function Log(message, logLevel)",
|
||||
"function Log(message, logLevel)",
|
||||
" local line = debug.getinfo(2, \"l\").currentline",
|
||||
" local name = debug.getinfo(2, \"n\").name",
|
||||
" if name == \"fn\" then",
|
||||
" name = \"Thread\"",
|
||||
" end",
|
||||
" local value = \"{\"..CLASS..\".\"..name..\"(\"..line..\")} \"..message",
|
||||
" if logLevel then",
|
||||
" if tonumber(LOG_LEVEL) >= logLevel then",
|
||||
" exports.SLF:LogToServer(RESOURCE_CODE, logLevel, value)",
|
||||
" end",
|
||||
" else",
|
||||
" exports.SLF:LogToServer(RESOURCE_CODE, 4, value)",
|
||||
" Log(\"Warning line was logged without a level value... Logged it as debug as that is the safest route.\", 1)",
|
||||
" if tonumber(LOG_LEVEL) >= logLevel then",
|
||||
" exports.SLF:LogToServer(RESOURCE_CODE, logLevel, value)",
|
||||
" end",
|
||||
"end",
|
||||
"",
|
||||
"RegisterNetEvent(RESOURCE_CODE..\":UpdateLogLevel\")",
|
||||
"AddEventHandler(RESOURCE_CODE..\":UpdateLogLevel\", function(num)",
|
||||
" LOG_LEVEL = num",
|
||||
"end)",
|
||||
"-----------------------------------------------------------------------------------------------"
|
||||
"end"
|
||||
],
|
||||
"description": "SLF Functions and Vars for server."
|
||||
"description": "Server Side SLF Function"
|
||||
},
|
||||
"SLF Functions and Vars for client.": {
|
||||
"prefix": "SLFCLIENT",
|
||||
"Client Side SLF Function": {
|
||||
"prefix": "slfclient",
|
||||
"body": [
|
||||
"--SLF CONSTANTS",
|
||||
"local CLASS = \"CHANGEME\"--This is the name that the logging framework will use to display your logs in the correct manner",
|
||||
"local LOG_LEVEL = GetResourceMetadata(GetCurrentResourceName(), \"log_level\", 0)",
|
||||
"local RESOURCE_CODE = GetResourceMetadata(GetCurrentResourceName(), \"resource_code\", 0)",
|
||||
"-----------------------------------------------------------------------------------------------",
|
||||
"---Used to send logs to the client console",
|
||||
"---@param message any Preformatted message or VARIABLES to be sent to log",
|
||||
"---@param logLevel integer Level of log, 1-Error, 2-Warn, 3-Info, 4-Debug",
|
||||
"local function Log(message, logLevel)",
|
||||
"function Log(message, logLevel)",
|
||||
" local line = debug.getinfo(2, \"l\").currentline",
|
||||
" local name = debug.getinfo(2, \"n\").name",
|
||||
" if name == \"fn\" then",
|
||||
" name = \"Thread\"",
|
||||
" end",
|
||||
" local value = \"{\"..CLASS..\".\"..name..\"(\"..line..\")} \"..message",
|
||||
" if logLevel then",
|
||||
" if tonumber(LOG_LEVEL) >= logLevel then",
|
||||
" exports.SLF:LogToClient(RESOURCE_CODE, logLevel, value)",
|
||||
" end",
|
||||
" else",
|
||||
" exports.SLF:LogToClient(RESOURCE_CODE, 4, value)",
|
||||
" Log(\"Warning line was logged without a level value... Logged it as debug as that is the safest route.\", 1)",
|
||||
" if tonumber(LOG_LEVEL) >= logLevel then",
|
||||
" exports.SLF:LogToClient(RESOURCE_CODE, logLevel, value)",
|
||||
" end",
|
||||
"end",
|
||||
"",
|
||||
"RegisterNetEvent(RESOURCE_CODE..\":UpdateLogLevel\")",
|
||||
"AddEventHandler(RESOURCE_CODE..\":UpdateLogLevel\", function(num)",
|
||||
" LOG_LEVEL = num",
|
||||
"end)",
|
||||
"-----------------------------------------------------------------------------------------------"
|
||||
"end"
|
||||
],
|
||||
"description": "SLF Functions and Vars for client."
|
||||
"description": "Client Side SLF Function"
|
||||
},
|
||||
"Sets up TriggerClientEvent": {
|
||||
"prefix": "tce",
|
||||
|
|
@ -218,35 +174,5 @@
|
|||
"end)"
|
||||
],
|
||||
"description": "Thread Net Register"
|
||||
},
|
||||
"Coding Regions": {
|
||||
"prefix": "regions",
|
||||
"body": [
|
||||
"--CONSTANTS--",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"--VARIABLES--",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"--FUNCTIONS--",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"--THREADS--",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"--NET EVENTS--",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"--COMMANDS--",
|
||||
"",
|
||||
"",
|
||||
""
|
||||
],
|
||||
"description": "Coding Regions"
|
||||
}
|
||||
}
|
||||
|
|
@ -1,12 +1,30 @@
|
|||
--SLF CONSTANTS
|
||||
--GLOBAL CONSTANTS
|
||||
local CLASS = "CHANGEME"--This is the name that the logging framework will use to display your logs in the correct manner
|
||||
local LOG_LEVEL = GetResourceMetadata(GetCurrentResourceName(), "log_level", 0)
|
||||
local RESOURCE_CODE = GetResourceMetadata(GetCurrentResourceName(), "resource_code", 0)
|
||||
--LOCAL VARIABLES
|
||||
|
||||
|
||||
|
||||
--END CONFIG
|
||||
-----------------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
|
||||
-------------------
|
||||
--YOUR CODE HERE---
|
||||
--HAPPY CODING!----
|
||||
-------------------
|
||||
|
||||
|
||||
|
||||
------------------------------------------------------------------------------------------------
|
||||
--SLF Server Logging Function DO NOT TOUCH unless you know what you are doing
|
||||
|
||||
---Used to send logs to the client console
|
||||
---@param message any Preformatted message or VARIABLES to be sent to log
|
||||
---@param logLevel integer Level of log, 1-Error, 2-Warn, 3-Info, 4-Debug
|
||||
local function Log(message, logLevel)
|
||||
function Log(message, logLevel)
|
||||
local line = debug.getinfo(2, "l").currentline
|
||||
local name = debug.getinfo(2, "n").name
|
||||
if name == "fn" then
|
||||
|
|
@ -23,31 +41,9 @@ local function Log(message, logLevel)
|
|||
end
|
||||
end
|
||||
|
||||
RegisterNetEvent(RESOURCE_CODE..":UpdateLogLevel")
|
||||
AddEventHandler(RESOURCE_CODE..":UpdateLogLevel", function(num)
|
||||
LOG_LEVEL = num
|
||||
end)
|
||||
-----------------------------------------------------------------------------------------------
|
||||
--CONSTANTS--
|
||||
|
||||
|
||||
|
||||
--VARIABLES--
|
||||
|
||||
|
||||
|
||||
--FUNCTIONS--
|
||||
|
||||
|
||||
|
||||
--THREADS--
|
||||
|
||||
|
||||
|
||||
--NET EVENTS--
|
||||
|
||||
|
||||
|
||||
--COMMANDS--
|
||||
|
||||
|
||||
function GetSID(UUID)
|
||||
Log("Requesting SID for UUID: "..UUID, 4)
|
||||
local SID = exports.SPH:GetSID(UUID)
|
||||
Log("Retreived SID: "..SID.." for UUID: "..UUID, 4)
|
||||
return SID
|
||||
end
|
||||
|
|
|
|||
|
|
@ -12,9 +12,7 @@ bucket_prefix '9'
|
|||
|
||||
dependencies {
|
||||
'SLF',
|
||||
'SCF',
|
||||
'SDB',
|
||||
'SPH'
|
||||
'SCF'
|
||||
}
|
||||
|
||||
files {
|
||||
|
|
|
|||
|
|
@ -1,12 +1,30 @@
|
|||
--SLF CONSTANTS
|
||||
--GLOBAL CONSTANTS
|
||||
local CLASS = "CHANGEME"--This is the name that the logging framework will use to display your logs in the correct manner
|
||||
local LOG_LEVEL = GetResourceMetadata(GetCurrentResourceName(), "log_level", 0)
|
||||
local RESOURCE_CODE = GetResourceMetadata(GetCurrentResourceName(), "resource_code", 0)
|
||||
--Global Variables
|
||||
--LOCAL VARIABLES
|
||||
|
||||
|
||||
--END CONFIG
|
||||
-----------------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
|
||||
-------------------
|
||||
--YOUR CODE HERE---
|
||||
--HAPPY CODING!----
|
||||
-------------------
|
||||
|
||||
|
||||
|
||||
------------------------------------------------------------------------------------------------
|
||||
--SLF Server Logging Function DO NOT TOUCH unless you know what you are doing.
|
||||
|
||||
---Used to send logs to the server console
|
||||
---@param message any Preformatted message or VARIABLES to be sent to log
|
||||
---@param logLevel integer Level of log, 1-Error, 2-Warn, 3-Info, 4-Debug
|
||||
local function Log(message, logLevel)
|
||||
function Log(message, logLevel)
|
||||
local line = debug.getinfo(2, "l").currentline
|
||||
local name = debug.getinfo(2, "n").name
|
||||
if name == "fn" then
|
||||
|
|
@ -23,31 +41,19 @@ local function Log(message, logLevel)
|
|||
end
|
||||
end
|
||||
|
||||
RegisterNetEvent(RESOURCE_CODE..":UpdateLogLevel")
|
||||
AddEventHandler(RESOURCE_CODE..":UpdateLogLevel", function(num)
|
||||
LOG_LEVEL = num
|
||||
end)
|
||||
------------------------------------------------------------------------------------------------
|
||||
--CONSTANTS--
|
||||
|
||||
|
||||
|
||||
--VARIABLES--
|
||||
|
||||
|
||||
|
||||
--FUNCTIONS--
|
||||
|
||||
|
||||
|
||||
--THREADS--
|
||||
|
||||
|
||||
|
||||
--NET EVENTS--
|
||||
|
||||
|
||||
|
||||
--COMMANDS--
|
||||
|
||||
function DisLog(message)
|
||||
local line = debug.getinfo(2, "l").currentline
|
||||
local name = debug.getinfo(2, "n").name
|
||||
if name == "fn" then
|
||||
name = "Thread"
|
||||
end
|
||||
local value = "{"..CLASS.."."..name.."("..line..")} "..message
|
||||
exports.SLF:LogServerToDiscord(RESOURCE_CODE, message)
|
||||
end
|
||||
|
||||
function GetSID(UUID)
|
||||
Log("Requesting SID for UUID: "..UUID, 4)
|
||||
local SID = exports.SPH:GetSID(UUID)
|
||||
Log("Retreived SID: "..SID.." for UUID: "..UUID, 4)
|
||||
return SID
|
||||
end
|
||||
|
|
@ -1,12 +1,30 @@
|
|||
--SLF CONSTANTS
|
||||
--GLOBAL CONSTANTS
|
||||
local CLASS = "CHANGEME"--This is the name that the logging framework will use to display your logs in the correct manner
|
||||
local LOG_LEVEL = GetResourceMetadata(GetCurrentResourceName(), "log_level", 0)
|
||||
local RESOURCE_CODE = GetResourceMetadata(GetCurrentResourceName(), "resource_code", 0)
|
||||
--LOCAL VARIABLES
|
||||
|
||||
|
||||
|
||||
--END CONFIG
|
||||
-----------------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
|
||||
-------------------
|
||||
--YOUR CODE HERE---
|
||||
--HAPPY CODING!----
|
||||
-------------------
|
||||
|
||||
|
||||
|
||||
------------------------------------------------------------------------------------------------
|
||||
--SLF Server Logging Function DO NOT TOUCH unless you know what you are doing
|
||||
|
||||
---Used to send logs to the client console
|
||||
---@param message any Preformatted message or VARIABLES to be sent to log
|
||||
---@param logLevel integer Level of log, 1-Error, 2-Warn, 3-Info, 4-Debug
|
||||
local function Log(message, logLevel)
|
||||
function Log(message, logLevel)
|
||||
local line = debug.getinfo(2, "l").currentline
|
||||
local name = debug.getinfo(2, "n").name
|
||||
if name == "fn" then
|
||||
|
|
@ -23,31 +41,9 @@ local function Log(message, logLevel)
|
|||
end
|
||||
end
|
||||
|
||||
RegisterNetEvent(RESOURCE_CODE..":UpdateLogLevel")
|
||||
AddEventHandler(RESOURCE_CODE..":UpdateLogLevel", function(num)
|
||||
LOG_LEVEL = num
|
||||
end)
|
||||
-----------------------------------------------------------------------------------------------
|
||||
--CONSTANTS--
|
||||
|
||||
|
||||
|
||||
--VARIABLES--
|
||||
|
||||
|
||||
|
||||
--FUNCTIONS--
|
||||
|
||||
|
||||
|
||||
--THREADS--
|
||||
|
||||
|
||||
|
||||
--NET EVENTS--
|
||||
|
||||
|
||||
|
||||
--COMMANDS--
|
||||
|
||||
|
||||
function GetSID(UUID)
|
||||
Log("Requesting SID for UUID: "..UUID, 4)
|
||||
local SID = exports.SPH:GetSID(UUID)
|
||||
Log("Retreived SID: "..SID.." for UUID: "..UUID, 4)
|
||||
return SID
|
||||
end
|
||||
|
|
|
|||
Binary file not shown.
|
|
@ -1,97 +1,38 @@
|
|||
--SLF CONSTANTS
|
||||
local CLASS = "GFMS_NUI"--This is the name that the logging framework will use to display your logs in the correct manner
|
||||
local LOG_LEVEL = GetResourceMetadata(GetCurrentResourceName(), "log_level", 0)
|
||||
local RESOURCE_CODE = GetResourceMetadata(GetCurrentResourceName(), "resource_code", 0)
|
||||
-----------------------------------------------------------------------------------------------
|
||||
---Used to send logs to the client console
|
||||
---@param message any Preformatted message or VARIABLES to be sent to log
|
||||
---@param logLevel integer Level of log, 1-Error, 2-Warn, 3-Info, 4-Debug
|
||||
local function Log(message, logLevel)
|
||||
local line = debug.getinfo(2, "l").currentline
|
||||
local name = debug.getinfo(2, "n").name
|
||||
if name == "fn" then
|
||||
name = "Thread"
|
||||
end
|
||||
local value = "{"..CLASS.."."..name.."("..line..")} "..message
|
||||
if logLevel then
|
||||
if tonumber(LOG_LEVEL) >= logLevel then
|
||||
exports.SLF:LogToClient(RESOURCE_CODE, logLevel, value)
|
||||
end
|
||||
else
|
||||
exports.SLF:LogToClient(RESOURCE_CODE, 4, value)
|
||||
Log("Warning line was logged without a level value... Logged it as debug as that is the safest route.", 1)
|
||||
end
|
||||
end
|
||||
local SPLASH_IMG = GetResourceMetadata(GetCurrentResourceName(), "SPLASH_IMG", 0)
|
||||
|
||||
RegisterNetEvent(RESOURCE_CODE..":UpdateLogLevel")
|
||||
AddEventHandler(RESOURCE_CODE..":UpdateLogLevel", function(num)
|
||||
LOG_LEVEL = num
|
||||
end)
|
||||
-----------------------------------------------------------------------------------------------
|
||||
--CONSTANTS--
|
||||
|
||||
--VARIABLES--
|
||||
GFMS_SPLASH_IMG = GetResourceMetadata(GetCurrentResourceName(), "SPLASH_IMG", 0)
|
||||
|
||||
--FUNCTIONS--
|
||||
local function ChangeImage(image)
|
||||
--Setup the splash image on script load
|
||||
Citizen.CreateThread(function()
|
||||
print("Setting Up LoadSplash")
|
||||
SendNUIMessage({
|
||||
type = "setIMG",
|
||||
value = image
|
||||
value = SPLASH_IMG,
|
||||
})
|
||||
end
|
||||
end)
|
||||
|
||||
local function DisplaySplash(bool)
|
||||
-- Show and hide the splash without spinner
|
||||
function displaySplash(bool)
|
||||
SendNUIMessage({
|
||||
type = "showSplash",
|
||||
status = bool
|
||||
status = bool,
|
||||
})
|
||||
end
|
||||
|
||||
local function DisplayLoadSplash(bool)
|
||||
SendNUIMessage({
|
||||
type = "showLoadingSplash",
|
||||
status = bool
|
||||
})
|
||||
end
|
||||
|
||||
|
||||
--THREADS--
|
||||
Citizen.CreateThread(function()
|
||||
ChangeImage(GFMS_SPLASH_IMG)
|
||||
end)
|
||||
|
||||
--NET EVENTS--
|
||||
RegisterNetEvent(RESOURCE_CODE..':ShowStaticSplash')
|
||||
AddEventHandler(RESOURCE_CODE..':ShowStaticSplash', function(bool)
|
||||
Log("Displaying or Hiding Static Splash Screen", 4)
|
||||
DisplaySplash(bool)
|
||||
displaySplash(bool)
|
||||
end)
|
||||
|
||||
-- Show and hide the splash with spinner
|
||||
function displayLoadSplash(bool)
|
||||
SendNUIMessage({
|
||||
type = "showLoadingSplash",
|
||||
status = bool,
|
||||
})
|
||||
end
|
||||
|
||||
RegisterNetEvent(RESOURCE_CODE..':ShowLoadingSplash')
|
||||
AddEventHandler(RESOURCE_CODE..':ShowLoadingSplash', function(bool)
|
||||
Log("Displaying or Hiding Loading Splash Screen", 4)
|
||||
DisplayLoadSplash(bool)
|
||||
displayLoadSplash(bool)
|
||||
end)
|
||||
|
||||
RegisterNetEvent(RESOURCE_CODE..":ChangeImage")
|
||||
AddEventHandler(RESOURCE_CODE..":ChangeImage", function(image)
|
||||
Log("Changing Splash Image", 4)
|
||||
ChangeImage(image)
|
||||
end)
|
||||
|
||||
|
||||
--COMMANDS--
|
||||
|
||||
|
||||
|
||||
|
||||
--Setup the splash image on script load
|
||||
|
||||
|
||||
-- Show and hide the splash without spinner
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -13,9 +13,7 @@ SPLASH_IMG 'https://images.cstm.games/imgstor/splashscreens/defaultsplash.png'
|
|||
|
||||
dependencies {
|
||||
'SLF',
|
||||
'SCF',
|
||||
'SDB',
|
||||
'SPH'
|
||||
'SCF'
|
||||
}
|
||||
|
||||
files {
|
||||
|
|
|
|||
|
|
@ -1,12 +1,30 @@
|
|||
--SLF CONSTANTS
|
||||
--GLOBAL CONSTANTS
|
||||
local CLASS = "CHANGEME"--This is the name that the logging framework will use to display your logs in the correct manner
|
||||
local LOG_LEVEL = GetResourceMetadata(GetCurrentResourceName(), "log_level", 0)
|
||||
local RESOURCE_CODE = GetResourceMetadata(GetCurrentResourceName(), "resource_code", 0)
|
||||
--Global Variables
|
||||
--LOCAL VARIABLES
|
||||
|
||||
|
||||
--END CONFIG
|
||||
-----------------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
|
||||
-------------------
|
||||
--YOUR CODE HERE---
|
||||
--HAPPY CODING!----
|
||||
-------------------
|
||||
|
||||
|
||||
|
||||
------------------------------------------------------------------------------------------------
|
||||
--SLF Server Logging Function DO NOT TOUCH unless you know what you are doing.
|
||||
|
||||
---Used to send logs to the server console
|
||||
---@param message any Preformatted message or VARIABLES to be sent to log
|
||||
---@param logLevel integer Level of log, 1-Error, 2-Warn, 3-Info, 4-Debug
|
||||
local function Log(message, logLevel)
|
||||
function Log(message, logLevel)
|
||||
local line = debug.getinfo(2, "l").currentline
|
||||
local name = debug.getinfo(2, "n").name
|
||||
if name == "fn" then
|
||||
|
|
@ -23,31 +41,19 @@ local function Log(message, logLevel)
|
|||
end
|
||||
end
|
||||
|
||||
RegisterNetEvent(RESOURCE_CODE..":UpdateLogLevel")
|
||||
AddEventHandler(RESOURCE_CODE..":UpdateLogLevel", function(num)
|
||||
LOG_LEVEL = num
|
||||
end)
|
||||
------------------------------------------------------------------------------------------------
|
||||
--CONSTANTS--
|
||||
|
||||
|
||||
|
||||
--VARIABLES--
|
||||
|
||||
|
||||
|
||||
--FUNCTIONS--
|
||||
|
||||
|
||||
|
||||
--THREADS--
|
||||
|
||||
|
||||
|
||||
--NET EVENTS--
|
||||
|
||||
|
||||
|
||||
--COMMANDS--
|
||||
|
||||
function DisLog(message)
|
||||
local line = debug.getinfo(2, "l").currentline
|
||||
local name = debug.getinfo(2, "n").name
|
||||
if name == "fn" then
|
||||
name = "Thread"
|
||||
end
|
||||
local value = "{"..CLASS.."."..name.."("..line..")} "..message
|
||||
exports.SLF:LogServerToDiscord(RESOURCE_CODE, message)
|
||||
end
|
||||
|
||||
function GetSID(UUID)
|
||||
Log("Requesting SID for UUID: "..UUID, 4)
|
||||
local SID = exports.SPH:GetSID(UUID)
|
||||
Log("Retreived SID: "..SID.." for UUID: "..UUID, 4)
|
||||
return SID
|
||||
end
|
||||
Loading…
Reference in New Issue