changeset 43:262083330ac9 v14

fixed bug with reading exports after adding region
author yellowfive
date Fri, 24 Oct 2014 13:38:18 -0700
parents dfd9f053609f
children 8e853e90af9c
files AskMrRobot.lua AskMrRobot.toc
diffstat 2 files changed, 11 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/AskMrRobot.lua	Fri Oct 24 12:09:25 2014 -0700
+++ b/AskMrRobot.lua	Fri Oct 24 13:38:18 2014 -0700
@@ -809,8 +809,9 @@
     
     -- require name match (don't match realm due to language issues for now)
     if not isTest then
-        local realm = parts[2]
-        local name = parts[3]
+		local region = parts[2]
+        local realm = parts[3]
+        local name = parts[4]
         if name ~= AmrDb.CharacterName then
             local badPers = name .. " (" .. realm .. ")"
             local goodPers = AmrDb.CharacterName .. " (" .. AmrDb.RealmName .. ")"
@@ -818,25 +819,25 @@
         end
         
         -- require race match
-        local race = tonumber(parts[5])
+        local race = tonumber(parts[6])
         if race ~= AskMrRobot.raceIds[AmrDb.Race] then
             return L.AMR_IMPORT_ERROR_RACE
         end
         
         -- require faction match
-        local faction = tonumber(parts[6])
+        local faction = tonumber(parts[7])
         if faction ~= AskMrRobot.factionIds[AmrDb.Faction] then
             return L.AMR_IMPORT_ERROR_FACTION
         end
         
         -- require level match
-        local level = tonumber(parts[7])
+        local level = tonumber(parts[8])
         if level ~= AmrDb.Level then
             return L.AMR_IMPORT_ERROR_LEVEL
         end
 
         -- require spec match
-        local spec = tonumber(parts[11])
+        local spec = tonumber(parts[12])
         if spec ~= AmrDb.Specs[AmrDb.ActiveSpec] then
             --print(AmrDb.ActiveSpec)
             --print(spec)
@@ -846,14 +847,14 @@
         end
         
         -- require talent match
-        local talents = parts[12]
+        local talents = parts[13]
         if talents ~= AmrDb.Talents[AmrDb.ActiveSpec] then
             return L.AMR_IMPORT_ERROR_TALENT
         end
         
         -- require glyph match
         -- TODO: re-enable this check when glyphs are more consistent
-        --local glyphs = parts[13]
+        --local glyphs = parts[14]
         --if glyphs ~= AskMrRobot.toCompressedNumberList(AmrDb.Glyphs[AmrDb.ActiveSpec]) then
         --    return L.AMR_IMPORT_ERROR_GLYPH
         --end
@@ -885,7 +886,7 @@
         ["8"] = true,
         ["9"] = true,
     }
-    for i = 15, #parts do
+    for i = 16, #parts do
         local itemString = parts[i]
         if itemString ~= "" and itemString ~= "_" then
             local tokens = {}
--- a/AskMrRobot.toc	Fri Oct 24 12:09:25 2014 -0700
+++ b/AskMrRobot.toc	Fri Oct 24 13:38:18 2014 -0700
@@ -1,7 +1,7 @@
 ## Interface: 60000
 ## Title: Ask Mr. Robot
 ## Author: Team Robot, Inc.
-## Version: 13
+## Version: 14
 ## Notes: Exports/Imports data to/from askmrrobot.com.
 ## URL: www.askmrrobot.com
 ## DefaultState: Enabled