Mercurial > wow > askmrrobot
comparison AskMrRobot.lua @ 43:262083330ac9 v14
fixed bug with reading exports after adding region
author | yellowfive |
---|---|
date | Fri, 24 Oct 2014 13:38:18 -0700 |
parents | 0e78d6424532 |
children | 1851d0fd18fa |
comparison
equal
deleted
inserted
replaced
42:dfd9f053609f | 43:262083330ac9 |
---|---|
807 return L.AMR_IMPORT_ERROR_VERSION | 807 return L.AMR_IMPORT_ERROR_VERSION |
808 end | 808 end |
809 | 809 |
810 -- require name match (don't match realm due to language issues for now) | 810 -- require name match (don't match realm due to language issues for now) |
811 if not isTest then | 811 if not isTest then |
812 local realm = parts[2] | 812 local region = parts[2] |
813 local name = parts[3] | 813 local realm = parts[3] |
814 local name = parts[4] | |
814 if name ~= AmrDb.CharacterName then | 815 if name ~= AmrDb.CharacterName then |
815 local badPers = name .. " (" .. realm .. ")" | 816 local badPers = name .. " (" .. realm .. ")" |
816 local goodPers = AmrDb.CharacterName .. " (" .. AmrDb.RealmName .. ")" | 817 local goodPers = AmrDb.CharacterName .. " (" .. AmrDb.RealmName .. ")" |
817 return L.AMR_IMPORT_ERROR_CHAR:format(badPers, goodPers) | 818 return L.AMR_IMPORT_ERROR_CHAR:format(badPers, goodPers) |
818 end | 819 end |
819 | 820 |
820 -- require race match | 821 -- require race match |
821 local race = tonumber(parts[5]) | 822 local race = tonumber(parts[6]) |
822 if race ~= AskMrRobot.raceIds[AmrDb.Race] then | 823 if race ~= AskMrRobot.raceIds[AmrDb.Race] then |
823 return L.AMR_IMPORT_ERROR_RACE | 824 return L.AMR_IMPORT_ERROR_RACE |
824 end | 825 end |
825 | 826 |
826 -- require faction match | 827 -- require faction match |
827 local faction = tonumber(parts[6]) | 828 local faction = tonumber(parts[7]) |
828 if faction ~= AskMrRobot.factionIds[AmrDb.Faction] then | 829 if faction ~= AskMrRobot.factionIds[AmrDb.Faction] then |
829 return L.AMR_IMPORT_ERROR_FACTION | 830 return L.AMR_IMPORT_ERROR_FACTION |
830 end | 831 end |
831 | 832 |
832 -- require level match | 833 -- require level match |
833 local level = tonumber(parts[7]) | 834 local level = tonumber(parts[8]) |
834 if level ~= AmrDb.Level then | 835 if level ~= AmrDb.Level then |
835 return L.AMR_IMPORT_ERROR_LEVEL | 836 return L.AMR_IMPORT_ERROR_LEVEL |
836 end | 837 end |
837 | 838 |
838 -- require spec match | 839 -- require spec match |
839 local spec = tonumber(parts[11]) | 840 local spec = tonumber(parts[12]) |
840 if spec ~= AmrDb.Specs[AmrDb.ActiveSpec] then | 841 if spec ~= AmrDb.Specs[AmrDb.ActiveSpec] then |
841 --print(AmrDb.ActiveSpec) | 842 --print(AmrDb.ActiveSpec) |
842 --print(spec) | 843 --print(spec) |
843 --print(AmrDb.Specs[AmrDb.ActiveSpec]) | 844 --print(AmrDb.Specs[AmrDb.ActiveSpec]) |
844 local _, specName = GetSpecializationInfoByID(AskMrRobot.gameSpecIds[spec]) | 845 local _, specName = GetSpecializationInfoByID(AskMrRobot.gameSpecIds[spec]) |
845 return L.AMR_IMPORT_ERROR_SPEC:format(specName) | 846 return L.AMR_IMPORT_ERROR_SPEC:format(specName) |
846 end | 847 end |
847 | 848 |
848 -- require talent match | 849 -- require talent match |
849 local talents = parts[12] | 850 local talents = parts[13] |
850 if talents ~= AmrDb.Talents[AmrDb.ActiveSpec] then | 851 if talents ~= AmrDb.Talents[AmrDb.ActiveSpec] then |
851 return L.AMR_IMPORT_ERROR_TALENT | 852 return L.AMR_IMPORT_ERROR_TALENT |
852 end | 853 end |
853 | 854 |
854 -- require glyph match | 855 -- require glyph match |
855 -- TODO: re-enable this check when glyphs are more consistent | 856 -- TODO: re-enable this check when glyphs are more consistent |
856 --local glyphs = parts[13] | 857 --local glyphs = parts[14] |
857 --if glyphs ~= AskMrRobot.toCompressedNumberList(AmrDb.Glyphs[AmrDb.ActiveSpec]) then | 858 --if glyphs ~= AskMrRobot.toCompressedNumberList(AmrDb.Glyphs[AmrDb.ActiveSpec]) then |
858 -- return L.AMR_IMPORT_ERROR_GLYPH | 859 -- return L.AMR_IMPORT_ERROR_GLYPH |
859 --end | 860 --end |
860 end | 861 end |
861 | 862 |
883 ["6"] = true, | 884 ["6"] = true, |
884 ["7"] = true, | 885 ["7"] = true, |
885 ["8"] = true, | 886 ["8"] = true, |
886 ["9"] = true, | 887 ["9"] = true, |
887 } | 888 } |
888 for i = 15, #parts do | 889 for i = 16, #parts do |
889 local itemString = parts[i] | 890 local itemString = parts[i] |
890 if itemString ~= "" and itemString ~= "_" then | 891 if itemString ~= "" and itemString ~= "_" then |
891 local tokens = {} | 892 local tokens = {} |
892 local bonusIds = {} | 893 local bonusIds = {} |
893 local hasBonuses = false | 894 local hasBonuses = false |