debug(combat): explicit error catch + null-check logging
If the CombatStatsTracker constructor throws (e.g. TypeInitializationException from static field initializers), we now catch and print the exact exception type + message + inner exception to the DECAL chat window. Also logs "tracker=OK" or "tracker=NULL" in LoginComplete so we can see if the object was created at all. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
77e87484e8
commit
11969fc590
2 changed files with 11 additions and 1 deletions
|
|
@ -349,7 +349,16 @@ namespace MosswartMassacre
|
|||
_vitalSharingTracker = new VitalSharingTracker(this);
|
||||
|
||||
// Initialize combat stats tracker (Mag-Tools style combat parsing)
|
||||
_combatStatsTracker = new CombatStatsTracker(this);
|
||||
try
|
||||
{
|
||||
_combatStatsTracker = new CombatStatsTracker(this);
|
||||
}
|
||||
catch (Exception combatEx)
|
||||
{
|
||||
WriteToChat($"[CombatStats] FATAL: Failed to create tracker: {combatEx.GetType().Name}: {combatEx.Message}");
|
||||
if (combatEx.InnerException != null)
|
||||
WriteToChat($"[CombatStats] Inner: {combatEx.InnerException.GetType().Name}: {combatEx.InnerException.Message}");
|
||||
}
|
||||
|
||||
// Initialize command router
|
||||
_commandRouter = new CommandRouter();
|
||||
|
|
@ -547,6 +556,7 @@ namespace MosswartMassacre
|
|||
_staticRareTracker = _rareTracker;
|
||||
_chatEventRouter.SetRareTracker(_rareTracker);
|
||||
_chatEventRouter.SetCombatTracker(_combatStatsTracker);
|
||||
WriteToChat($"[CombatStats] tracker={(_combatStatsTracker != null ? "OK" : "NULL")}");
|
||||
|
||||
// Apply the values
|
||||
_rareTracker.RareMetaEnabled = PluginSettings.Instance.RareMetaEnabled;
|
||||
|
|
|
|||
Binary file not shown.
Loading…
Add table
Add a link
Reference in a new issue