Heroes.StormReplayParser
2.2.1
dotnet add package Heroes.StormReplayParser --version 2.2.1
NuGet\Install-Package Heroes.StormReplayParser -Version 2.2.1
<PackageReference Include="Heroes.StormReplayParser" Version="2.2.1" />
paket add Heroes.StormReplayParser --version 2.2.1
#r "nuget: Heroes.StormReplayParser, 2.2.1"
// Install Heroes.StormReplayParser as a Cake Addin #addin nuget:?package=Heroes.StormReplayParser&version=2.2.1 // Install Heroes.StormReplayParser as a Cake Tool #tool nuget:?package=Heroes.StormReplayParser&version=2.2.1
Heroes Storm Replay Parser
Heroes Storm Replay Parser is a .NET library that parses the Heroes of the Storm replay files (.StormReplay) and can also be used to parse .battlelobby
files.
To see this library in action check out Heroes Decode.
This library is based on Heroes.ReplayParser.
Replay File Usage
To parse a replay file use StormReplay.Parse(string fileName)
by providing the .StormReplay
file. It will return a StormReplayResult
object that will have the result of the parsing as well as the StormReplay
object that will contain all the data parsed.
Example:
// parse the replay file
StormReplayResult stormReplayResult = StormReplay.Parse(@"C:\<USER PATH>\Replays\Multiplayer\2020-06-29 20.08.13 Garden of Terror.StormReplay");
// get the result of the parsing
StormReplayParseStatus status = stormReplayResult.Status;
// check if it succeeded
if (status == StormReplayParseStatus.Success)
{
// get the replay object
StormReplay replay = stormReplayResult.Replay;
// version of the replay
StormReplayVersion version = replay.ReplayVersion;
// player data
IEnumerable<StormPlayer> players = replay.StormPlayers;
}
else
{
// check if the status is an exception
if (status == StormReplayParseStatus.Exception)
{
// the exception
StormParseException? stormParseException = stormReplayResult.Exception;
}
}
Parsing Options
Besides providing the file name of the replay, ParseOptions()
may also be passed in. This defines how much of the replay to parse. By default tracker, game, and message events are enabled and PTR parsing is disabled. Parsing a PTR replay will result in a StormReplayParseStatus
of PTRRegion
.
Game Event parsing provides the following:
- Hero names (localized)
- Talent timestamps
- Player disconnects
Tracker Event parsing provides the following:
- Hero unit ids
- Map id name
- Team levels
- Team xp breakdown
- Draft picks
- Talent ids
- Player end of game score results
- Player end of game match awards
Message Events provides the following:
- All message types (chat, ping, player announce messages, etc...)
The above provided are properties of classes that are automatically parsed out. GameEvents
, TrackerEvents
, and Messages
are also properties that are available that can be used for obtaining specific data.
BattleLobby File Usage
replay.server.battlelobby
files can also be parsed to obtain data for pregame analysis tools. The .battlelobby
file is created at the start of the loading screen.
On Windows, the default location is C:\<USER PATH>\AppData\Local\Temp\Heroes of the Storm\TempWriteReplayP1\replay.server.battlelobby
. The Temp\Heroes of the Storm
directory is deleted after the game (not the match) has closed.
To parse a battlelobby file use StormReplayPregame.Parse(string fileName)
by providing the .battlelobby
file. It will return a StormReplayPregameResult
object that will have the result of the parsing as well as the StormReplayPregame
object that will contain all the data parsed.
Example:
// parse the battlelobby file
StormReplayPregameResult stormReplayPregameResult = StormReplayPregame.Parse(@"C:\<USER PATH>\AppData\Local\Temp\Heroes of the Storm\TempWriteReplayP1\replay.server.battlelobby");
// get the result of the parsing
StormReplayPregameParseStatus status = stormReplayPregameResult.Status;
// check if it succeeded
if (status == StormReplayPregameParseStatus.Success)
{
// get the replay object
StormReplayPregame replay = stormReplayPregameResult.ReplayBattleLobby;
// version of the replay
int buildVersion = replay.ReplayBuild;
// player data
IEnumerable<PregameStormPlayer> players = replay.StormPlayers;
}
else
{
// check if the status is an exception
if (status == StormReplayPregameParseStatus.Exception)
{
// the exception
StormParseException? stormParseException = stormReplayPregameResult.Exception;
}
}
Parsing Options
Besides providing the file name of the replay, ParsePregameOptions()
may also be passed in. By default PTR parsing is enabled. Parsing a PTR battlelobby will result in a StormReplayParseStatus
of PTRRegion
.
Data References
Some data returned will be references to the game data, such as PlayerHero.HeroAttributeId
. Such data can be obtained from HeroesDataParser. From there other resource links can be found.
Developing
To build and compile the code, it is recommended to use the latest version of Visual Studio 2022 or Visual Studio Code.
Another option is to use the dotnet CLI tools from the .NET 8.0 SDK.
License
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
-
net6.0
- Heroes.MpqTool (>= 1.2.0)
-
net8.0
- Heroes.MpqTool (>= 1.2.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated | |
---|---|---|---|
2.2.1 | 141 | 6/28/2024 | |
2.2.0 | 256 | 2/5/2024 | |
2.1.0 | 240 | 12/26/2023 | |
2.0.0 | 168 | 12/18/2023 | |
1.1.1 | 224 | 7/29/2023 | |
1.1.0 | 150 | 7/27/2023 | |
1.0.0 | 516 | 4/18/2022 | |
1.0.0-beta.11 | 315 | 7/31/2021 | |
1.0.0-beta.10 | 237 | 6/20/2021 | |
1.0.0-beta.9 | 258 | 5/20/2021 | |
1.0.0-beta.8 | 203 | 1/24/2021 | |
1.0.0-beta.7 | 187 | 1/3/2021 | |
1.0.0-beta.6 | 235 | 12/6/2020 | |
1.0.0-beta.5 | 264 | 11/22/2020 | |
1.0.0-beta.4 | 295 | 8/19/2020 | |
1.0.0-beta.3 | 384 | 8/9/2020 | |
1.0.0-beta.2 | 390 | 8/8/2020 | |
1.0.0-beta.1 | 473 | 8/7/2020 |