comparison Main.lua @ 112:5ed405092296

Disallow collection of quest strings and NPC quotes unless the WoW client is running enUS or enGB locales.
author James D. Callahan III <jcallahan@curse.com>
date Mon, 10 Sep 2012 12:40:21 -0500
parents 9f8994d82fd1
children be3ec607e964
comparison
equal deleted inserted replaced
111:9f8994d82fd1 112:5ed405092296
96 local PLAYER_GUID = _G.UnitGUID("player") 96 local PLAYER_GUID = _G.UnitGUID("player")
97 local PLAYER_NAME = _G.UnitName("player") 97 local PLAYER_NAME = _G.UnitName("player")
98 local PLAYER_RACE = _G.select(2, _G.UnitRace("player")) 98 local PLAYER_RACE = _G.select(2, _G.UnitRace("player"))
99 99
100 100
101 local CLIENT_LOCALE = _G.GetLocale()
102
103
104 local ALLOWED_LOCALES = {
105 enUS = true,
106 enGB = true,
107 }
108
109
101 ----------------------------------------------------------------------- 110 -----------------------------------------------------------------------
102 -- Local variables. 111 -- Local variables.
103 ----------------------------------------------------------------------- 112 -----------------------------------------------------------------------
104 local anvil_spell_ids = {} 113 local anvil_spell_ids = {}
105 local action_data = {} 114 local action_data = {}
663 table.wipe(action_data) 672 table.wipe(action_data)
664 end 673 end
665 674
666 675
667 function WDP:RecordQuote(event_name, message, source_name, language_name) 676 function WDP:RecordQuote(event_name, message, source_name, language_name)
668 if not source_name or not name_to_id_map[source_name] or (language_name ~= "" and not languages_known[language_name]) then 677 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
669 return 678 return
670 end 679 end
671 local npc = NPCEntry(name_to_id_map[source_name]) 680 local npc = NPCEntry(name_to_id_map[source_name])
672 npc.quotes = npc.quotes or {} 681 npc.quotes = npc.quotes or {}
673 npc.quotes[event_name] = npc.quotes[event_name] or {} 682 npc.quotes[event_name] = npc.quotes[event_name] or {}
1321 end 1330 end
1322 1331
1323 1332
1324 function WDP:QUEST_COMPLETE(event_name) 1333 function WDP:QUEST_COMPLETE(event_name)
1325 local quest = UpdateQuestJuncture("end") 1334 local quest = UpdateQuestJuncture("end")
1326 quest.reward_text = ReplaceKeywords(_G.GetRewardText()) 1335
1327 1336 if ALLOWED_LOCALES[CLIENT_LOCALE] then
1337 quest.reward_text = ReplaceKeywords(_G.GetRewardText())
1338 end
1328 -- Make sure the quest NPC isn't erroneously recorded as giving reputation for quests which award it. 1339 -- Make sure the quest NPC isn't erroneously recorded as giving reputation for quests which award it.
1329 reputation_npc_id = nil 1340 reputation_npc_id = nil
1330 end 1341 end
1331 1342
1332 1343
1369 self:UnregisterEvent("QUEST_LOG_UPDATE") 1380 self:UnregisterEvent("QUEST_LOG_UPDATE")
1370 end 1381 end
1371 1382
1372 1383
1373 function WDP:QUEST_PROGRESS(event_name) 1384 function WDP:QUEST_PROGRESS(event_name)
1385 if not ALLOWED_LOCALES[CLIENT_LOCALE] then
1386 return
1387 end
1374 DBEntry("quests", _G.GetQuestID()).progress_text = ReplaceKeywords(_G.GetProgressText()) 1388 DBEntry("quests", _G.GetQuestID()).progress_text = ReplaceKeywords(_G.GetProgressText())
1375 end 1389 end
1376 1390
1377 1391
1378 function WDP:UNIT_QUEST_LOG_CHANGED(event_name, unit_id) 1392 function WDP:UNIT_QUEST_LOG_CHANGED(event_name, unit_id)