Commit Graph
3 Commits
Author SHA1 Message Date
Brues 90a580d75d Add Game::Lua::PushBool helper, sweep condition ? 1 : 0 patterns
PushBool(L, bool) wraps lua_pushboolean and centralizes the bool→int
conversion the engine ABI requires. All ~50 sites doing
`PushBoolean(L, condition ? 1 : 0)` collapse to `PushBool(L, condition)`.
Non-PushBoolean callers passing bool→int (Fire_*, FireGetItemInfoReceived,
etc.) switched to `static_cast<int>(...)`. NameCache settings file output
relies on the default ostream bool→"0"/"1" formatting.

Literal `PushBoolean(L, 0)` / `PushBoolean(L, 1)` left alone — they're
already explicit int values.
2026-05-16 21:39:46 -05:00
Brues 9edaa6095b EncodingUtil: match retail API surface for compression and base64
CompressString/DecompressString take a CompressionMethod enum
(Deflate / Zlib / Gzip). The streaming zlib API (deflateInit2_,
inflateInit2_) handles all three formats via windowBits — the
one-shot compress2/uncompress only do Zlib. Decode auto-detects
Zlib vs Gzip when no method is passed.

EncodeBase64/DecodeBase64 take a Base64Variant (Standard / UrlSafe).
Standard pads with '='; UrlSafe omits padding per RFC 4648 §5.
Decode is strict when a variant is named, lenient (both alphabets,
optional padding) when omitted.

Enum.CompressionMethod and Enum.Base64Variant exposed as globals.
2026-05-16 00:07:07 -05:00
Brues 2cc6cfda86 EncodingUtil 2026-05-15 23:12:16 -05:00