Quantcast

Upgrade Ace3 libraries to the latest version.

Eyal Shilony [10-16-14 - 10:05]
Upgrade Ace3 libraries to the latest version.
Filename
.gitignore
libs/AceDB-3.0/AceDB-3.0.lua
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..47a521d
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,2 @@
+.buildpath
+.project
\ No newline at end of file
diff --git a/libs/AceDB-3.0/AceDB-3.0.lua b/libs/AceDB-3.0/AceDB-3.0.lua
index c2bb775..79f4b39 100644
--- a/libs/AceDB-3.0/AceDB-3.0.lua
+++ b/libs/AceDB-3.0/AceDB-3.0.lua
@@ -39,8 +39,8 @@
 -- end
 -- @class file
 -- @name AceDB-3.0.lua
--- @release $Id: AceDB-3.0.lua 1035 2011-07-09 03:20:13Z kaelten $
-local ACEDB_MAJOR, ACEDB_MINOR = "AceDB-3.0", 22
+-- @release $Id: AceDB-3.0.lua 1115 2014-09-21 11:52:35Z kaelten $
+local ACEDB_MAJOR, ACEDB_MINOR = "AceDB-3.0", 25
 local AceDB, oldminor = LibStub:NewLibrary(ACEDB_MAJOR, ACEDB_MINOR)

 if not AceDB then return end -- No upgrade needed
@@ -260,9 +260,12 @@ local _, classKey = UnitClass("player")
 local _, raceKey = UnitRace("player")
 local factionKey = UnitFactionGroup("player")
 local factionrealmKey = factionKey .. " - " .. realmKey
-local factionrealmregionKey = factionrealmKey .. " - " .. string.sub(GetCVar("realmList"), 1, 2):upper()
 local localeKey = GetLocale():lower()

+local regionTable = { "US", "KR", "EU", "TW", "CN" }
+local regionKey = _G["GetCurrentRegion"] and regionTable[GetCurrentRegion()] or string.sub(GetCVar("realmList"), 1, 2):upper()
+local factionrealmregionKey = factionrealmKey .. " - " .. regionKey
+
 -- Actual database initialization function
 local function initdb(sv, defaults, defaultProfile, olddb, parent)
 	-- Generate the database keys for each section
@@ -525,6 +528,15 @@ function DBObjectLib:DeleteProfile(name, silent)
 		end
 	end

+	-- switch all characters that use this profile back to the default
+	if self.sv.profileKeys then
+		for key, profile in pairs(self.sv.profileKeys) do
+			if profile == name then
+				self.sv.profileKeys[key] = nil
+			end
+		end
+	end
+
 	-- Callback: OnProfileDeleted, database, profileKey
 	self.callbacks:Fire("OnProfileDeleted", self, name)
 end