diff core.lua @ 39:8f7ec6ccf5e3

Comment/debug changes to help in tracking down cache bug. Do not run OnAccept when pressing Enter in an empty editbox.
author Farmbuyer of US-Kilrogg <farmbuyer@gmail.com>
date Thu, 29 Dec 2011 23:15:51 +0000
parents bb41be8f13b2
children dc3a66688e50
line wrap: on
line diff
--- a/core.lua	Fri Dec 23 01:08:02 2011 +0000
+++ b/core.lua	Thu Dec 29 23:15:51 2011 +0000
@@ -697,7 +697,7 @@
 	local function prefer_local_loots (cache)
 		-- The function name is a bit of a misnomer, as local entries overwrite
 		-- remote entries as the candidate table is populated.  This routine is
-		-- here to extract the results once the cache timers have expired.
+		-- here to extract the final results once the cache timers have expired.
 		--
 		-- Keep this sync'd with the local_override branch below.
 		for i,sig in ipairs(candidates) do
@@ -738,7 +738,7 @@
 		self.dprint('loot',">>_do_loot, R:", recipient, "I:", itemid, "C:", count, "frm:", from, "ex:", extratext, "q:", iquality)
 
 		itemid = tonumber(ilink:match("item:(%d+)") or 0)
-		-- This is only a loop to make jumping out of it easy, and still do cleanup below.
+		-- This is only a 'while' to make jumping out of it easy and still do cleanup below.
 		while local_override or ((iquality >= self.threshold) and not opts.itemfilter[itemid]) do
 			if (self.rebroadcast and (not from)) and not local_override then
 				self:broadcast('loot', recipient, itemid, count)
@@ -746,7 +746,7 @@
 			if (not self.enabled) and (not local_override) then break end
 			local signature = recipient .. iname .. (count or "")
 			if from and self.recent_loot:test(signature) then
-				self.dprint('cache', "loot <",signature,"> already in cache, skipping")
+				self.dprint('cache', "remote loot <",signature,"> already in cache, skipping")
 			else
 				-- There is some redundancy in all this, in the interests of ease-of-coding
 				i = {
@@ -766,7 +766,8 @@
 					is_heroic	= self:is_heroic_item(ilink),
 				}
 				if local_override then
-					-- adding things by hand, don't wait for network cache timeouts
+					-- player is adding loot by hand, don't wait for network cache timeouts
+					-- keep this sync'd with prefer_local_loots above
 					if i.extratext == 'shard'
 					   or i.extratext == 'gvault'
 					   or i.extratext == 'offspec'
@@ -780,12 +781,12 @@
 					then
 						self:_addHistoryEntry(looti)
 					end
-					i = looti  -- mostly for gui's manual entry
+					i = looti  -- return value mostly for gui's manual entry
 				else
 					self.recent_loot:add(signature)
 					candidates[signature] = i
 					tinsert (candidates, signature)
-					self.dprint('cache', "loot <",signature,"> added to cache, candidate", #candidates)
+					self.dprint('cache', "loot <",signature,"> added to cache as candidate", #candidates)
 				end
 			end
 			break
@@ -1280,7 +1281,7 @@
 			local not_from_local = duration == nil
 			local signature = bossname .. reason
 			if not_from_local and self.recent_boss:test(signature) then
-				self.dprint('cache', "boss <",signature,"> already in cache, skipping")
+				self.dprint('cache', "remote boss <",signature,"> already in cache, skipping")
 			else
 				self.recent_boss:add(signature)
 				g_boss_signpost = #g_loot + 1