Quantcast

Move some of the debug processing from the live client to the dataminer. Skill levels and expansion info will now be checked when you do a database scan.

ackis [08-11-09 - 19:11]
Move some of the debug processing from the live client to the dataminer.  Skill levels and expansion info will now be checked when you do a database scan.
Filename
ARLDatamine.lua
AckisRecipeList.lua
diff --git a/ARLDatamine.lua b/ARLDatamine.lua
index 754da24..8cc5361 100644
--- a/ARLDatamine.lua
+++ b/ARLDatamine.lua
@@ -1089,12 +1089,45 @@ function addon:TooltipScanDatabase()

 	-- Parse the entire recipe database
 	for i in pairs(recipe_list) do
+
+		-- Check for game version
+		local Game = i["Game"]
+		recipe_name = i["Name"]
+		if (not Game) then
+			tinsert(t,"No expansion information: " .. tostring(i) .. " " .. recipe_name)
+		elseif (Game > 2) then
+			tinsert(t,"Expansion information too high: " .. tostring(i) .. " " .. recipe_name)
+		end
+
+		local Orange = i["Orange"]
+		local Yellow = i["Yellow"]
+		local Green = i["Green"]
+		local Grey = i["Grey"]
+		local SkillLevel = i["Level"]
+
+		-- No skill level information
+		if (not Orange) then
+			tinsert(t,"No skill level information: " .. tostring(i) .. " " .. recipe_name)
+		else
+			-- Highest level is greater than the skill of the recipe
+			if (Orange > SkillLevel) then
+				tinsert(t,"Skill Level Error (Orange > Skill): " .. tostring(i) .. " " .. recipe_name)
+			end
+			-- Level info is messed up
+			if (Orange > Yellow) or (Orange > Green) or (Orange > Grey) or (Yellow > Green) or (Yellow > Grey) or (Green > Grey) then
+				tinsert(t,"Skill Level Error: " .. tostring(i) .. " " .. recipe_name)
+			end
+		end
+
 		local ttscantext = addon:TooltipScanRecipe(i,false,true)
 		if (ttscantext) then
 			tinsert(t,ttscantext)
 		end
+
 	end
+
 	self:DisplayTextDump(nil,nil,tconcat(t,"\n"))
+
 end

 --- Parses a specific recipe in the database,and scanning its tooltip.
diff --git a/AckisRecipeList.lua b/AckisRecipeList.lua
index ad500ec..005fc85 100644
--- a/AckisRecipeList.lua
+++ b/AckisRecipeList.lua
@@ -544,6 +544,7 @@ function addon:addTradeSkill(RecipeDB, SpellID, SkillLevel, ItemID, Rarity, Prof
 		["Flags"] = {},					-- Create the flag space in the RecipeDB
 		["Acquire"] = {},				-- Create the Acquire space in the RecipeDB
 		["Specialty"] = Specialty,			-- Assumption: there will only be 1 speciality for a trade skill
+		["Game"] = Game,
 		["Orange"] = Orange or SkillLevel,		-- If we don't have an orange value in the db, just assume the skill level
 		["Yellow"] = Yellow or SkillLevel + 10,		-- If we don't have a yellow value in the db, just assume the skill level
 		["Green"] = Green or SkillLevel + 15,		-- If we don't have a green value in the db, just assume the skill level
@@ -560,31 +561,6 @@ function addon:addTradeSkill(RecipeDB, SpellID, SkillLevel, ItemID, Rarity, Prof
 		recipeentry["Flags"][i] = false
 	end

-	-- Get the expansion that the recipe was added
-	if (Game) then
-		recipeentry["Game"] = Game
-		-- We don't have a game flag set, so we'll just make an assumption based on skill levels
-		-- Eventually once all these are added we won't need this code
-	elseif (SkillLevel <= 300) then
-		recipeentry["Game"] = 0
-	elseif (SkillLevel <= 375) then
-		recipeentry["Game"] = 1
-	elseif (SkillLevel <= 450) then
-		recipeentry["Game"] = 2
-	end
-
-	--@alpha@
-	if (not Game) then
-		self:Print("No expansion information: "..profession_id.." "..tostring(SpellID).." "..recipe_name)
-	elseif (Game > 2) then
-		self:Print("Expansion information too high: "..profession_id.." "..tostring(SpellID).." "..recipe_name)
-	end
-
-	if (not Orange) then
-		--self:Print("No skill level information: "..profession_id.." "..tostring(SpellID).." "..recipe_name)
-	end
-	--@end-alpha@
-
 end

 --- Adds filtering flags to a specific tradeskill.