Skip to content

Commit

Permalink
Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
xpdota committed Dec 16, 2023
1 parent f0bbab6 commit df137e0
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,9 @@ private TimelineProcessor(TimelineManager manager, List<TimelineEntry> entries,
.filter(Objects::nonNull)
.collect(Collectors.toUnmodifiableSet());
this.useClassicSync = syncEntries.stream().anyMatch(entry -> entry.sync() != null);
if (this.useClassicSync) {
log.info("This timeline still uses classic regex syncs!");
}
}
else {
this.subSyncChunks = Collections.emptyMap();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ public String toString() {
return "TranslatedTextFileEntry{" +
"nameOverride='" + nameOverride +
"', syncOverride='" + syncOverride +
"', untranslated='" + untranslated +
"', syncControl='" + esc +
"', untranslated='" + untranslated +
"'}";
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
import gg.xp.xivsupport.events.actlines.events.NameIdPair;
import org.apache.commons.lang3.StringUtils;

import java.util.Objects;
import java.util.function.Function;
import java.util.function.Predicate;
import java.util.regex.Pattern;

class CbConversions {
Expand Down Expand Up @@ -59,8 +61,13 @@ static <X> CbConversion<X> intConv(Function<X, Long> getter, int base, int minDi
};
}

private static final Pattern simpleString = Pattern.compile("[A-Za-z0-9-='\",~`!@#%&]*");

static <X> CbConversion<X> strConv(Function<X, String> getter) {
return str -> {
if (simpleString.matcher(str).matches()) {
return item -> Objects.equals(getter.apply(item), str);
}
Pattern pattern = Pattern.compile(str);
return item -> pattern.matcher(getter.apply(item)).matches();
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ void basicTest() {
MatcherAssert.assertThat(tm.getCurrentDisplayEntries(), Matchers.empty());

// 1000.0 "--sync--" sync / 29:[^:]*:7DC:[^:]*:1008:/ window 10000,0
dist.acceptEvent(new ACTLogLineEvent("41|2022-04-19T17:36:39.0000000-07:00|0|7DC|0|1008|a5fb68c9fda6fe87"));
dist.acceptEvent(new ACTLogLineEvent("41|2022-04-19T17:36:39.0000000-07:00|0|7DC|0|1008|1234|a5fb68c9fda6fe87"));
// dist.acceptEvent(new ACTLogLineEvent("00|2022-04-19T17:36:39.0000000-07:00|0839||The shell mound will be sealed off in 15 seconds!|a5fb68c9fda6fe87"));
{
List<VisualTimelineEntry> currentEntries = tm.getCurrentDisplayEntries();
Expand Down

0 comments on commit df137e0

Please sign in to comment.