misc cleanup
Adjusted force config values to match the required values. Also removed unused config options. Swapped default logger to built-in
This commit is contained in:
1 parent
6e418f406c
commit
4138bc84ef
13 files changed
+23
-11
No files matched your search
@@ -1,7 +1,7 @@
|
|||||||
Logs = Logs or {}
|
Logs = Logs or {}
|
||||||
|
|
||||||
local WebhookURL = ""
|
local WebhookURL = "" -- Add webhook URL here if using built-in logging system
|
||||||
local LogoForEmbed = ""
|
local LogoForEmbed = "" -- optional logo for the embed
|
||||||
|
|
||||||
---This will send a log to the configured webhook or log system.
|
---This will send a log to the configured webhook or log system.
|
||||||
---@param src number
|
---@param src number
|
||||||
@@ -9,7 +9,7 @@ local LogoForEmbed = ""
|
|||||||
---@return nil
|
---@return nil
|
||||||
Logs.Send = function(src, message)
|
Logs.Send = function(src, message)
|
||||||
if not src or not message then return end
|
if not src or not message then return end
|
||||||
if BridgeServerConfig.LogSystem == "builtin" then
|
if BridgeServerConfig.LogSystem == "built-in" then
|
||||||
PerformHttpRequest(WebhookURL, function(err, text, headers) end, 'POST', json.encode(
|
PerformHttpRequest(WebhookURL, function(err, text, headers) end, 'POST', json.encode(
|
||||||
{
|
{
|
||||||
username = "Community_Bridge's Logger",
|
username = "Community_Bridge's Logger",
|
||||||
@@ -48,7 +48,7 @@ Logs.Send = function(src, message)
|
|||||||
}), { ['Content-Type']= 'application/json' })
|
}), { ['Content-Type']= 'application/json' })
|
||||||
elseif BridgeServerConfig.LogSystem == "qb" then
|
elseif BridgeServerConfig.LogSystem == "qb" then
|
||||||
return TriggerEvent('qb-log:server:CreateLog', GetCurrentResourceName(), GetCurrentResourceName(), 'green', message)
|
return TriggerEvent('qb-log:server:CreateLog', GetCurrentResourceName(), GetCurrentResourceName(), 'green', message)
|
||||||
elseif BridgeServerConfig.LogSystem == "ox" then
|
elseif BridgeServerConfig.LogSystem == "ox_lib" then
|
||||||
return lib.logger(src, GetCurrentResourceName(), message)
|
return lib.logger(src, GetCurrentResourceName(), message)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
Phone = Phone or {}
|
Phone = Phone or {}
|
||||||
|
|
||||||
|
---@diagnostic disable-next-line: duplicate-set-field
|
||||||
Phone.SendEmail = function(email, title, message)
|
Phone.SendEmail = function(email, title, message)
|
||||||
return false, Print.Error('There Is No Phone Bridged.')
|
return false, Print.Error('There Is No Phone Bridged.')
|
||||||
end
|
end
|
||||||
@@ -1,9 +1,11 @@
|
|||||||
Phone = Phone or {}
|
Phone = Phone or {}
|
||||||
|
|
||||||
|
---@diagnostic disable-next-line: duplicate-set-field
|
||||||
Phone.GetPlayerPhone = function(src)
|
Phone.GetPlayerPhone = function(src)
|
||||||
return false, Print.Error('There Is No Phone Bridged.')
|
return false, Print.Error('There Is No Phone Bridged.')
|
||||||
end
|
end
|
||||||
|
|
||||||
|
---@diagnostic disable-next-line: duplicate-set-field
|
||||||
Phone.SendEmail = function(src, email, title, message)
|
Phone.SendEmail = function(src, email, title, message)
|
||||||
return false, Print.Error('There Is No Phone Bridged.')
|
return false, Print.Error('There Is No Phone Bridged.')
|
||||||
end
|
end
|
||||||
@@ -9,6 +9,7 @@ Phone = Phone or {}
|
|||||||
---@param title string
|
---@param title string
|
||||||
---@param message string
|
---@param message string
|
||||||
---@return boolean
|
---@return boolean
|
||||||
|
---@diagnostic disable-next-line: duplicate-set-field
|
||||||
Phone.SendEmail = function(email, title, message)
|
Phone.SendEmail = function(email, title, message)
|
||||||
return exports["gksphone"]:SendNewMail({ sender = email, image = '/html/static/img/icons/mail.png', subject = title, message = message })
|
return exports["gksphone"]:SendNewMail({ sender = email, image = '/html/static/img/icons/mail.png', subject = title, message = message })
|
||||||
end
|
end
|
||||||
@@ -5,7 +5,8 @@ Phone = Phone or {}
|
|||||||
|
|
||||||
---comment
|
---comment
|
||||||
---@param src number
|
---@param src number
|
||||||
---@return number||boolean
|
---@return number| boolean
|
||||||
|
---@diagnostic disable-next-line: duplicate-set-field
|
||||||
Phone.GetPlayerPhone = function(src)
|
Phone.GetPlayerPhone = function(src)
|
||||||
return exports["gksphone"]:GetPhoneBySource(src) or false
|
return exports["gksphone"]:GetPhoneBySource(src) or false
|
||||||
end
|
end
|
||||||
@@ -16,6 +17,7 @@ end
|
|||||||
---@param title string
|
---@param title string
|
||||||
---@param message string
|
---@param message string
|
||||||
---@return boolean
|
---@return boolean
|
||||||
|
---@diagnostic disable-next-line: duplicate-set-field
|
||||||
Phone.SendEmail = function(src, email, title, message)
|
Phone.SendEmail = function(src, email, title, message)
|
||||||
local data = {}
|
local data = {}
|
||||||
data.sender = email
|
data.sender = email
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ Phone = Phone or {}
|
|||||||
---@param title string
|
---@param title string
|
||||||
---@param message string
|
---@param message string
|
||||||
---@return nil
|
---@return nil
|
||||||
|
---@diagnostic disable-next-line: duplicate-set-field
|
||||||
Phone.SendEmail = function(email, title, message)
|
Phone.SendEmail = function(email, title, message)
|
||||||
TriggerServerEvent('community_bridge:Server:genericEmail', {email = email, title = title, message = message})
|
TriggerServerEvent('community_bridge:Server:genericEmail', {email = email, title = title, message = message})
|
||||||
end
|
end
|
||||||
@@ -3,6 +3,7 @@ local configValue = BridgeSharedConfig.Phone
|
|||||||
if (configValue == "auto" and GetResourceState(resourceName) ~= "started") or (configValue ~= "auto" and configValue ~= resourceName) then return end
|
if (configValue == "auto" and GetResourceState(resourceName) ~= "started") or (configValue ~= "auto" and configValue ~= resourceName) then return end
|
||||||
Phone = Phone or {}
|
Phone = Phone or {}
|
||||||
|
|
||||||
|
---@diagnostic disable-next-line: duplicate-set-field
|
||||||
Phone.GetPlayerPhone = function(src)
|
Phone.GetPlayerPhone = function(src)
|
||||||
return exports["lb-phone"]:GetEquippedPhoneNumber(src) or false
|
return exports["lb-phone"]:GetEquippedPhoneNumber(src) or false
|
||||||
end
|
end
|
||||||
@@ -13,6 +14,7 @@ end
|
|||||||
---@param title string
|
---@param title string
|
||||||
---@param message string
|
---@param message string
|
||||||
---@return boolean
|
---@return boolean
|
||||||
|
---@diagnostic disable-next-line: duplicate-set-field
|
||||||
Phone.SendEmail = function(src, email, title, message)
|
Phone.SendEmail = function(src, email, title, message)
|
||||||
local numberNumber = exports["lb-phone"]:GetEquippedPhoneNumber(src)
|
local numberNumber = exports["lb-phone"]:GetEquippedPhoneNumber(src)
|
||||||
if not numberNumber then return false, Prints.Error("Could not Find Phone number") end
|
if not numberNumber then return false, Prints.Error("Could not Find Phone number") end
|
||||||
|
|||||||
@@ -8,11 +8,11 @@ Phone = Phone or {}
|
|||||||
---@param title string
|
---@param title string
|
||||||
---@param message string
|
---@param message string
|
||||||
---@return nil
|
---@return nil
|
||||||
|
---@diagnostic disable-next-line: duplicate-set-field
|
||||||
Phone.SendEmail = function(email, title, message)
|
Phone.SendEmail = function(email, title, message)
|
||||||
return TriggerServerEvent('qs-smartphone:server:sendNewMail', { sender = email, subject = title, message = message, button = {} })
|
return true, TriggerServerEvent('qs-smartphone:server:sendNewMail', { sender = email, subject = title, message = message, button = {} })
|
||||||
end
|
end
|
||||||
|
|
||||||
RegisterNetEvent('community_bridge:Server:genericEmail', function(data)
|
RegisterNetEvent('community_bridge:Server:genericEmail', function(data)
|
||||||
TriggerServerEvent('qs-smartphone:server:sendNewMail', { sender = data.email, subject = data.title, message = data.message, button = {} })
|
TriggerServerEvent('qs-smartphone:server:sendNewMail', { sender = data.email, subject = data.title, message = data.message, button = {} })
|
||||||
return true
|
|
||||||
end)
|
end)
|
||||||
@@ -2,9 +2,11 @@ local resourceName = "qs-smartphone"
|
|||||||
local configValue = BridgeSharedConfig.Phone
|
local configValue = BridgeSharedConfig.Phone
|
||||||
if (configValue == "auto" and GetResourceState(resourceName) ~= "started") or (configValue ~= "auto" and configValue ~= resourceName) then return end
|
if (configValue == "auto" and GetResourceState(resourceName) ~= "started") or (configValue ~= "auto" and configValue ~= resourceName) then return end
|
||||||
Phone = Phone or {}
|
Phone = Phone or {}
|
||||||
|
|
||||||
---comment
|
---comment
|
||||||
---@param src number
|
---@param src number
|
||||||
---@return number||boolean
|
---@return number||boolean
|
||||||
|
---@diagnostic disable-next-line: duplicate-set-field
|
||||||
Phone.GetPlayerPhone = function(src)
|
Phone.GetPlayerPhone = function(src)
|
||||||
return exports['qs-base']:GetPlayerPhone(src) or false
|
return exports['qs-base']:GetPlayerPhone(src) or false
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -49,6 +49,7 @@ end
|
|||||||
---@param cb any
|
---@param cb any
|
||||||
---@param isQBInput boolean
|
---@param isQBInput boolean
|
||||||
---@return nil
|
---@return nil
|
||||||
|
---@diagnostic disable-next-line: duplicate-set-field
|
||||||
function ProgressBar.Open(options, cb, isQBInput)
|
function ProgressBar.Open(options, cb, isQBInput)
|
||||||
if isQBInput then
|
if isQBInput then
|
||||||
options = convertFromQB(options)
|
options = convertFromQB(options)
|
||||||
|
|||||||
@@ -45,6 +45,7 @@ end
|
|||||||
---@param cb any
|
---@param cb any
|
||||||
---@param qbFormat boolean
|
---@param qbFormat boolean
|
||||||
---@return success boolean
|
---@return success boolean
|
||||||
|
---@diagnostic disable-next-line: duplicate-set-field
|
||||||
function ProgressBar.Open(options, cb, qbFormat)
|
function ProgressBar.Open(options, cb, qbFormat)
|
||||||
if not exports['progressbar'] then return false end
|
if not exports['progressbar'] then return false end
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +1,7 @@
|
|||||||
BridgeClientConfig = {}
|
BridgeClientConfig = {}
|
||||||
BridgeClientConfig.InputSystem = "auto" -- [ auto | ox | qb ]
|
BridgeClientConfig.InputSystem = "auto" -- [ auto | ox_lib | qb-input ]
|
||||||
BridgeClientConfig.MenuSystem = "auto" -- [ auto | ox_lib | qb-menu ]
|
BridgeClientConfig.MenuSystem = "auto" -- [ auto | ox_lib | qb-menu ]
|
||||||
BridgeClientConfig.ProgressBarSystem = "auto" -- [ auto | ox_lib | progressbar ]
|
BridgeClientConfig.ProgressBarSystem = "auto" -- [ auto | ox_lib | progressbar ]
|
||||||
BridgeClientConfig.ZoneSystem = "ox" -- [ ox | poly ]
|
|
||||||
BridgeClientConfig.VehicleKey = "auto" -- [ auto | qb-vehiclekeys | MrNewbVehicleKeys | jaksams_VehiclesKeys | wasabi_carlock | mk_vehiclekeys | qbx_vehiclekeys | qs-vehiclekeys | t1ger_keys | Renewed-Vehiclekeys | mono_carkeys| cd_garage | okokGarage | F_RealCarKeysSystem
|
BridgeClientConfig.VehicleKey = "auto" -- [ auto | qb-vehiclekeys | MrNewbVehicleKeys | jaksams_VehiclesKeys | wasabi_carlock | mk_vehiclekeys | qbx_vehiclekeys | qs-vehiclekeys | t1ger_keys | Renewed-Vehiclekeys | mono_carkeys| cd_garage | okokGarage | F_RealCarKeysSystem
|
||||||
BridgeClientConfig.Fuel = "auto" -- [ auto | LegacyFuel | ox_fuel | ps-fuel | qs-fuelstations | Renewed-Fuel | ti_fuel | lc_fuel | x-fuel | cdn-fuel | esx-sna-fuel | BigDaddy-Fuel | okokGasStation ]
|
BridgeClientConfig.Fuel = "auto" -- [ auto | LegacyFuel | ox_fuel | ps-fuel | qs-fuelstations | Renewed-Fuel | ti_fuel | lc_fuel | x-fuel | cdn-fuel | esx-sna-fuel | BigDaddy-Fuel | okokGasStation ]
|
||||||
BridgeClientConfig.TargetSystem = "auto" -- [ auto | ox_target | qb-target | sleepless_interact ] -- sleepless is only partially supported and would need another system in place
|
BridgeClientConfig.TargetSystem = "auto" -- [ auto | ox_target | qb-target | sleepless_interact ] -- sleepless is only partially supported and would need another system in place
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
BridgeServerConfig = {}
|
BridgeServerConfig = {}
|
||||||
BridgeServerConfig.LogSystem = "ox" -- [ builtin | qb | ox ]
|
BridgeServerConfig.LogSystem = "built-in" -- [ built-in | qb | ox_lib ]
|
||||||
BridgeServerConfig.WebhookURL = "PUT_WEBHOOK_URL_HERE" -- only if using builtin
|
BridgeServerConfig.WebhookURL = "PUT_WEBHOOK_URL_HERE" -- only if using builtin
|
||||||
BridgeServerConfig.WebhookImage = "https://cdn.discordapp.com/avatars/299410129982455808/31ce635662206e8bd0132c34ce9ce683?size=1024"
|
BridgeServerConfig.WebhookImage = "https://cdn.discordapp.com/avatars/299410129982455808/31ce635662206e8bd0132c34ce9ce683?size=1024"
|
||||||
BridgeServerConfig.MaxInventorySlots = 50
|
BridgeServerConfig.MaxInventorySlots = 50
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user