aboutsummaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)Author
2020-06-12fix up doc comments and testsDaniel
2020-06-12implement -after/-before in terms of -timeDaniel
It makes sense to unify this implementation to avoid code duplication and bugs that might be hidden. -after and -before can stay for now, as shortcuts for -time < and -time >, the same way we have other shortcuts as well.
2020-06-12add a count(player) to count all playersDaniel
2020-06-12report invalid filters that are valid regexesDaniel
2020-06-12add a comment about the trait aliasesDaniel
2020-06-12implement count(player: ...) constructDaniel
2020-06-12allow durations with minutes as wellDaniel
This allows things like "2m 50s" but also "5m". humantime would allow even more, but we need a regular expression to catch them for lalrpop, so for now this are the only two supported formats (together with "50s"). Considering the usual time of fights in GW2, I doubt we'll need anything bigger than minutes.
2020-06-12include fight duration in outputDaniel
Since we have this information now anyway, might as well include it. We're using humantime here, as that produces the expected "xxm yys zzms" output. The conversion shouldn't fail (the unwrap), as we should never encounter negative fight durations.
2020-06-12compute fight duration from event timesDaniel
It seems a bit iffy to use the local timestamp to compute the fight duration: First of all, the event timestamps have higher precision, being counted in milliseconds rather than seconds. Second, it is more reliable, as we always have a first and a last event, whereas the LogStart and LogEnd may not exist. Third, we may want to change how this value is calculated in the future anyway, as some bosses have a bit of a pre-log before the fight actually starts (arcdps starts the log when you get into combat, which might be before the boss actually spawns, like on Ensolyss). In either case, this function is probably a strong contender for being implemented properly in evtclib.
2020-06-12fix tests for sortingDaniel
2020-06-12add tests for CompOp::matchesDaniel
2020-06-12implement filter_early for ComparatorDaniel
2020-06-12more documentation for filters::valuesDaniel
2020-06-12initial work on comparison based filtersDaniel
This enables filters such as -time > 2020-01-01 -time < 2020-02-03 ... for time and duration, and later possibly also for more things (such as a COUNT(...) construct). This work tries to integrate them into the existing filter system as seamless as possible, by providing a Comparator which implements LogFilter. The "type checking" is done at parse time, so nonsensical comparisons like -time > 12s flat out give a parse error. This however might be changed to a more dynamic system with run-time type checking, in which case we could do away with the type parameter on Producer and simply work with a generic Value. The comparator would then return an error if two non-identical types would be compared. Note that the system does not support arithmetic expressions, only simple comparisons to constant values.
2020-06-08make --repl conflict with --checkDaniel
2020-06-08add --check to check a single fileDaniel
The --check flag will check the given file and set the exit status accordingly.
2020-06-07fix formattingDaniel
2020-06-07make exit status dependent on search resultsDaniel
2020-05-14add documentation about --sortDaniel
2020-05-14add a small test for sorting with SortingDaniel
2020-05-14fix testsDaniel
We changed the descending prefix to be ~ earlier, so now we need to adjust the tests as well.
2020-05-13fix formattingDaniel
2020-05-13change sorting reversing prefix to ~Daniel
Since - leads to structopt interpreting the component as the start of another argument, we need to use a different one.
2020-05-13fix Aggregator::finish for trait objectsDaniel
2020-05-13first attempt at sorting outputDaniel
This does currently not work yet, as we cannot call .finish() on dyn Aggregator. This needs to be adjusted. However, this provides the basic infrastructure for producing sorted output, including the required command line parsing.
2020-05-13clean up SearchField related codeDaniel
With the addition of our own parser, we no longer need the FromStr implementation for SearchField. Furthermore, it is now only used in player::NameFilter, so the definition has been moved there. The import in the grammar was unused as well, so it has been removed.
2020-05-12sort players based on their namesDaniel
The easiest way to get this consistent is to implement PartialOrd & Ord for Player. However, the implementation might not be 100% sound, as it should be using the same fields as (Partial)Eq, but that would mean either 1. Deriving PartialOrd/Ord, which is not possible because PlayerClass does not implement it (which in turn would not make sense to order) or 2. Implementing (Partial)Eq by hand instead of deriving it, which is not the best either I don't think it's an issue though, as we never put Players in any position where it might get relevant (such as a HashMap/BTreeMap), and we're only using it to sort them for the output.
2020-05-12fix formattingDaniel
2020-05-12make regular expressions case-insensitiveDaniel
Most users probably don't need the capitalization, and character names always have a predefined capitalization anyway.
2020-05-12use Display implementations from evtclibDaniel
2020-05-12add a -cm filterDaniel
2020-05-12display if a fight had CM activatedDaniel
2020-05-04add -class player filterDaniel
2020-05-04exclude : from words againDaniel
This causes issues with the player: prefix used in any() and all() constructs, as player: will now be parsed as a word instead of the proper token. For now, : is disallowed in words again until there is a better solution.
2020-05-04replace Player::profession with PlayerClass enumDaniel
Away with stringly typed stuff, we now have a proper way to save the profession of a player without relying on a string. Theoretically, that is better for memory consumption, as we now save only the identifier and use fmt::Display and static strings, but that was not the main reason for this change. The main reason is that now we can programatically work with the profession and elite spec, so that we can (for example) implement a filter to filter players based on their class. The word "class" has been chosen because it is a common synonym for the profession/elite, and because this is neither a profession nor the elite - it's a combination of both.
2020-05-04include missing semicolonDaniel
Rust doesn't necessarily need this, but it's good formatting to include it anyway.
2020-05-04Add a -log-before & -log-after predicateDaniel
With the file name heuristic for -before and -after in place, we might want a way for the user to disable it. For now, we simply do this by providing a new set of predicates without the filter. In the future, we might have a --disable-heuristics switch to disable the heuristics, in case we ever add more.
2020-05-04add a bit more docstring to INTERRUPTEDDaniel
2020-05-04rewrite maybe_save_historyDaniel
This avoids unwrapping (and therefore panicing) when the path doens't have a parent. It also avoids the explicit Into::into() calls.
2020-05-03save REPL history to a fileDaniel
This persists the REPL history across program restarts. The code should probably be cleaned up a bit more, the error handling in this one is a bit all over the place. This is because we don't want to make it a hard error in case the history cannot be saved.
2020-05-03evtclib: include as a dependency, not submoduleDaniel
With evtclib being on crates.io now (and generally, being available publicly through git), there is no longer a need to have a copy of the evtclib repository in this repository. The main reason was that evtclib was private when I started it, so the easiest way to include it was through a git submodule. That reason is no longer valid. If we really *need* to use the git version, it is also better to just point Cargo to the repository and let it deal with keeping the repository up-to-date, rather than using git submodules. This commit also updates Cargo.lock, so there is a bit of noise from also adding ctrlc as a dependency.
2020-05-01only cancel current search on Ctrl-CDaniel Schadt
This is not yet perfect, as it seems to still execute all queued threads just to immediately exit them, so maybe we should try and see if we can "clear" the rayon queue. But it's a good start, and the ctrlc crate seems to work well for this job.
2020-05-01improve requoting heuristicDaniel
First of all, this allows : to be part of a word. This has been added because the account names start with a colon, so -player :Dunje should work. Furthermore, the re-quoting now also quotes strings that contain a .+*, as those are characters usually used in regular expressions. A command line like raidgrep -- -player "G.dric" should work, so we either have to re-quote words with a dot, or allow the dot to be part of a (lexical) word as well. For now, we're re-quoting it, but if it turns out to be too troublesome, we might change that.
2020-05-01output filename as (lossy) string, not using DebugDaniel
This has the benefit that it removes the quotes, and it works better on Windows, where double slashes were used.
2020-05-01enable date parsing from filenamesDaniel
This allows the date-based filters to work much faster.
2020-05-01change LogFilter to take EarlyLogResultDaniel
This allows us to attach some additional metadata that is not found in the PartialEvtc otherwise, such as the file name.
2020-05-01use log end timestamp instead of startDaniel
They are usually within minutes of each other, but this has two advantages: 1. The output is consistent with the filename (and probably the file creation date, if it has been preserved) 2. Due to 1., this means we can use the filename to get the timestamp faster than parsing the file.
2020-05-01fix timestamp handlingDaniel
As it turns out, the "local timestamp" as advertised by arcdps is a bit misleading, because the timestamp is still in UTC. The "local" refers to the fact that it can lag behind the server timestamp a bit (but usually they seem to be within +-1 of each other), not that the timestamp is in the local timezone. This makes date handling a bit harder for raidgrep, but thanks to chrono, not by much. The idea is that we simply deal with Utc pretty much everywhere, except at the user boundary. This means that 1. Input timestamps for -before and -after are converted to Utc right after input 2. When outputting, we convert to a local timestamp first This makes the output consistent with the filenames now (and the "wall time" that the player saw).
2020-04-29fix BossFilter::filter_earlyDaniel
If the boss is unknown, we exclude the log - that is how BossFilter::filter operates, and it is probably what the user wants if they specify a -boss filter. However, in filter_early, the default for unknown bosses was to return Inclusion::Include, which is not consistent with filter. That lead to some logs being included, parsed and then thrown away again. This change makes the behaviour for unknown bosses between filter_early and filter consistent, and therefore speeds up the search if -boss is used.
2020-04-29add more help text about the boss namesDaniel
Everybody calls bosses by different names (Soulless Horror vs Desmina, Super Kodan Brothers, ...), so it might be good to have a list ready in the help message. Other names can still be used, but those are the end-user documented ones now.