lotrointerface.com
Search Downloads


Go Back   LoTROInterface > LotRO > Developer Discussions > Lua Programming Help (L)

Reply
Thread Tools Display Modes
  #1  
Unread 05-12-2012, 12:04 PM
K1R4D3L K1R4D3L is offline
The Undying
Interface Author - Click to view interfaces
 
Join Date: Feb 2012
Posts: 34
plugin.Version doesn't update without exiting game

Anyone else run into this? It seems that plugin.Version doesn't return an updated number unless you fully exit and re-open the game client.

This is a problem for me with my next release of KillTracker, since I'm changing the save file format somewhat. In testing, if I load v0.9.3, let it save it's files, stay in the game and go copy v0.9.4 into the Plugins folder, then unload and reload KillTracker, it will save its files with v0.9.3 as the version number, but in the v0.9.4 format. Then if I exit and re-open the game, it fails to load the files correctly because it sees that the version is now v0.9.4 from plugin.Version, that the files are tagged as v0.9.3, and tries to open them in v0.9.3 format and convert them, which it obviously can't do.

Sorry, bit of a messy explanation...hope you follow.

Only solution I can think of is to hard-code the version number in the code...which is eventually bound to bite me when I forget to update it in yet another spot when I put out a new version. Anyone have a better work-around, apart from telling users to exit the game before upgrading and hoping they actually do?
Reply With Quote
  #2  
Unread 05-12-2012, 12:28 PM
moebius92 moebius92 is offline
The Undying
Interface Author - Click to view interfaces
 
Join Date: Sep 2010
Posts: 51
I use plugin:GetVersion(), so I've no idea about plugin.Version - I get a nil when I try to access that, but doing a "/plugins refresh" seems to update the version for me.
Reply With Quote
  #3  
Unread 05-12-2012, 01:56 PM
K1R4D3L K1R4D3L is offline
The Undying
Interface Author - Click to view interfaces
 
Join Date: Feb 2012
Posts: 34
It apparently depends on how you get your plugin object which way you get the version out.

Code:
for _, plugin in ipairs(Turbine.PluginManager.GetAvailablePlugins()) do
	if (plugin.Name == "KillTracker") then
		Turbine.Shell.WriteLine(""..plugin.Version);
		--Turbine.Shell.WriteLine(""..plugin:GetVersion()); --fails
	end
end
--Turbine.Shell.WriteLine(""..Plugins["KillTracker"].Version); --fails
Turbine.Shell.WriteLine(""..Plugins["KillTracker"]:GetVersion());
Either way though, the working command returns the old version until you either exit the game and re-open, or, you're right, run "/plugins refresh" or hit the refresh button in the plugins manager (I'd never used these for anything).

I'm still concerned that users aren't going to refresh and are just going to load the new version, causing problems. If there wasn't a data corruption risk, it wouldn't matter so much, but as much as I don't like it, I think I'm going to have to hard-code the version in the code and maintain it.
Reply With Quote
  #4  
Unread 05-12-2012, 02:23 PM
K1R4D3L K1R4D3L is offline
The Undying
Interface Author - Click to view interfaces
 
Join Date: Feb 2012
Posts: 34
Ahh, never mind...I'm an idiot. I found a fourth way to refresh the plugins, and unlike the other three, this one can be done programatically. Don't know how I missed it:

Turbine.PluginManager.RefreshAvailablePlugins()

I just call it before I pull the version number. Problem solved.
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
New version of Bevy O' Bars MrJackdaw General Authoring Discussion (L) 12 12-28-2010 09:57 PM
Combining Skins Doesn't Work? EB64 Interface Help (L) 5 10-27-2010 12:32 PM
songbook setup doesn't load sheerra Script & Skin Managers 6 10-20-2010 06:53 AM
new version - vanish Mirarkitty General Authoring Discussion (L) 2 02-14-2010 03:03 PM
Main Bar doesn´t change GollumTheShort Interface Help (L) 4 01-15-2010 07:24 AM


All times are GMT -5. The time now is 07:40 AM.


Our Network
EQInterface | EQ2Interface | Minion | WoWInterface | ESOUI | LoTROInterface | MMOUI | Swtorui