2021-11-14 02:03:19 +11:00
|
|
|
CreateThread(function()
|
2021-11-16 19:37:36 +11:00
|
|
|
Wait(1000)
|
|
|
|
|
local resource = GetCurrentResourceName()
|
|
|
|
|
local url = GetResourceMetadata(resource, 'repository', 0)
|
|
|
|
|
local version = GetResourceMetadata(resource, 'version', 0)
|
2021-11-14 02:03:19 +11:00
|
|
|
|
2021-11-16 19:37:36 +11:00
|
|
|
PerformHttpRequest(('%s/master/fxmanifest.lua'):format(url:gsub('github.com', 'raw.githubusercontent.com')), function(error, response)
|
2021-12-27 11:10:05 +11:00
|
|
|
if error == 200 then
|
2021-11-16 19:37:36 +11:00
|
|
|
local latest = response:match('%d%.%d+%.%d+')
|
2021-12-27 11:10:05 +11:00
|
|
|
if version < latest then
|
2021-11-16 19:37:36 +11:00
|
|
|
local curMajor, curMinor = string.strsplit('.', version)
|
|
|
|
|
local newMajor, newMinor = string.strsplit('.', response:match('%d%.%d+%.%d+'))
|
|
|
|
|
local link = ('%s/archive/refs/tags/%s.zip'):format(url, latest, latest)
|
2021-11-14 02:03:19 +11:00
|
|
|
|
2021-11-16 19:37:36 +11:00
|
|
|
if tonumber(curMajor) < tonumber(newMajor) then
|
|
|
|
|
latest = 'A major update'
|
|
|
|
|
elseif tonumber(curMinor) < tonumber(newMinor) then
|
|
|
|
|
latest = 'An update'
|
|
|
|
|
else
|
|
|
|
|
latest = 'A patch'
|
|
|
|
|
end
|
2021-11-14 02:03:19 +11:00
|
|
|
|
2021-11-16 19:37:36 +11:00
|
|
|
print(('^3%s is available for oxmysql - please download the latest release (current version: %s)\n ^3- %s^0'):format(latest, version, link))
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
end, 'GET')
|
2021-11-14 02:03:19 +11:00
|
|
|
end)
|