mirror of
https://github.com/jimathy/jim_bridge.git
synced 2026-08-17 05:56:02 +01:00
Create check for broken/missing config file
This commit is contained in:
39
starter.lua
39
starter.lua
@@ -33,12 +33,47 @@ Exports = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
-- Required variables
|
-- Required variables
|
||||||
debugMode = Config.System.Debug
|
debugMode = false
|
||||||
|
|
||||||
QBInvNew = true
|
QBInvNew = true
|
||||||
|
|
||||||
InventoryWeight = 120000
|
InventoryWeight = 120000
|
||||||
|
|
||||||
|
-- Corruptted transfer file Checks -- Not Ready Yet ⚠️
|
||||||
|
|
||||||
|
--CreateThread(function()
|
||||||
|
-- local res = GetCurrentResourceName()
|
||||||
|
-- local ok, val = pcall(function()
|
||||||
|
-- return exports[res]:ping_encrypted()
|
||||||
|
-- end)
|
||||||
|
--
|
||||||
|
-- if not ok or val ~= "ok" then
|
||||||
|
-- print("\n^6===============================================================================")
|
||||||
|
-- print(("\n^1Corruption Warning^7: ^1[^7%s^1] Encrypted files failed to initialize.^7\n"):format(res))
|
||||||
|
-- print("^3Common causes^7:")
|
||||||
|
-- print(" • Possible corrupt files")
|
||||||
|
-- print(" • Damaged or partial upload (FTP/zip/unzip issue).")
|
||||||
|
-- print(" • Outdated artifact version\n")
|
||||||
|
-- print("^2How To Fix^7:")
|
||||||
|
-- print(" • Update your server artifact version")
|
||||||
|
-- print(" • Re-download asset from Keymaster")
|
||||||
|
-- print(" • Use WinSCP to upload")
|
||||||
|
-- print(" • Avoid editing any encrypted files")
|
||||||
|
-- print(" • Restart the server")
|
||||||
|
-- print("\n^6===============================================================================^7\n")
|
||||||
|
-- end
|
||||||
|
--end)
|
||||||
|
|
||||||
|
-- Missing/Broken Config file check
|
||||||
|
if not Config or not Config.System then
|
||||||
|
print("\n^6=================================================================================")
|
||||||
|
print("^6=================================================================================\n")
|
||||||
|
print(" ^1ERROR^7: jim_bridge ^1can't find the ^7Config^1 table in ^7"..GetCurrentResourceName())
|
||||||
|
print(" ^1It is either missing, or there is an error inside it stopping it from loading^7\n")
|
||||||
|
print("^6=================================================================================")
|
||||||
|
print("^6=================================================================================^7\n")
|
||||||
|
end
|
||||||
|
|
||||||
-- [[ Server.Cfg Convar Check ]]--
|
-- [[ Server.Cfg Convar Check ]]--
|
||||||
-- Check server convars for hard set defaults, otherwise it uses per script configurations
|
-- Check server convars for hard set defaults, otherwise it uses per script configurations
|
||||||
if Config and Config.System then
|
if Config and Config.System then
|
||||||
@@ -49,6 +84,8 @@ if Config and Config.System then
|
|||||||
if GetConvar("jim_DisableEventDebug", "false") == "true" then
|
if GetConvar("jim_DisableEventDebug", "false") == "true" then
|
||||||
Config.System.EventDebug = false
|
Config.System.EventDebug = false
|
||||||
end
|
end
|
||||||
|
else
|
||||||
|
debugMode = Config.System.Debug
|
||||||
end
|
end
|
||||||
|
|
||||||
Config.System.Menu = GetConvar("jim_menuScript", Config.System.Menu)
|
Config.System.Menu = GetConvar("jim_menuScript", Config.System.Menu)
|
||||||
|
|||||||
Reference in New Issue
Block a user