# HG changeset patch # User MMOSimca # Date 1473168666 14400 # Node ID 679e2846ff8855a61bcac483894e11ae2d374efe # Parent 271132f4fa77362107f81316cb763e4f853d1e92 Replaced 'GetCvar("portal")' with the library LibRealmInfo in order to get accurate server and region information (needed for world quest data recording). diff -r 271132f4fa77 -r 679e2846ff88 .pkgmeta --- a/.pkgmeta Fri Sep 02 00:25:45 2016 -0400 +++ b/.pkgmeta Tue Sep 06 09:31:06 2016 -0400 @@ -25,3 +25,5 @@ Libs/LibQTip-1.0: url: svn://svn.wowace.com/wow/libqtip-1-0/mainline/trunk tag: latest + Libs/LibRealmInfo: + url: git://git.curseforge.com/wow/librealminfo/mainline.git diff -r 271132f4fa77 -r 679e2846ff88 Constants.lua --- a/Constants.lua Fri Sep 02 00:25:45 2016 -0400 +++ b/Constants.lua Tue Sep 06 09:31:06 2016 -0400 @@ -807,9 +807,6 @@ -- Fundamental Constants. ----------------------------------------------------------------------- private.wow_version, private.build_num, _, private.interface_num = _G.GetBuildInfo() -private.region = GetCVar("portal"):sub(0,2):upper() --- PTR/Beta return "public-test", but they are properly called "XX" -if private.region == "PU" then private.region = "XX" end private.UNIT_TYPES = { PLAYER = "Player", diff -r 271132f4fa77 -r 679e2846ff88 Main.lua --- a/Main.lua Fri Sep 02 00:25:45 2016 -0400 +++ b/Main.lua Tue Sep 06 09:31:06 2016 -0400 @@ -26,6 +26,7 @@ local deformat = LibStub("LibDeformat-3.0") local HereBeDragons = LibStub("HereBeDragons-1.0") +local LibRealmInfo = LibStub("LibRealmInfo") local DatamineTT = _G.CreateFrame("GameTooltip", "WDPDatamineTT", _G.UIParent, "GameTooltipTemplate") DatamineTT:SetOwner(_G.WorldFrame, "ANCHOR_NONE") @@ -840,14 +841,18 @@ local raw_db = _G.WoWDBProfilerData local build_num = tonumber(private.build_num) - + + -- Get current region from LibRealmInfo (and account for the fact that PTR and Beta return nil) + local current_region = LibRealmInfo:GetCurrentRegion() or "XX" + + -- Wipe all data if DB version or build number changed if (raw_db.version and raw_db.version < DB_VERSION) or (raw_db.build_num and raw_db.build_num < build_num) then for entry in pairs(DATABASE_DEFAULTS.global) do global_db[entry] = {} end end raw_db.build_num = build_num - raw_db.region = private.region + raw_db.region = current_region raw_db.version = DB_VERSION private.InitializeCommentSystem() @@ -930,10 +935,10 @@ -- upgrade_value is optional in 6.2! can be detected using upgrade_type_id, but it's just as easy to check like this local upgrade_value = tonumber(item_results[15 + num_bonus_ids]) or 0 - local unkItemField1 = tonumber(item_results[16 + num_bonus_ids]) or 0 - local unkItemField2 = tonumber(item_results[17 + num_bonus_ids]) or 0 - if unkItemField1 > 0 then Debug("unkItemField1 is non-zero, specifically %d.", unkItemField1) end - if unkItemField2 > 0 then Debug("unkItemField2 is non-zero, specifically %d.", unkItemField2) end + local unk_item_field_1 = tonumber(item_results[16 + num_bonus_ids]) or 0 + local unk_item_field_2 = tonumber(item_results[17 + num_bonus_ids]) or 0 + --if unk_item_field_1 > 0 then Debug("unk_item_field_1 for %s is non-zero, specifically %d.", item_link, unk_item_field_1) end + --if unk_item_field_2 > 0 then Debug("unk_item_field_2 for %s is non-zero, specifically %d.", item_link, unk_item_field_2) end -- If there is anything special (non-zero) for this item then we need to make note of everything if math.max(suffix_id, instance_difficulty_id, num_bonus_ids, upgrade_value) ~= 0 then diff -r 271132f4fa77 -r 679e2846ff88 WoWDBProfiler.toc --- a/WoWDBProfiler.toc Fri Sep 02 00:25:45 2016 -0400 +++ b/WoWDBProfiler.toc Tue Sep 06 09:31:06 2016 -0400 @@ -4,7 +4,7 @@ ## Author: James D. Callahan III (Torhal) ## X-Email: jcallahan@curse.com ## SavedVariables: WoWDBProfilerData -## OptionalDeps: Ace3, HereBeDragons-1.0, LibDeformat-3.0, LibDialog-1.0, LibQTip-1.0 +## OptionalDeps: Ace3, HereBeDragons-1.0, LibDeformat-3.0, LibDialog-1.0, LibQTip-1.0, LibRealmInfo libs.xml diff -r 271132f4fa77 -r 679e2846ff88 libs.xml --- a/libs.xml Fri Sep 02 00:25:45 2016 -0400 +++ b/libs.xml Tue Sep 06 09:31:06 2016 -0400 @@ -4,6 +4,7 @@