# HG changeset patch # User James D. Callahan III # Date 1347298821 18000 # Node ID 5ed4050922966a1250f178e09dbc1edf4398fa9c # Parent 9f8994d82fd11d9fd942d0017d56071257a4fb8b Disallow collection of quest strings and NPC quotes unless the WoW client is running enUS or enGB locales. diff -r 9f8994d82fd1 -r 5ed405092296 Main.lua --- a/Main.lua Fri Sep 07 05:37:28 2012 -0500 +++ b/Main.lua Mon Sep 10 12:40:21 2012 -0500 @@ -98,6 +98,15 @@ local PLAYER_RACE = _G.select(2, _G.UnitRace("player")) +local CLIENT_LOCALE = _G.GetLocale() + + +local ALLOWED_LOCALES = { + enUS = true, + enGB = true, +} + + ----------------------------------------------------------------------- -- Local variables. ----------------------------------------------------------------------- @@ -665,7 +674,7 @@ function WDP:RecordQuote(event_name, message, source_name, language_name) - if not source_name or not name_to_id_map[source_name] or (language_name ~= "" and not languages_known[language_name]) then + if not ALLOWED_LOCALES[CLIENT_LOCALE] or not source_name or not name_to_id_map[source_name] or (language_name ~= "" and not languages_known[language_name]) then return end local npc = NPCEntry(name_to_id_map[source_name]) @@ -1323,8 +1332,10 @@ function WDP:QUEST_COMPLETE(event_name) local quest = UpdateQuestJuncture("end") - quest.reward_text = ReplaceKeywords(_G.GetRewardText()) + if ALLOWED_LOCALES[CLIENT_LOCALE] then + quest.reward_text = ReplaceKeywords(_G.GetRewardText()) + end -- Make sure the quest NPC isn't erroneously recorded as giving reputation for quests which award it. reputation_npc_id = nil end @@ -1371,6 +1382,9 @@ function WDP:QUEST_PROGRESS(event_name) + if not ALLOWED_LOCALES[CLIENT_LOCALE] then + return + end DBEntry("quests", _G.GetQuestID()).progress_text = ReplaceKeywords(_G.GetProgressText()) end