[−][src]Crate evtclib
evtclib
is a crate aiming to provide utility functions to parse and work
with .evtc
reports generated by arcdps.
About evtc Files
evtc files are files generated by the (inofficial) arcdps addon to Guild Wars 2. They contain metadata about a fight in the game, such as the boss's name (if it was a raid or fractal boss), the participants, and a stripped-down log of the complete fight.
There are other programs (such as GW2-Elite-Insights-Parser) and websites (such as dps.report) which allow you to generate reports from evtc files.
A common way to store and distribute evtc files is to zip them to either a .evtc.zip
(old
way) or a .zevtc
(new way). evtclib uses zip
to read them,
prodiving the raw::parse_zip
convenience function.
Crate Structure
The crate consists of two main parts: The raw
parser, which is used to read structured
data from binary input streams, and the higher-level abstrations provided in the root and
event
submodules.
Additionally, there are some defintions (such as IDs for various game items) in the
gamedata
module.
The main structs that you should be dealing with are the Log
and its components, such
as Event
and Agent
.
Workflow
Currently, there is no convenience function to turn a file into a Log
directly, so you
have to use the raw
submodule to obtain a low-level Evtc
, and then
convert it to the high-level Log
.
use std::fs::File; // Open a file for processing let mut file = File::open("my_log.evtc")?; // Parse the raw content of the file let raw_log = evtclib::raw::parse_file(&mut file)?; // Process the file to do the nitty-gritty low-level stuff done let log = evtclib::process(&raw_log)?; // Do work on the log for player in log.players() { println!("Player {} participated!", player.account_name()); }
Make sure to take a look at the note on "Buffering" in the parser module in order to increase the speed of your application.
Writing evtc Files
Currently, evtclib
does not provide a way to output or modify evtc files. This is for two
reasons:
- The only sensible source for logs is the arcdps addon itself, most applications only consume them.
- The library was needed for reading support, and writing support has never been a priority.
While there are legitimate use cases for writing/modification support, they are currently not implemented (but might be in a future version).
Re-exports
pub use event::Event; |
pub use event::EventKind; |
pub use gamedata::Boss; |
pub use gamedata::EliteSpec; |
pub use gamedata::Profession; |
Modules
event | Event definitions. |
gamedata | This module contains some low-level game data, such as different boss IDs. |
raw | This module defines raw types that correspond 1:1 to the C types used in arcdps. |
Structs
Agent | An agent. |
Character | Character-specific agent data. |
Gadget | Gadget-specific agent data. |
Log | A fully processed log file. |
Player | Player-specific agent data. |
Enums
AgentKind | The type of an agent. |
EvtcError | Any error that can occur during the processing of evtc files. |
Functions
process |