@blamnetwork/blf 1.0.0-beta.5 → 1.0.0-beta.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunks/haloreach/v12065_11_08_24_1738_tu1actual/s_blf_chunk_map_variant.d.ts +6 -4
- package/dist/chunks/haloreach/v12065_11_08_24_1738_tu1actual/s_blf_chunk_map_variant.d.ts.map +1 -1
- package/dist/chunks/haloreach/v12065_11_08_24_1738_tu1actual/s_blf_chunk_map_variant.js +6 -4
- package/dist-cjs/chunks/haloreach/v12065_11_08_24_1738_tu1actual/s_blf_chunk_map_variant.js +6 -4
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { c } from "@craftycodie/cstruct";
|
|
1
|
+
import type { c as CStruct } from "@craftycodie/cstruct";
|
|
2
2
|
import { c_map_variant } from "../../../blam/haloreach/v12065_11_08_24_1738_tu1actual/saved_games/scenario_map_variant";
|
|
3
3
|
import { BLFChunkBase } from "../../../blf_chunk";
|
|
4
4
|
/** Reach map variant chunk packed bitstream storage (bytes). */
|
|
@@ -6,14 +6,16 @@ export declare const map_variant_storage_capacity = 28672;
|
|
|
6
6
|
/**
|
|
7
7
|
* Reach map variant chunk (`mvar` 31.1).
|
|
8
8
|
*
|
|
9
|
-
* Payload layout
|
|
9
|
+
* Payload layout: SHA1 hash + BE `packed_length` + 0x7000 packed storage + 4 zero pad.
|
|
10
|
+
* Hash covers only `packed_length` (4 BE bytes) + the packed bitstream bytes (not 0x7000
|
|
11
|
+
* storage slack or the 4-byte tail pad).
|
|
10
12
|
*/
|
|
11
13
|
export declare class s_blf_chunk_map_variant extends BLFChunkBase {
|
|
12
14
|
hash: Uint8Array;
|
|
13
15
|
packed_length: number;
|
|
14
16
|
map_variant: c_map_variant;
|
|
15
17
|
static create(map_variant: c_map_variant): s_blf_chunk_map_variant;
|
|
16
|
-
read_body(payload: Uint8Array, _endian:
|
|
17
|
-
write_body(_endian:
|
|
18
|
+
read_body(payload: Uint8Array, _endian: CStruct.Endian): void;
|
|
19
|
+
write_body(_endian: CStruct.Endian): Uint8Array;
|
|
18
20
|
}
|
|
19
21
|
//# sourceMappingURL=s_blf_chunk_map_variant.d.ts.map
|
package/dist/chunks/haloreach/v12065_11_08_24_1738_tu1actual/s_blf_chunk_map_variant.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"s_blf_chunk_map_variant.d.ts","sourceRoot":"","sources":["../../../../src/chunks/haloreach/v12065_11_08_24_1738_tu1actual/s_blf_chunk_map_variant.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"s_blf_chunk_map_variant.d.ts","sourceRoot":"","sources":["../../../../src/chunks/haloreach/v12065_11_08_24_1738_tu1actual/s_blf_chunk_map_variant.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,CAAC,IAAI,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAOzD,OAAO,EAAE,aAAa,EAAE,MAAM,yFAAyF,CAAC;AACxH,OAAO,EAAE,YAAY,EAAO,MAAM,oBAAoB,CAAC;AAGvD,gEAAgE;AAChE,eAAO,MAAM,4BAA4B,QAAS,CAAC;AAEnD;;;;;;GAMG;AACH,qBACa,uBAAwB,SAAQ,YAAY;IACvD,IAAI,EAAE,UAAU,CAAsB;IACtC,aAAa,SAAK;IAClB,WAAW,gBAAuB;IAElC,MAAM,CAAC,MAAM,CAAC,WAAW,EAAE,aAAa,GAAG,uBAAuB;IAMlE,SAAS,CAAC,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,OAAO,CAAC,MAAM,GAAG,IAAI;IAiC7D,UAAU,CAAC,OAAO,EAAE,OAAO,CAAC,MAAM,GAAG,UAAU;CAoChD"}
|
|
@@ -42,7 +42,9 @@ export const map_variant_storage_capacity = 0x7000;
|
|
|
42
42
|
/**
|
|
43
43
|
* Reach map variant chunk (`mvar` 31.1).
|
|
44
44
|
*
|
|
45
|
-
* Payload layout
|
|
45
|
+
* Payload layout: SHA1 hash + BE `packed_length` + 0x7000 packed storage + 4 zero pad.
|
|
46
|
+
* Hash covers only `packed_length` (4 BE bytes) + the packed bitstream bytes (not 0x7000
|
|
47
|
+
* storage slack or the 4-byte tail pad).
|
|
46
48
|
*/
|
|
47
49
|
let s_blf_chunk_map_variant = (() => {
|
|
48
50
|
let _classDecorators = [blf.chunk("mvar", 31.1)];
|
|
@@ -75,8 +77,8 @@ let s_blf_chunk_map_variant = (() => {
|
|
|
75
77
|
this.packed_length = new DataView(payload.buffer, payload.byteOffset + 20, 4).getUint32(0, false);
|
|
76
78
|
const packed_on_disk = payload.subarray(24);
|
|
77
79
|
const decode_length = this.packed_length > 0
|
|
78
|
-
? Math.min(this.packed_length, packed_on_disk.length)
|
|
79
|
-
: packed_on_disk.length;
|
|
80
|
+
? Math.min(this.packed_length, map_variant_storage_capacity, packed_on_disk.length)
|
|
81
|
+
: Math.min(map_variant_storage_capacity, packed_on_disk.length);
|
|
80
82
|
const packed_data = packed_on_disk.subarray(0, decode_length);
|
|
81
83
|
const bitstream = c_bitstream_reader.new(packed_data, e_bitstream_byte_order._bitstream_byte_order_big_endian);
|
|
82
84
|
bitstream.begin_reading();
|
|
@@ -101,7 +103,7 @@ let s_blf_chunk_map_variant = (() => {
|
|
|
101
103
|
hashable.set(length_bytes, 0);
|
|
102
104
|
hashable.set(packed_data, 4);
|
|
103
105
|
const hash = security_calculate_hash(hashable);
|
|
104
|
-
const payload = new Uint8Array(20 + 4 + map_variant_storage_capacity);
|
|
106
|
+
const payload = new Uint8Array(20 + 4 + map_variant_storage_capacity + 4);
|
|
105
107
|
payload.set(hash, 0);
|
|
106
108
|
payload.set(length_bytes, 20);
|
|
107
109
|
payload.set(packed_storage, 24);
|
|
@@ -45,7 +45,9 @@ exports.map_variant_storage_capacity = 0x7000;
|
|
|
45
45
|
/**
|
|
46
46
|
* Reach map variant chunk (`mvar` 31.1).
|
|
47
47
|
*
|
|
48
|
-
* Payload layout
|
|
48
|
+
* Payload layout: SHA1 hash + BE `packed_length` + 0x7000 packed storage + 4 zero pad.
|
|
49
|
+
* Hash covers only `packed_length` (4 BE bytes) + the packed bitstream bytes (not 0x7000
|
|
50
|
+
* storage slack or the 4-byte tail pad).
|
|
49
51
|
*/
|
|
50
52
|
let s_blf_chunk_map_variant = (() => {
|
|
51
53
|
let _classDecorators = [blf_chunk_1.blf.chunk("mvar", 31.1)];
|
|
@@ -78,8 +80,8 @@ let s_blf_chunk_map_variant = (() => {
|
|
|
78
80
|
this.packed_length = new DataView(payload.buffer, payload.byteOffset + 20, 4).getUint32(0, false);
|
|
79
81
|
const packed_on_disk = payload.subarray(24);
|
|
80
82
|
const decode_length = this.packed_length > 0
|
|
81
|
-
? Math.min(this.packed_length, packed_on_disk.length)
|
|
82
|
-
: packed_on_disk.length;
|
|
83
|
+
? Math.min(this.packed_length, exports.map_variant_storage_capacity, packed_on_disk.length)
|
|
84
|
+
: Math.min(exports.map_variant_storage_capacity, packed_on_disk.length);
|
|
83
85
|
const packed_data = packed_on_disk.subarray(0, decode_length);
|
|
84
86
|
const bitstream = bitstream_1.c_bitstream_reader.new(packed_data, bitstream_1.e_bitstream_byte_order._bitstream_byte_order_big_endian);
|
|
85
87
|
bitstream.begin_reading();
|
|
@@ -104,7 +106,7 @@ let s_blf_chunk_map_variant = (() => {
|
|
|
104
106
|
hashable.set(length_bytes, 0);
|
|
105
107
|
hashable.set(packed_data, 4);
|
|
106
108
|
const hash = (0, security_functions_1.security_calculate_hash)(hashable);
|
|
107
|
-
const payload = new Uint8Array(20 + 4 + exports.map_variant_storage_capacity);
|
|
109
|
+
const payload = new Uint8Array(20 + 4 + exports.map_variant_storage_capacity + 4);
|
|
108
110
|
payload.set(hash, 0);
|
|
109
111
|
payload.set(length_bytes, 20);
|
|
110
112
|
payload.set(packed_storage, 24);
|