diff --git a/sonorancad/core/configuration.lua b/sonorancad/core/configuration.lua index 6306c96..8fed8ad 100644 --- a/sonorancad/core/configuration.lua +++ b/sonorancad/core/configuration.lua @@ -88,7 +88,7 @@ end for k, v in pairs(json.decode(conf)) do local cvar = GetConvar("sonoran_"..k, "NONE") if cvar ~= "NONE" then - debugLog("Configuration: Overriding config option %s with convar. New value: %s"):format(k, cvar)) + debugLog(("Configuration: Overriding config option %s with convar. New value: %s"):format(k, cvar)) Config[k] = cvar else Config[k] = v diff --git a/sonorancad/core/server.lua b/sonorancad/core/server.lua index d25045b..75376dd 100644 --- a/sonorancad/core/server.lua +++ b/sonorancad/core/server.lua @@ -170,6 +170,7 @@ CreateThread(function() -- Wait a few seconds for server startup Wait(5000) local coreVersion = GetResourceMetadata(GetCurrentResourceName(), "version", 0) + SetConvarServerInfo("SonoranCAD", coreVersion) local plugins = {} local playerCount = GetNumPlayerIndices() for k, v in pairs(Config.plugins) do diff --git a/sonorancad/core/updater.lua b/sonorancad/core/updater.lua index 4be7a57..3b53bbf 100644 --- a/sonorancad/core/updater.lua +++ b/sonorancad/core/updater.lua @@ -69,8 +69,13 @@ function RunAutoUpdater(manualRun) debugLog(("Raw output for %s: %s"):format(k, data)) else Config.latestVersion = remote.resource - local latestVersion = string.gsub(remote.resource, "%.","") - local localVersion = string.gsub(myVersion, "%.", "") + _, _, v1, v2, v3 = string.find( myVersion, "(%d+)%.(%d+)%.(%d+)" ) + _, _, r1, r2, r3 = string.find( remote.resource, "(%d+)%.(%d+)%.(%d+)" ) + if (string.find(myVersion, "-beta")) then + v3 = v3 - 0.5 + end + local latestVersion = r3+(r2*2)+(r1*4) + local localVersion = v3+(v2*2)+(v1*4) assert(localVersion ~= nil, "Failed to parse local version. "..tostring(localVersion)) assert(latestVersion ~= nil, "Failed to parse remote version. "..tostring(latestVersion))