1) Version 2.0002

2) Fixed incorrect reporting of the plugin's minor version number.  It wasn't
   formatted properly now that we are using the x.yyyy display format.
master
Durel 7 years ago
parent 044c9c25e5
commit ebceaadeda

@ -85,7 +85,7 @@ dbot.callback : Module to help manage callback functions and parameters
save_state="y" save_state="y"
date_written="2017-08-12 08:45:15" date_written="2017-08-12 08:45:15"
requires="4.98" requires="4.98"
version="2.0001" version="2.0002"
> >
<description trim="y"> <description trim="y">
<![CDATA[ <![CDATA[
@ -1043,8 +1043,8 @@ function inv.init.atActiveCR()
if (retval == DRL_RET_SUCCESS) then if (retval == DRL_RET_SUCCESS) then
inv.init.initializedActive = true inv.init.initializedActive = true
dbot.info("Plugin version " .. inv.version.pluginMajor .. "." .. inv.version.pluginMinor .. local fullVer = string.format("%d.%04d", inv.version.pluginMajor, inv.version.pluginMinor)
" is fully initialized") dbot.info("Plugin version " .. fullVer .. " is fully initialized")
-- Kick off an immediate full inventory refresh so that we have an accurate view of what -- Kick off an immediate full inventory refresh so that we have an accurate view of what
-- the user has. They may have logged in without using the plugin and moved things around -- the user has. They may have logged in without using the plugin and moved things around
@ -1198,8 +1198,9 @@ end -- inv.reload
inv.version = {} inv.version = {}
_, _, inv.version.pluginMajor, inv.version.pluginMinor = inv.version.full = GetPluginInfo(GetPluginID(), 19)
string.find(tostring(GetPluginInfo(GetPluginID(), 19)), "(%d+).(%d+)") inv.version.pluginMajor = math.floor(inv.version.full)
inv.version.pluginMinor = tonumber(string.format("%.4f", (inv.version.full - inv.version.pluginMajor) * 10000))
inv.version.table = { pluginVer = { major = inv.version.pluginMajor, minor = inv.version.pluginMinor }, inv.version.table = { pluginVer = { major = inv.version.pluginMajor, minor = inv.version.pluginMinor },
tableFormat = { major = 0, minor = 1 }, tableFormat = { major = 0, minor = 1 },
@ -1220,8 +1221,8 @@ function inv.version.display()
dbot.print("\n @y" .. pluginNameAbbr .. " Aardwolf Plugin\n" .. dbot.print("\n @y" .. pluginNameAbbr .. " Aardwolf Plugin\n" ..
"-------------------------@w") "-------------------------@w")
dbot.print("@WPlugin Version: @G" .. dbot.print("@WPlugin Version: @G" ..
inv.version.table.pluginVer.major .. "." .. string.format("%01d", inv.version.table.pluginVer.major) .. "." ..
inv.version.table.pluginVer.minor .. "@w") string.format("%04d", inv.version.table.pluginVer.minor) .. "@w")
dbot.print("") dbot.print("")
dbot.print("@WInv. Table Format: @G" .. dbot.print("@WInv. Table Format: @G" ..
inv.version.table.tableFormat.major .. "." .. inv.version.table.tableFormat.major .. "." ..
@ -16131,21 +16132,23 @@ function dbot.update.callback(retval, page, status, headers, fullStatus, request
else else
local currentVersion = GetPluginInfo(GetPluginID(), 19) or 0 local currentVersion = GetPluginInfo(GetPluginID(), 19) or 0
local remoteVersion = tonumber(string.match(page, '%s%s+version="([0-9%.]+)"')) or 0 local currentVerStr = string.format("%1.4f", currentVersion)
local remoteVerStr = string.match(page, '%s%s+version="([0-9%.]+)"')
local remoteVersion = tonumber(remoteVerStr or "") or 0
if (remoteVersion == currentVersion) then if (remoteVersion == currentVersion) then
dbot.info("You are running the most recent plugin (v" .. currentVersion .. ")") dbot.info("You are running the most recent plugin (v" .. currentVersion .. ")")
elseif (remoteVersion < currentVersion) then elseif (remoteVersion < currentVersion) then
dbot.warn("Your current plugin (v" .. currentVersion .. ") " .. dbot.warn("Your current plugin (v" .. currentVerStr .. ") " ..
"is newer than the latest official release (v" .. remoteVersion .. ")") "is newer than the latest official release (v" .. remoteVerStr .. ")")
retval = DRL_RET_VER_MISMATCH retval = DRL_RET_VER_MISMATCH
elseif (dbot.update.pkg.mode == drlDbotUpdateCheck) then elseif (dbot.update.pkg.mode == drlDbotUpdateCheck) then
dbot.info("You are running v" .. currentVersion .. ", latest version is v" .. remoteVersion) dbot.info("You are running v" .. currentVerStr .. ", latest version is v" .. remoteVerStr)
elseif (dbot.update.pkg.mode == drlDbotUpdateInstall) then elseif (dbot.update.pkg.mode == drlDbotUpdateInstall) then
dbot.info("Updating plugin from version " .. currentVersion .. " to version " .. remoteVersion) dbot.info("Updating plugin from version " .. currentVerStr .. " to version " .. remoteVerStr)
local pluginFile = GetPluginInfo(GetPluginID(), 6) local pluginFile = GetPluginInfo(GetPluginID(), 6)
local file = io.open(pluginFile, "w") local file = io.open(pluginFile, "w")

Loading…
Cancel
Save