Mod version in Lua - allfoxwy/UnitXP_SP3 GitHub Wiki
Tell if UnitXP_SP3 functions are available
/script local UnitXP_SP3 = pcall(UnitXP, "nop", "nop");
The nop
method always return true. So we could use a pcall to check if UnitXP SP3 is installed.
Decide UnitXP_SP3 version
/script local compileTime = UnitXP("version", "coffTimeDateStamp");
/script local infoString = UnitXP("version", "additionalInformation");
The coffTimeDateStamp
method return UnitXP_SP3.dll
COFF header's TimeDateStamp. It is a Unix epoch time indicating when did this version of UnitXP_SP3 compile.
Comparing two timestamps could tell which version is new.
It could be easily convert into human-readable string using Lua date() function.
The additionalInformation
method return a not-important string to distinguish maintainer. It is for people who fork the project could start a different version bloodline.