forked from csutcliff/SimpleCombatLogger
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMain.lua
More file actions
719 lines (696 loc) · 29.9 KB
/
Main.lua
File metadata and controls
719 lines (696 loc) · 29.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
local SimpleCombatLogger = LibStub("AceAddon-3.0"):NewAddon("SimpleCombatLogger", "AceConsole-3.0", "AceEvent-3.0", "AceTimer-3.0")
local IsLoggingCombat = false
local DelayStopTimer = nil
local options = {
name = "SimpleCombatLogger",
handler = SimpleCombatLogger,
type = "group",
args = {
enable = {
name = "Enabled",
desc = "Enables / Disables the addon",
type = "toggle",
set = function(info, value) SimpleCombatLogger:SetEnable(value) end,
get = function(info) return SimpleCombatLogger.db.profile.enable end
},
disableaclprompt = {
name = "Disable ACL Reminder",
desc = "Disables the Advanced Combat Logging prompt",
type = "toggle",
set = function(info, value) SimpleCombatLogger.db.profile.disableaclprompt = value end,
get = function(info) return SimpleCombatLogger.db.profile.disableaclprompt end
},
enabledebug = {
name = "Debug",
desc = "Enable Debug output",
type = "toggle",
set = function(info, value) SimpleCombatLogger.db.profile.enabledebug = value end,
get = function(info) return SimpleCombatLogger.db.profile.enabledebug end
},
delaystop = {
name = "Delayed Log Stop",
desc = "Delay the stopping of combat logging by 30 seconds, this can help compatibility with some external programs such as Warcraft Recorder",
type = "toggle",
set = function(info, value) SimpleCombatLogger.db.profile.delaystop = value end,
get = function(info) return SimpleCombatLogger.db.profile.delaystop end
},
party = {
name = "Party",
type = "group",
args = {
normal = {
name = "Normal",
desc = "Enables / Disables normal dungeon logging",
type = "toggle",
set = function(info, value)
SimpleCombatLogger.db.profile.party.normal = value
SimpleCombatLogger:CheckToggleLogging(nil)
end,
get = function(info) return SimpleCombatLogger.db.profile.party.normal end
},
heroic = {
name = "Heroic",
desc = "Enables / Disables heroic dungeon logging",
type = "toggle",
set = function(info, value)
SimpleCombatLogger.db.profile.party.heroic = value
SimpleCombatLogger:CheckToggleLogging(nil)
end,
get = function(info) return SimpleCombatLogger.db.profile.party.heroic end
},
mythicplus = {
name = "Mythic Plus",
desc = "Enables / Disables mythic plus logging",
type = "toggle",
set = function(info, value)
SimpleCombatLogger.db.profile.party.mythicplus = value
SimpleCombatLogger:CheckToggleLogging(nil)
end,
get = function(info) return SimpleCombatLogger.db.profile.party.mythicplus end
},
mythic = {
name = "Mythic",
desc = "Enables / Disables mythic dungeon logging",
type = "toggle",
set = function(info, value)
SimpleCombatLogger.db.profile.party.mythic = value
SimpleCombatLogger:CheckToggleLogging(nil)
end,
get = function(info) return SimpleCombatLogger.db.profile.party.mythic end
},
timewalking = {
name = "Timewalking",
desc = "Enables / Disables timewalking dungeon logging",
type = "toggle",
set = function(info, value)
SimpleCombatLogger.db.profile.party.timewalking = value
SimpleCombatLogger:CheckToggleLogging(nil)
end,
get = function(info) return SimpleCombatLogger.db.profile.party.timewalking end
},
}
},
raid = {
name = "Raid",
type = "group",
args = {
lfr = {
name = "LFR",
desc = "Enables / Disables LFR raid logging",
type = "toggle",
set = function(info, value)
SimpleCombatLogger.db.profile.raid.lfr = value
SimpleCombatLogger:CheckToggleLogging(nil)
end,
get = function(info) return SimpleCombatLogger.db.profile.raid.lfr end
},
normal = {
name = "Normal",
desc = "Enables / Disables normal raid logging",
type = "toggle",
set = function(info, value)
SimpleCombatLogger.db.profile.raid.normal = value
SimpleCombatLogger:CheckToggleLogging(nil)
end,
get = function(info) return SimpleCombatLogger.db.profile.raid.normal end
},
heroic = {
name = "Heroic",
desc = "Enables / Disables heroic raid logging",
type = "toggle",
set = function(info, value)
SimpleCombatLogger.db.profile.raid.heroic = value
SimpleCombatLogger:CheckToggleLogging(nil)
end,
get = function(info) return SimpleCombatLogger.db.profile.raid.heroic end
},
mythic = {
name = "Mythic",
desc = "Enables / Disables mythic raid logging",
type = "toggle",
set = function(info, value)
SimpleCombatLogger.db.profile.raid.mythic = value
SimpleCombatLogger:CheckToggleLogging(nil)
end,
get = function(info) return SimpleCombatLogger.db.profile.raid.mythic end
},
timewalking = {
name = "Timewalking",
desc = "Enables / Disables timewalking raid logging",
type = "toggle",
set = function(info, value)
SimpleCombatLogger.db.profile.raid.timewalking = value
SimpleCombatLogger:CheckToggleLogging(nil)
end,
get = function(info) return SimpleCombatLogger.db.profile.raid.timewalking end
},
}
},
pvp = {
name = "PvP",
type = "group",
args = {
regularbg = {
name = "Battlegrounds",
desc = "Enables / Disables battleground logging",
type = "toggle",
set = function(info, value)
SimpleCombatLogger.db.profile.pvp.regularbg = value
SimpleCombatLogger:CheckToggleLogging(nil)
end,
get = function(info) return SimpleCombatLogger.db.profile.pvp.regularbg end
},
ratedbg = {
name = "Rated Battlegrounds",
desc = "Enables / Disables rated battleground logging",
type = "toggle",
set = function(info, value)
SimpleCombatLogger.db.profile.pvp.ratedbg = value
SimpleCombatLogger:CheckToggleLogging(nil)
end,
get = function(info) return SimpleCombatLogger.db.profile.pvp.ratedbg end
},
arenaskirmish = {
name = "Arena Skirmish",
desc = "Enables / Disables arena skirmish logging",
type = "toggle",
set = function(info, value)
SimpleCombatLogger.db.profile.pvp.arenaskirmish = value
SimpleCombatLogger:CheckArenaLogging(nil)
end,
get = function(info) return SimpleCombatLogger.db.profile.pvp.arenaskirmish end
},
soloshuffle = {
name = "Solo Shuffle",
desc = "Enables / Disables solo shuffle logging",
type = "toggle",
set = function(info, value)
SimpleCombatLogger.db.profile.pvp.soloshuffle = value
SimpleCombatLogger:CheckArenaLogging(nil)
end,
get = function(info) return SimpleCombatLogger.db.profile.pvp.soloshuffle end
},
wargame = {
name = "War Game",
desc = "Enables / Disables war game logging",
type = "toggle",
set = function(info, value)
SimpleCombatLogger.db.profile.pvp.wargame = value
SimpleCombatLogger:CheckArenaLogging(nil)
end,
get = function(info) return SimpleCombatLogger.db.profile.pvp.wargame end
},
ratedarena = {
name = "Rated Arena",
desc = "Enables / Disables rated arena logging",
type = "toggle",
set = function(info, value)
SimpleCombatLogger.db.profile.pvp.ratedarena = value
SimpleCombatLogger:CheckArenaLogging(nil)
end,
get = function(info) return SimpleCombatLogger.db.profile.pvp.ratedarena end
},
}
},
scenario = {
name = "Scenarios",
type = "group",
args = {
torghast = {
name = "Torghast",
desc = "Enables / Disables Torghast logging",
type = "toggle",
set = function(info, value)
SimpleCombatLogger.db.profile.scenario.torghast = value
SimpleCombatLogger:CheckToggleLogging(nil)
end,
get = function(info) return SimpleCombatLogger.db.profile.scenario.torghast end
}
}
}
}
}
local defaults = {
profile = {
enable = true,
disableaclprompt = false,
enabledebug = false,
delaystop = true,
party = {
["*"] = true,
},
raid = {
["*"] = true,
},
pvp = {
["*"] = true,
},
scenario = {
["*"] = true,
},
}
}
function SimpleCombatLogger:OnInitialize()
-- Called when the addon is initialized
-- ACL Prompt
StaticPopupDialogs["SCL_ENABLE_ACL"] = {
text = "Advaned Combat Logging is required for most combat log parsers, would you like to enable it?",
button1 = "Yes",
button2 = "No",
OnAccept = function()
SimpleCombatLogger:EnableACL()
end,
timeout = 0,
whileDead = true,
hideOnEscape = true,
preferredIndex = 3, -- avoid some UI taint, see http://www.wowace.com/announcements/how-to-avoid-some-ui-taint/
}
-- Initialisation
self.db = LibStub("AceDB-3.0"):New("SimpleCombatLoggerDB", defaults, true)
self.db.RegisterCallback(self, "OnProfileChanged", "RefreshConfig")
self.db.RegisterCallback(self, "OnProfileCopied", "RefreshConfig")
self.db.RegisterCallback(self, "OnProfileReset", "RefreshConfig")
LibStub("AceConfigRegistry-3.0"):RegisterOptionsTable("SimpleCombatLogger", options)
--Only the category ID is required, discard first parameter
_, self.optionsFrame = LibStub("AceConfigDialog-3.0"):AddToBlizOptions("SimpleCombatLogger", "SimpleCombatLogger")
LibStub("AceConfigRegistry-3.0"):RegisterOptionsTable("SCL/Profiles", LibStub("AceDBOptions-3.0"):GetOptionsTable(self.db))
LibStub("AceConfigDialog-3.0"):AddToBlizOptions("SCL/Profiles", "Profiles", "SimpleCombatLogger")
self:RegisterChatCommand("scl", "ChatCommand");
self:RegisterChatCommand("SimpleCombatLogger", "ChatCommand");
hooksecurefunc("LoggingCombat", function(state)
IsLoggingCombat = state
if (self.db.profile.enabledebug) then
self:Print("LoggingCombat called with: " .. tostring(state));
end
end);
end
function SimpleCombatLogger:RefreshConfig()
self:CheckToggleLogging(nil)
end
function SimpleCombatLogger:EnableACL()
SetCVar("advancedCombatLogging", 1)
end
function SimpleCombatLogger:OnEnable()
if (not self.db.profile.enable) then
self:OnDisable()
return
end
self:Print("Enabled")
if (not self.db.profile.disableaclprompt and GetCVar("advancedCombatLogging") == "0") then
StaticPopup_Show("SCL_ENABLE_ACL")
end
self:RegisterEvent("UPDATE_INSTANCE_INFO", "CheckEnableLogging")
self:RegisterEvent("PLAYER_DIFFICULTY_CHANGED", "CheckEnableLogging")
self:RegisterEvent("ZONE_CHANGED_NEW_AREA", "CheckDisableLogging")
self:RegisterEvent("PLAYER_ENTERING_WORLD", "ArenaEventTimer")
self:CheckToggleLogging(nil)
end
function SimpleCombatLogger:OnDisable()
self:Print("Disabled")
self:UnregisterEvent("UPDATE_INSTANCE_INFO")
self:UnregisterEvent("PLAYER_DIFFICULTY_CHANGED")
self:UnregisterEvent("ZONE_CHANGED_NEW_AREA")
self:StopLogging()
end
function SimpleCombatLogger:ChatCommand(input)
if (not input or input:trim() == "") then
Settings.OpenToCategory(self.optionsFrame)
elseif (input:trim() == "enable") then
self:SetEnable(true)
elseif (input:trim() == "disable") then
self:SetEnable(false)
elseif (input:trim() == "test") then
self:Print("Logging Combat: " .. tostring(IsLoggingCombat))
self:Print("Instance Info: " .. tostring(GetInstanceInfo()))
self:Print("Rated Arena: " .. tostring(C_PvP.IsRatedArena()))
self:Print("Arena Skirmish: " .. tostring(IsArenaSkirmish()))
self:Print("Solo Shuffle: " .. tostring(C_PvP.IsSoloShuffle()))
self:Print("War Game: " .. tostring(IsWargame()))
self:Print("Rated BG: " .. tostring(C_PvP.IsRatedBattleground()))
else
LibStub("AceConfigCmd-3.0").HandleCommand(SimpleCombatLogger, "SimpleCombatLogger", "SimpleCombatLogger", input)
end
end
function SimpleCombatLogger:SetEnable(value)
if (self.db.profile.enable == value) then
return
end
self.db.profile.enable = value
if (value) then
SimpleCombatLogger:OnEnable()
else
SimpleCombatLogger:OnDisable()
end
end
function SimpleCombatLogger:StartLogging()
if (self.db.profile.enabledebug) then
self:Print("Start called")
end
if (IsLoggingCombat) then
if (self.db.profile.enabledebug) then
self:Print("Combat Logging is already enabled")
end
if (DelayStopTimer ~= nil) then
if (self.db.profile.enabledebug) then
self:Print("Cancelling Delayed Stop")
end
self:CancelTimer(DelayStopTimer)
DelayStopTimer = nil
else
if (self.db.profile.enabledebug) then
self:Print("No active delayed stop")
end
end
end
if (not IsLoggingCombat) then
self:Print("Starting Combat Logging")
if (LoggingCombat(true)) then
if (self.db.profile.enabledebug) then
self:Print("Successfully started Combat Logging")
end
else
self:Print("Failed to start Combat Logging") -- this should never be hit
end
end
end
function SimpleCombatLogger:StopLogging()
if (self.db.profile.enabledebug) then
self:Print("Stop called")
end
if (IsLoggingCombat) then
if (self.db.profile.delaystop) then
if (self.db.profile.enabledebug) then
self:Print("Delay enabled, stopping in 30 seconds")
end
if (DelayStopTimer ~= nil) then
if (self.db.profile.enabledebug) then
self:Print("Another delayed stop is queued, overwriting it")
end
self:CancelTimer(DelayStopTimer)
end
DelayStopTimer = self:ScheduleTimer("StopLoggingNow", 30)
else
self:StopLoggingNow()
end
elseif (self.db.profile.enabledebug) then
self:Print("Combat logging is already stopped")
end
end
function SimpleCombatLogger:StopLoggingNow()
DelayStopTimer = nil
if (IsLoggingCombat) then
self:Print("Stopping Combat Logging")
if (not LoggingCombat(false)) then
if (self.db.profile.enabledebug) then
self:Print("Successfully stopped Combat Logging")
end
elseif (self.db.profile.enabledebug) then
self:Print("Failed to stop Combat Logging")
end
elseif (self.db.profile.enabledebug) then
self:Print("Combat Logging is not running")
end
end
function SimpleCombatLogger:ArenaEventTimer(event)
local name, instanceType, difficultyID, difficultyName, maxPlayers, dynamicDifficulty, isDynamic, instanceID, instanceGroupSize, LfgDungeonID = GetInstanceInfo()
if (self.db.profile.enabledebug) then
self:Print("Arena Event Timer")
self:Print("Currently Logging: " .. tostring(IsLoggingCombat))
self:Print("Event: " .. tostring(event))
self:Print(" name: " .. tostring(name))
self:Print(" instanceType: " .. tostring(instanceType))
self:Print(" difficultyID: " .. tostring(difficultyID))
self:Print(" difficultyName: " .. tostring(difficultyName))
self:Print(" maxPlayers: " .. tostring(maxPlayers))
self:Print(" dynamicDifficulty: " .. tostring(dynamicDifficulty))
self:Print(" isDynamic: " .. tostring(isDynamic))
self:Print(" instanceID: " .. tostring(instanceID))
self:Print(" instanceGroupSize: " .. tostring(instanceGroupSize))
self:Print(" LfgDungeonID: " .. tostring(LfgDungeonID))
end
if (instanceType == "arena") then
if (self.db.profile.enabledebug) then
self:Print("Scheduling arena check for 5 seconds")
end
self:ScheduleTimer("CheckArenaLogging", 5)
end
end
function SimpleCombatLogger:CheckToggleLogging(event)
if (IsLoggingCombat) then
self:CheckDisableLogging(nil)
else
self:CheckEnableLogging(nil)
end
end
function SimpleCombatLogger:CheckEnableLogging(event)
local name, instanceType, difficultyID, difficultyName, maxPlayers, dynamicDifficulty, isDynamic, instanceID, instanceGroupSize, LfgDungeonID = GetInstanceInfo()
if (self.db.profile.enabledebug) then
self:Print("Check Enable")
self:Print("Currently Logging: " .. tostring(IsLoggingCombat))
self:Print("Event: " .. tostring(event))
self:Print(" name: " .. tostring(name))
self:Print(" instanceType: " .. tostring(instanceType))
self:Print(" difficultyID: " .. tostring(difficultyID))
self:Print(" difficultyName: " .. tostring(difficultyName))
self:Print(" maxPlayers: " .. tostring(maxPlayers))
self:Print(" dynamicDifficulty: " .. tostring(dynamicDifficulty))
self:Print(" isDynamic: " .. tostring(isDynamic))
self:Print(" instanceID: " .. tostring(instanceID))
self:Print(" instanceGroupSize: " .. tostring(instanceGroupSize))
self:Print(" LfgDungeonID: " .. tostring(LfgDungeonID))
end
if (instanceType == "pvp") then
if (C_PvP.IsRatedBattleground()) then -- Returns false in regular BG, need to test in rated
if (self.db.profile.pvp.ratedbg) then
self:StartLogging()
end
elseif (self.db.profile.pvp.regularbg) then
self:StartLogging()
end
elseif (instanceType == "party") then
if (maxPlayers > 5) then
if (self.db.profile.enabledebug) then
self:Print("maxPlayers greater than 5 in party instance, assuming to be non-dungeon")
end
else
if (difficultyID == 1) then -- Normal
if (self.db.profile.party.normal) then
self:StartLogging()
end
elseif (difficultyID == 2) then -- Heroic
if (self.db.profile.party.heroic) then
self:StartLogging()
end
elseif (difficultyID == 8) then -- Mythic Plus
if (self.db.profile.party.mythicplus) then
self:StartLogging()
end
elseif (difficultyID == 23) then -- Mythic
if (self.db.profile.party.mythic) then
self:StartLogging()
end
elseif (difficultyID == 24) then -- Timewalking
if (self.db.profile.party.timewalking) then
self:StartLogging()
end
end
end
elseif (instanceType == "raid") then
if (difficultyID == 7 or difficultyID == 17) then -- LFR
if (self.db.profile.raid.lfr) then
self:StartLogging()
end
elseif (difficultyID == 3 or difficultyID == 4 or difficultyID == 9 or difficultyID == 14) then -- Normal
if (self.db.profile.raid.normal) then
self:StartLogging()
end
elseif (difficultyID == 5 or difficultyID == 6 or difficultyID == 15) then -- Heroic
if (self.db.profile.raid.heroic) then
self:StartLogging()
end
elseif (difficultyID == 16) then -- Mythic
if (self.db.profile.raid.mythic) then
self:StartLogging()
end
elseif (difficultyID == 33 or difficultyID == 151) then -- Timewalking
if (self.db.profile.raid.timewalking) then
self:StartLogging()
end
end
elseif (instanceType == "scenario") then
if (difficultyID == 167) then -- Torghast
if (self.db.profile.scenario.torghast) then
self:StartLogging()
end
end
end
end
function SimpleCombatLogger:CheckArenaLogging()
if (self.db.profile.enabledebug) then
self:Print("Check Arena")
self:Print("Currently Logging: " .. tostring(IsLoggingCombat))
self:Print("Rated Arena: " .. tostring(C_PvP.IsRatedArena()))
self:Print("Arena Skirmish: " .. tostring(IsArenaSkirmish()))
self:Print("Solo Shuffle: " .. tostring(C_PvP.IsSoloShuffle()))
self:Print("War Game: " .. tostring(IsWargame()))
end
if (C_PvP.IsRatedArena() and not IsArenaSkirmish() and not C_PvP.IsSoloShuffle() and not IsWargame()) then
if (self.db.profile.pvp.ratedarena) then
self:StartLogging()
else
self:StopLogging()
end
elseif (IsArenaSkirmish() and self.db.profile.pvp.arenaskirmish) then
self:StartLogging()
elseif (C_PvP.IsSoloShuffle() and self.db.profile.pvp.soloshuffle) then
self:StartLogging()
elseif (IsWargame() and self.db.profile.pvp.wargame) then
self:StartLogging()
else
self:StopLogging()
end
end
function SimpleCombatLogger:CheckDisableLogging(event)
local name, instanceType, difficultyID, difficultyName, maxPlayers, dynamicDifficulty, isDynamic, instanceID, instanceGroupSize, LfgDungeonID = GetInstanceInfo()
if (self.db.profile.enabledebug) then
self:Print("Check Disable")
self:Print("Currently Logging: " .. tostring(IsLoggingCombat))
self:Print("Event: " .. tostring(event))
self:Print(" name: " .. tostring(name))
self:Print(" instanceType: " .. tostring(instanceType))
self:Print(" difficultyID: " .. tostring(difficultyID))
self:Print(" difficultyName: " .. tostring(difficultyName))
self:Print(" maxPlayers: " .. tostring(maxPlayers))
self:Print(" dynamicDifficulty: " .. tostring(dynamicDifficulty))
self:Print(" isDynamic: " .. tostring(isDynamic))
self:Print(" instanceID: " .. tostring(instanceID))
self:Print(" instanceGroupSize: " .. tostring(instanceGroupSize))
self:Print(" LfgDungeonID: " .. tostring(LfgDungeonID))
end
if (instanceType == nil or instanceType == "none") then
if (self.db.profile.enabledebug) then
self:Print("Not in instance, stopping logging")
end
self:StopLogging()
return
elseif (instanceType == "pvp") then
if (C_PvP.IsRatedBattleground()) then -- Returns false in regular BG, need to test in rated
if (not self.db.profile.pvp.ratedbg) then
if (self.db.profile.enabledebug) then
self:Print("Rated BG disabled, stopping logging")
end
self:StopLogging()
end
elseif (not self.db.profile.pvp.regularbg) then
if (self.db.profile.enabledebug) then
self:Print("Regular BG disabled, stopping logging")
end
self:StopLogging()
end
elseif (instanceType == "party") then
if (maxPlayers > 5) then
if (self.db.profile.enabledebug) then
self:Print("maxPlayers greater than 5 in party instance, assuming to be non-dungeon")
end
self:StopLogging()
else
if (difficultyID == 1) then -- Normal
if (not self.db.profile.party.normal) then
if (self.db.profile.enabledebug) then
self:Print("Normal dungeons disabled, stopping logging")
end
self:StopLogging()
end
elseif (difficultyID == 2) then -- Heroic
if (not self.db.profile.party.heroic) then
if (self.db.profile.enabledebug) then
self:Print("Heroic dungeons disabled, stopping logging")
end
self:StopLogging()
end
elseif (difficultyID == 8) then -- Mythic Plus
if (not self.db.profile.party.mythicplus) then
if (self.db.profile.enabledebug) then
self:Print("M+ disabled, stopping logging")
end
self:StopLogging()
end
elseif (difficultyID == 23) then -- Mythic
if (not self.db.profile.party.mythic) then
if (self.db.profile.enabledebug) then
self:Print("Mythic dungeons disabled, stopping logging")
end
self:StopLogging()
end
elseif (difficultyID == 24) then -- Timewalking
if (not self.db.profile.party.timewalking) then
if (self.db.profile.enabledebug) then
self:Print("Timewalking dungeons disabled, stopping logging")
end
self:StopLogging()
end
else
if (self.db.profile.enabledebug) then
self:Print("Unknown party instance type, stopping logging")
end
self:StopLogging()
end
end
elseif (instanceType == "raid") then
if (difficultyID == 7 or difficultyID == 17) then -- LFR
if (not self.db.profile.raid.lfr) then
if (self.db.profile.enabledebug) then
self:Print("LFR disabled, stopping logging")
end
self:StopLogging()
end
elseif (difficultyID == 3 or difficultyID == 4 or difficultyID == 9 or difficultyID == 14) then -- Normal
if (not self.db.profile.raid.normal) then
if (self.db.profile.enabledebug) then
self:Print("Normal raid disabled, stopping logging")
end
self:StopLogging()
end
elseif (difficultyID == 5 or difficultyID == 6 or difficultyID == 15) then -- Heroic
if (not self.db.profile.raid.heroic) then
if (self.db.profile.enabledebug) then
self:Print("Heroic raid disabled, stopping logging")
end
self:StopLogging()
end
elseif (difficultyID == 16) then -- Mythic
if (not self.db.profile.raid.mythic) then
if (self.db.profile.enabledebug) then
self:Print("Mythic raid disabled, stopping logging")
end
self:StopLogging()
end
elseif (difficultyID == 33 or difficultyID == 151) then -- Timewalking
if (not self.db.profile.raid.timewalking) then
if (self.db.profile.enabledebug) then
self:Print("Timewalking raid disabled, stopping logging")
end
self:StopLogging()
end
else
if (self.db.profile.enabledebug) then
self:Print("Unknown raid instance type, stopping logging")
end
self:StopLogging()
end
elseif (instanceType == "scenario") then
if (difficultyID == 167) then -- Torghast
if (not self.db.profile.scenario.torghast) then
if (self.db.profile.enabledebug) then
self:Print("Torghast disabled, stopping logging")
end
self:StopLogging()
end
else
if (self.db.profile.enabledebug) then
self:Print("Unknown scenario instance type, stopping logging")
end
self:StopLogging()
end
end
end