[implemented] api version variable in addon manifest
I was just wondering if it would be possible to add a new variable for the addon manifest so that we can make the addon compatible for both api versions on a major patch without having to clutter the code with
Lua Code:
Something like Code:
Startup_${apiversion}.lua |
Quote:
|
Of course you will remove the old version once it is no longer necessary, but there is also the delay in the update between EU and NA server to think about. That way you could easily upload a version that is compatible with both APIs and make the transition as smooth as can be.
Also it can't hurt to have the addon ready and published for the PTS so people can test your changes beforehand and instead of making a separate addon I would prefer to just have a version that is compatible with both. Even without this feature I will find a way to do it, but it would be much cleaner this way, because no unnecessary code is loaded. |
Quote:
|
I went ahead and added an {APIVersion} variable that is substituted with the current version in any paths listed in the addon ToC. I'll try to make a case for this for the next update (2.1).
|
Thank you very much! That will come in really handy in the future. :banana:
Will this go into one of the next incremental patches, or what else will the variable resolve to in the current live version in case it only makes it into update 2.1? And just out of curiosity, are there any other substitutions besides ${language}? |
This change is slated for the new incremental live patch.
|
The result of all this will be with the first patch to PTS (not the launch of it) you will be able to type $(APIVersion) in file paths and have it substitute in the API version on both PTS and live.
|
Quote:
|
There is no way to see what a resolved path will look like, right?
${languageDirectory} sounds like it would resolve to "en/"? Something like Code:
string resolvedPath = DebugResolveAddonPath(string manifestEntry) Or maybe even add some new functions to AddOnManager so we can build a panel that shows which files are loaded or not loaded and in which order. Code:
integer numFiles = AddOnManager:GetNumAddOnFiles() |
If an addon is multi api version ready, how to specify supported versions so it does not be shown as "out-dated" for one of the clients?
## APIVersion: 100011 100012 or ## APIVersion: 100011 ## APIVersion: 100012 ? What happens, if someone tries ## APIVersion: ${apiversion} /edit: tried myself: None of it works. => Once a new api version goes live, one still has to update the addon manifest for those who can't do that on their own. May I did not get, what it's good for?!? :o |
I don't think it marks higher versions as out of date.
So can't you just put the higher version number: Lua Code:
|
Quote:
100012 is "out-dated" for a 100011 client. At least for my EU client. |
I must remember wrong. I probably just posted it early with the new api version and let it show out of date until the patch.
|
edit: Removed due to error.
|
@circonian: I don't think that would help, because the addon gets disabled before the game loads if the "allow out of date addons" checkbox is not checked, so it would only be cosmetic.
Listing multiple versions like in votan's post sounds like a good solution IMHO. Just because it is compatible with a newer API version does not mean it is compatible with the old one... not that it would matter once the new version has been released though. :D Btw, has anyone gotten the new variable expansion to work? I tried several ways but it does not load the file on live or pts. Writing Code:
test/test_100011.lua Code:
test_${APIVersion}/test.lua |
Round braces, not curly ;)
|
I blame it on the xml. :o
|
Quote:
|
I have succesfully used it on live and PTS. :banana:
It is case-sensitive and must be written as Chip said: $(APIVersion) not $(apiversion) or $(ApiVersion) As you still have to increase the APIVersion in the manifest (and upload a newer addon) after the update goes live, the only scenario I have found is: Creating an intermediate version addon, which does not scramble saved variables due to breaking changes, if the user allows to run "out-dated" addons. Another drawback compared to GetAPIVersion() is: You can not say APIVersion>=100012, only APIVersion==100012. So again, once the update goes live, you need to upload a new version, which removes the version substitute again, in hope the next API version will not affect your addon, again. But migration is definitely better as without the substitute. Thank You, Chip! |
All times are GMT -6. The time now is 01:08 AM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2014 - 2022 MMOUI