Mercurial > wow > wowdb-profiler
comparison Main.lua @ 233:19cd74910fc9 1.0.40
Store raw instance difficulty rather than translating to a string. Bumped DB_VERSION to 15.
| author | James D. Callahan III <jcallahan@curse.com> |
|---|---|
| date | Wed, 27 Feb 2013 11:23:02 -0600 |
| parents | 4ab275c52d7f |
| children | 42264feaecd6 |
comparison
equal
deleted
inserted
replaced
| 232:4ab275c52d7f | 233:19cd74910fc9 |
|---|---|
| 30 | 30 |
| 31 | 31 |
| 32 ----------------------------------------------------------------------- | 32 ----------------------------------------------------------------------- |
| 33 -- Local constants. | 33 -- Local constants. |
| 34 ----------------------------------------------------------------------- | 34 ----------------------------------------------------------------------- |
| 35 local DB_VERSION = 14 | 35 local DB_VERSION = 15 |
| 36 local DEBUGGING = false | 36 local DEBUGGING = false |
| 37 local EVENT_DEBUG = false | 37 local EVENT_DEBUG = false |
| 38 | 38 |
| 39 | 39 |
| 40 local DATABASE_DEFAULTS = { | 40 local DATABASE_DEFAULTS = { |
| 287 private.raid_finder_boss_id = nil | 287 private.raid_finder_boss_id = nil |
| 288 private.world_boss_id = nil | 288 private.world_boss_id = nil |
| 289 end | 289 end |
| 290 | 290 |
| 291 | 291 |
| 292 local function IsRaidFinderInstance(instance_type, instance_difficulty) | |
| 293 return instance_type == "raid" and instance_difficulty == 2 and _G.IsPartyLFG() and _G.IsInLFGDungeon() | |
| 294 end | |
| 295 | |
| 296 | |
| 297 local function InstanceDifficultyToken() | 292 local function InstanceDifficultyToken() |
| 298 local _, instance_type, instance_difficulty, difficulty_name, _, _, is_dynamic = _G.GetInstanceInfo() | 293 local _, instance_type, instance_difficulty, _, _, _, is_dynamic = _G.GetInstanceInfo() |
| 299 if not difficulty_name or difficulty_name == "" then | |
| 300 difficulty_name = "NONE" | |
| 301 end | |
| 302 | 294 |
| 303 if not instance_type or instance_type == "" then | 295 if not instance_type or instance_type == "" then |
| 304 instance_type = "NONE" | 296 instance_type = "NONE" |
| 305 end | 297 end |
| 306 | 298 return ("%s:%d:%s"):format(instance_type:upper(), instance_difficulty, _G.tostring(is_dynamic)) |
| 307 -- Raid difficulty of 2 is 25-man | |
| 308 if IsRaidFinderInstance(instance_type, instance_difficulty) then | |
| 309 difficulty_name = "LOOKING_FOR_RAID" | |
| 310 end | |
| 311 return ("%s:%s:%s"):format(instance_type:upper(), difficulty_name:upper():gsub(" ", "_"), _G.tostring(is_dynamic)) | |
| 312 end | 299 end |
| 313 | 300 |
| 314 | 301 |
| 315 local function DBEntry(data_type, unit_id) | 302 local function DBEntry(data_type, unit_id) |
| 316 if not data_type or not unit_id then | 303 if not data_type or not unit_id then |
