Quantcast Plugin support for German and French clients - LoTROInterface
VGInterface.com
Search Downloads


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

Reply
 
Thread Tools Display Modes
  #1  
Unread 11-06-2010, 12:10 PM
Chiran Chiran is offline
The Undying
Interface Author - Click to view interfaces
 
Join Date: Sep 2010
Posts: 27
Plugin support for German and French clients

Since there's not yet discussion about this, I thought I'd start one.

So what we have is a nasty bug with how data is serialized when using the internal Turbine.PluginData.Save method. What happens is that with German (and French?) clients the default decimal separator, which is "." (dot), gets converted to "," (comma). This can obviously break the save file badly since it's parsed as a Lua file. We can expect that this will be fixed by Turbine in the future, but plugin authors can react to this quite a bit faster. So, what should we do about it?

1) Each and every plugin author should find their own way to adjust plugins so that they work for all client versions. That is, if they want or bother to (it can be a lot of work).
2) We expect that those using other clients than English will start to use tools such as the fix provided by Vindar.

Personally I'd like to modify mine so that they do work for everyone. But then again does that interfere with the fix? I've also found it problematic to test this since it doesn't appear that anything short of installing a German client is enough to make this bug appear.

-Chiran

Last edited by Chiran : 11-06-2010 at 01:03 PM.
Reply With Quote
  #2  
Unread 11-06-2010, 06:13 PM
Pengoros Pengoros is offline
The Unscathed
Interface Author - Click to view interfaces
 
Join Date: Sep 2010
Posts: 15
If you alias the Turbine.PluginData.Load and Turbine.PluginData.Save methods it will cause the fix to not change anything in your plugin like this:

Code:
local load_alias = Turbine.PluginData.Load;
local save_alias = Turbine.PluginData.Save;

-- now just use the alias functions to do the saving or loading
save_alias(Turbine.DataScope.Character, "PluginName", object_to_save);
local loaded_object = load_alias(Turbine.DataScope.Character, "PluginName");
Reply With Quote
  #3  
Unread 11-06-2010, 06:55 PM
Chiran Chiran is offline
The Undying
Interface Author - Click to view interfaces
 
Join Date: Sep 2010
Posts: 27
Ah, that's a good tip, thanks!

-Chiran
Reply With Quote
  #4  
Unread 11-06-2010, 07:48 PM
Digital_Utopia's Avatar
Digital_Utopia Digital_Utopia is offline
The Undying
Interface Author - Click to view interfaces
 
Join Date: Sep 2010
Posts: 207
Send a message via MSN to Digital_Utopia Send a message via Yahoo to Digital_Utopia
Since Palantir has a hefty number of settings, I was planning on creating a couple of functions to iterate through the tables before saving, and after loading to convert numbers/bool to strings and back.
__________________

Lord of the Rings Online
75 Fourohfour | 75 Artemedis | 60 Whiskeytango Foxtrot | 50 Mistah Boombastic | 56 Appetizer | 25 Aggromi
61 Onepointtwentyone Gigawatts


World of Warcraft
90 Downlo 85 Gravetaxi 85 Ümad 85 Artemedis 85 Guthuros
Reply With Quote
  #5  
Unread 11-06-2010, 10:02 PM
NuclearTonic's Avatar
NuclearTonic NuclearTonic is offline
The Undefeated
Interface Author - Click to view interfaces
 
Join Date: Sep 2010
Location: Rochester, NY
Posts: 8
Quote:
Originally Posted by Digital_Utopia
Since Palantir has a hefty number of settings, I was planning on creating a couple of functions to iterate through the tables before saving, and after loading to convert numbers/bool to strings and back.
That's exactly what the v1.5.2 version of TonicBars does. Copied strait after deepcopy provided by Turbine.
Reply With Quote
  #6  
Unread 11-07-2010, 09:08 AM
Digital_Utopia's Avatar
Digital_Utopia Digital_Utopia is offline
The Undying
Interface Author - Click to view interfaces
 
Join Date: Sep 2010
Posts: 207
Send a message via MSN to Digital_Utopia Send a message via Yahoo to Digital_Utopia
Quote:
Originally Posted by NuclearTonic
That's exactly what the v1.5.2 version of TonicBars does. Copied strait after deepcopy provided by Turbine.
It might just be because I don't have the TurbinePlugins folder anymore, but I couldn't find that particular code. Instead, I just went with these functions:

Code:
function settingsEncode(t)
	local t2={};
	for k,v in pairs(t) do
		if(type(v)=="number")then
			v=tostring(v);
		elseif (type(v)=="table")then
			v=settingsEncode(v);
		end
		t2[k]=v;
	end
	return t2
end

Code:
function settingsDecode(t)
	local t2={};
	for k,v in pairs(t) do
		if(tonumber(v)~=nil)then
			v=tonumber(v);
		elseif (type(v)=="table")then
			v=settingsDecode(v);
		end
		t2[k]=v;
	end
	return t2
end
__________________

Lord of the Rings Online
75 Fourohfour | 75 Artemedis | 60 Whiskeytango Foxtrot | 50 Mistah Boombastic | 56 Appetizer | 25 Aggromi
61 Onepointtwentyone Gigawatts


World of Warcraft
90 Downlo 85 Gravetaxi 85 Ümad 85 Artemedis 85 Guthuros
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
Better plugin management Olenn LotRO Wish List (L) 6 10-21-2010 12:09 AM
Plugin Manager 0.2 help jingo386 Script & Skin Managers 1 09-20-2010 11:33 PM
Plugin Manager Sirak Script & Skin Managers 8 09-12-2010 04:35 PM
Lua support coming to LOTRO Sparr General Authoring Discussion (L) 33 08-05-2010 07:52 PM
Lua support coming to LOTRO's UI! Dolby News 1 07-15-2010 09:36 AM


All times are GMT -5. The time now is 03:52 AM.


Our Network
EQInterface | EQ2Interface | Minion | WoWInterface | VGInterface | LoTROInterface | MMOInterface | Swtorui