Create check for broken/missing config file

This commit is contained in:
Jim Shield
2025-10-14 03:51:22 +01:00
parent 8e8010f837
commit 732b07c957

View File

@@ -33,12 +33,47 @@ Exports = {
}
-- Required variables
debugMode = Config.System.Debug
debugMode = false
QBInvNew = true
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 ]]--
-- Check server convars for hard set defaults, otherwise it uses per script configurations
if Config and Config.System then
@@ -49,6 +84,8 @@ if Config and Config.System then
if GetConvar("jim_DisableEventDebug", "false") == "true" then
Config.System.EventDebug = false
end
else
debugMode = Config.System.Debug
end
Config.System.Menu = GetConvar("jim_menuScript", Config.System.Menu)