Skip to content

Commit

Permalink
improve fflogs error logging, add raw status stacks filter
Browse files Browse the repository at this point in the history
  • Loading branch information
xpdota committed Sep 2, 2024
1 parent abb92fe commit 8064d6d
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@
import gg.xp.xivsupport.events.triggers.easytriggers.conditions.SourceHasStatusFilter;
import gg.xp.xivsupport.events.triggers.easytriggers.conditions.SourcePartyMemberFilter;
import gg.xp.xivsupport.events.triggers.easytriggers.conditions.StatusIdFilter;
import gg.xp.xivsupport.events.triggers.easytriggers.conditions.StatusRawStacksFilter;
import gg.xp.xivsupport.events.triggers.easytriggers.conditions.StatusStacksFilter;
import gg.xp.xivsupport.events.triggers.easytriggers.conditions.TargetCountFilter;
import gg.xp.xivsupport.events.triggers.easytriggers.conditions.TargetEntityNpcIdFilter;
Expand Down Expand Up @@ -433,6 +434,7 @@ private Component generic(Object object, Object trigger) {
new ConditionDescription<>(AbilityNameFilter.class, HasAbility.class, "Ability Name", AbilityNameFilter::new, this::generic),
new ConditionDescription<>(StatusIdFilter.class, HasStatusEffect.class, "Status Effect ID", StatusIdFilter::new, this::generic),
new ConditionDescription<>(StatusStacksFilter.class, HasStatusEffect.class, "Status Effect Stack Count", StatusStacksFilter::new, this::generic),
new ConditionDescription<>(StatusRawStacksFilter.class, HasStatusEffect.class, "Status Effect Raw Stack Count", StatusRawStacksFilter::new, this::generic),
new ConditionDescription<>(SourceEntityTypeFilter.class, HasSourceEntity.class, "Source Combatant", SourceEntityTypeFilter::new, this::generic),
new ConditionDescription<>(TargetEntityTypeFilter.class, HasTargetEntity.class, "Target Combatant", TargetEntityTypeFilter::new, this::generic),
new ConditionDescription<>(SourceEntityNpcIdFilter.class, HasSourceEntity.class, "Source Combatant NPC ID", SourceEntityNpcIdFilter::new, this::generic),
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
package gg.xp.xivsupport.events.triggers.easytriggers.conditions;

import gg.xp.xivsupport.events.actlines.events.HasStatusEffect;
import gg.xp.xivsupport.events.triggers.easytriggers.model.NumericOperator;
import gg.xp.xivsupport.events.triggers.easytriggers.model.SimpleCondition;


public class StatusRawStacksFilter implements SimpleCondition<HasStatusEffect> {

public NumericOperator operator = NumericOperator.EQ;
@Description("Raw Stacks")
public long expected;

@Override
public boolean test(HasStatusEffect hasStatus) {
return operator.checkLong(hasStatus.getRawStacks(), expected);
}


@Override
public String fixedLabel() {
return "# of Stacks (raw)";
}

@Override
public String dynamicLabel() {
return "# of Raw Stacks " + operator.getFriendlyName() + ' ' + expected;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,16 @@ public static FflogsReportLocator fromURL(String url) {
String report = matcher.group(1);
String fightRaw = matcher.group(2);
int fight = fightRaw.equals("last") ? -1 : Integer.parseInt(fightRaw);
log.info("Parsed fflogs URL: report {}, fight {}", report, fight);
log.info("Parsed fflogs URL: report {}, fight {}, url '{}'", report, fight, url);
return new FflogsReportLocator(report, fight);
}
else if ((noFightMatcher = urlPatternNoFight.matcher(url)).find()) {
String report = noFightMatcher.group(1);
log.info("Parsed fflogs URL: report {}, no fight", report);
log.info("Parsed fflogs URL: report {}, no fight, url '{}'", report, url);
return new FflogsReportLocator(report, null);
}
else {
log.warn("Failed to parse fflogs URL");
log.warn("Failed to parse fflogs URL '{}'", url);
throw new IllegalArgumentException("This doesn't look like a valid fflogs fight URL: " + url);
}
}
Expand Down

0 comments on commit 8064d6d

Please sign in to comment.