From 732b07c957e3d258381c03bb6e6f93628069b13a Mon Sep 17 00:00:00 2001 From: Jim Shield Date: Tue, 14 Oct 2025 03:51:22 +0100 Subject: [PATCH] Create check for broken/missing config file --- starter.lua | 39 ++++++++++++++++++++++++++++++++++++++- 1 file changed, 38 insertions(+), 1 deletion(-) diff --git a/starter.lua b/starter.lua index 1607f15..bc83dca 100644 --- a/starter.lua +++ b/starter.lua @@ -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)