Ecosyste.ms: Packages

An open API service providing package, version and dependency metadata of many open source software ecosystems and registries.

Top 4.4% on proxy.golang.org
Top 4.2% dependent packages on proxy.golang.org
Top 1.9% dependent repos on proxy.golang.org
Top 5.8% forks on proxy.golang.org

proxy.golang.org : github.com/icza/s2prot

Package s2prot is a decoder/parser of Blizzard's StarCraft II replay file format (*.SC2Replay). s2prot processes the "raw" data that can be decoded from replay files using an MPQ parser such as https://github.com/icza/mpq. The package is safe for concurrent use. The package s2prot/rep provides enumerations and types to model data structures of StarCraft II replays (*.SC2Replay) decoded by the s2prot package. These provide a higher level overview and much easier to use. The below example code can be found in https://github.com/icza/s2prot/blob/master/_example/rep.go. To open and parse a replay: And that's all! We now have all the info from the replay! Printing some of it: Output: Tip: the Struct type defines a String() method which returns a nicely formatted JSON representation; this is what most type are "made of": Output: The below example code can be found in https://github.com/icza/s2prot/blob/master/_example/s2prot.go. To use s2prot, we need an MPQ parser to get content from a replay. Replay header (which is the MPQ User Data) can be decoded by s2prot.DecodeHeader(). Printing replay version: Base build is part of the replay header: Which can be used to obtain the proper instance of Protocol: Which can now be used to decode all other info in the replay. To decode the Details and print the map name: Tip: We can of course print the whole decoded header which is a Struct: Which yields a JSON text similar to the one posted above (at High-level Usage). - s2protocol: Blizzard's reference implementation in python: https://github.com/Blizzard/s2protocol - s2protocol implementation of the Scelight project: https://github.com/icza/scelight/tree/master/src-app/hu/scelight/sc2/rep/s2prot - Replay model of the Scelight project: https://github.com/icza/scelight/tree/master/src-app/hu/scelight/sc2/rep/model

Registry - Source - Documentation - JSON
purl: pkg:golang/github.com/icza/s2prot
Keywords: command-line-tool, decoder, parser, replay, replay-header, sc2replay, starcraft-ii-replays
License: Apache-2.0
Latest release: 5 months ago
First release: about 7 years ago
Namespace: github.com/icza
Dependent packages: 2
Dependent repositories: 7
Stars: 51 on GitHub
Forks: 13 on GitHub
See more repository details: repos.ecosyste.ms
Funding links: https://github.com/sponsors/icza
Last synced: 26 days ago

    Loading...
    Readme
    Loading...