warcrafty 2.1.2 copy "warcrafty: ^2.1.2" to clipboard
warcrafty: ^2.1.2 copied to clipboard

A high-performance pure Dart library for reading and writing World of Warcraft DBC files and MPQ archives.

2.1.2 #

Fixed #

  • 8-bit fields in five predefined schemas read back as signed int8 — the 8/16/64-bit integer type support (2.0.0) mapped WoWDBDefs' bare <8> tokens to signed int8 (B) in CharBaseInfo, CharStartOutfit, PowerDisplay, SpellChainEffects, and SpellItemEnchantmentCondition. WoWDBDefs has no signed 8-bit token (<s8> appears nowhere in its definitions; later builds spell the same fields <u8>), and AzerothCore reads these fields as uint8, so bare <8> is unsigned. Current data (values 0-5) parses identically either way, but uint8 is the correct physical format for 3.3.5a. The definition generator now maps all 8-bit fields to uint8 (b) and the five schemas were regenerated to match

2.1.1 #

Fixed #

  • Published 2.1.0 was not importable either — the .pubignore entry dbc/ matched lib/src/dbc/ at any depth (gitignore semantics), stripping the DBC implementation from the package and breaking every definition import (6038 errors). All .pubignore patterns are now anchored to the repo root (/dbc/, /tool/, /CLAUDE.md)
  • Added tool/check_publish.dart — parses the dart pub publish --dry-run file tree and fails if the public entry point or either subsystem directory is missing from the package, preventing silent packaging regressions. Run it before publishing

2.1.0 #

Added #

  • Pure Dart MPQ Archive Support
    • Read and write Blizzard MPQ archives (v1 ≤4 GB, v2 with 64-bit offsets and hi-block table) with no native library — StormLib FFI removed
    • Decompression for zlib, PKWARE DCL (implode), bzip2, and sparse, including arbitrary multi-method combinations (order mirrors StormLib's dcmp_table)
    • Writing via zlib, sparse, or stored sectors, with per-sector fallback to plain data when compression gains nothing
    • Read support for encrypted files, MPQ_FILE_KEY_V2 offset/size-adjusted keys, SINGLE_UNIT files, and hi-block tables
    • Optional per-sector Adler-32 verification (checkSectorCrc), matching StormLib's MPQ_OPEN_CHECK_SECTOR_CRC opt-in semantics — checksum blocks are unencrypted and stored after the last sector
    • MpqArchive CRUD (extract / extractTo / addFile / removeFile / compact), MpqArchive.create() / open() with deferred table flush on close()
    • compact() copies blocks directly (re-encrypting KEY_V2 keys for their new offsets) instead of recompressing; files missing from (listfile) are preserved under reversible (pseudo)\XXXXXXXX names and the listfile is rebuilt
    • Dedicated exception hierarchy: MpqOpenException, MpqFileNotFoundException, MpqReadException, MpqWriteException, MpqRemoveException, MpqCompactException, MpqExtractException, MpqCompressionException, MpqCorruptException

Fixed #

  • Published 2.0.0 was not importable — its warcrafty.dart exported src/dbc/* paths that did not exist in the package (the source-tree reorganization shipped half-finished); importing the package failed to compile. The DBC implementation moved to src/dbc/ and all exports resolve
  • MPQ compact could silently drop files — compaction iterated the (listfile) contents, so an archive with a missing or stripped listfile (common in patch packs) would have its unreferenced files deleted; it now copies from the block table keyed by the hash table and preserves unknown names as pseudo-names, refusing with MpqCompactException when a block is unrecognizable
  • Decompression had no output bound — a malicious archive could declare a 4 GB sparse length header or oversized bzip2/zlib output and trigger multi-gigabyte allocations; sparse, bzip2, and zlib now enforce the expected sector/file size as a hard cap (matching StormLib's DecompressSparse check), and a zero-length sparse header now decompresses to empty instead of erroring
  • close() could corrupt an existing archive on hash-table exhaustion — the (listfile) slot is now reserved up front; writes that would leave no room for it fail before touching the disk instead of after
  • KEY_V2 re-encryption during compact used the old data offset — keys are now recomputed for the destination position, keeping encrypted files readable after compaction
  • 32-bit sector offsets overflowed past 2 GB — sector offset tables now use Uint32List/List<int>, and per-sector offsets are checked for monotonicity and sector-size bounds
  • MpqArchive.open() now wraps filesystem failures in MpqOpenException instead of leaking FileSystemException; removeFile rejects internal files; compact failures are consistently reported as MpqCompactException
  • Removed the compressBzip2 write constant that always failed — writing supports zlib and sparse only

2.0.0 #

Added #

  • Explicit Format Dialects
    • Added DbcFormatDialect.warcrafty as the default extended typed dialect
    • Added DbcFormatDialect.azerothCore for AzerothCore/TrinityCore DBCfmt.h compatibility (x X s f i b d n l)
    • DbcLoader, DbcWriter, DbcSchema, and FieldOffsets now carry dialect information
    • AzerothCore dialect interprets i as uint32, while the default Warcrafty dialect keeps i as int32 and uses u for uint32

Changed #

  • Documentation now describes AzerothCore format strings as a supported dialect rather than claiming all Warcrafty extended format strings are directly valid in AzerothCore DBCfmt.h

Note: the published 2.0.0 package was not importable (broken export paths); use 2.1.0+.

1.0.2 #

Fixed #

  • Locstring Flag Field Type Mismatch
    • Corrected the format string for locstring fields: the 17th slot (locale flags) is now int32 (i) instead of string (s), matching the field definitions produced by createLocaleFieldsWithFlag (16 strings + 1 int32 flag)
    • This resolves a type mismatch between import and export: the flag field was previously read as a String on load (via toMap()) and expected as a String on write, corrupting non-zero locale flags and breaking round-trip write of records carrying int flag values
    • Record size and field offsets are unchanged (s and i are both 4 bytes); only the type dispatch at the flag position is corrected
    • Regenerated all 245 predefined schemas from the fixed generator

Changed #

  • DbcRecord.toMap() now returns an int for locale flag fields (previously a String parsed from the flag bitmask). Direct accessors getInt/getString are unaffected because they already read raw bytes by offset

Added #

  • Schema Consistency Test: asserts format[i] == fields[i].type.char across all 245 predefined schemas, preventing format/field drift regressions
  • Locstring Round-Trip Test: verifies locale flag fields write and read back as int

1.0.1 #

Fixed #

  • Exception Handling
    • Replace FormatException with DbcFormatException for consistent error handling across DBC operations
    • Improved error specificity for format-related issues

Refactored #

  • Code Cleanup
    • Removed redundant fieldOffsets getter from DbcLoader
    • Simplified loader.dart by eliminating unnecessary field offset delegation
    • Updated DbcIndex to directly access field offsets from loader's internal structure

1.0.0 #

Added #

  • Core DBC Operations

    • DbcLoader - Read DBC files with sync/async support
    • DbcWriter - Write DBC files with string deduplication
    • DbcRecord - Access record fields with type-safe methods
    • DbcIndexBuilder - Build ID-based indexes with O(1) lookup
  • Locale Field Utilities (locale_fields.dart)

    • createLocaleFields() - Generate field definitions for 16 languages
    • createLocaleFieldsWithFlag() - Generate locale fields with flag field
    • createUnusedFields() - Generate unused field definitions
    • createIntFields() - Generate consecutive integer field definitions
  • Type Validation in DbcWriter

    • Validate field types before writing (int, float, string, bool)
    • Range checking for byte fields (0-255)
    • Friendly error messages with record and field index
  • 100+ Predefined DBC Formats

    • Achievement, Character, Creature, Faction formats
    • Item, Map, Quest, Skill, Spell formats
    • Vehicle, GT tables, and more
  • String Block Handler

    • O(1) string lookup with prebuilt index
    • Efficient string deduplication on write

Changed #

  • Refactored DbcWriter to extract _collectStrings() and _validateFieldType() methods
1
likes
160
points
198
downloads

Documentation

API reference

Publisher

verified publisherfoxwow.xyz

Weekly Downloads

A high-performance pure Dart library for reading and writing World of Warcraft DBC files and MPQ archives.

Repository (GitHub)
View/report issues

License

MIT (license)

More

Packages that depend on warcrafty