@rhyster/wow-casc-dbc 2.6.18 → 2.7.0
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/adb.d.ts +17 -0
- package/dist/adb.d.ts.map +1 -0
- package/dist/blte.d.ts +25 -0
- package/dist/blte.d.ts.map +1 -0
- package/dist/client.d.ts +84 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/dbd.d.ts +26 -0
- package/dist/dbd.d.ts.map +1 -0
- package/dist/fetcher.d.ts +21 -0
- package/dist/fetcher.d.ts.map +1 -0
- package/dist/index.cjs +72 -107
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.ts +9 -261
- package/dist/index.d.ts.map +1 -0
- package/dist/index.mjs +72 -107
- package/dist/index.mjs.map +1 -0
- package/dist/jenkins96.d.ts +3 -0
- package/dist/jenkins96.d.ts.map +1 -0
- package/dist/parsers/archiveIndex.d.ts +9 -0
- package/dist/parsers/archiveIndex.d.ts.map +1 -0
- package/dist/parsers/config.d.ts +40 -0
- package/dist/parsers/config.d.ts.map +1 -0
- package/dist/parsers/encodingFile.d.ts +11 -0
- package/dist/parsers/encodingFile.d.ts.map +1 -0
- package/dist/parsers/productConfig.d.ts +21 -0
- package/dist/parsers/productConfig.d.ts.map +1 -0
- package/dist/parsers/rootFile.d.ts +45 -0
- package/dist/parsers/rootFile.d.ts.map +1 -0
- package/dist/salsa20.d.ts +14 -0
- package/dist/salsa20.d.ts.map +1 -0
- package/dist/store.d.ts +9 -0
- package/dist/store.d.ts.map +1 -0
- package/dist/test/salsa20.test.d.ts +2 -0
- package/dist/test/salsa20.test.d.ts.map +1 -0
- package/dist/utils.d.ts +3 -0
- package/dist/utils.d.ts.map +1 -0
- package/dist/wdc.d.ts +104 -0
- package/dist/wdc.d.ts.map +1 -0
- package/package.json +5 -4
- package/src/adb.ts +70 -0
- package/src/blte.ts +220 -0
- package/src/client.ts +411 -0
- package/src/dbd.ts +427 -0
- package/src/fetcher.ts +223 -0
- package/src/index.ts +44 -0
- package/src/jenkins96.ts +75 -0
- package/src/parsers/archiveIndex.ts +119 -0
- package/src/parsers/config.ts +75 -0
- package/src/parsers/encodingFile.ts +159 -0
- package/src/parsers/productConfig.ts +57 -0
- package/src/parsers/rootFile.ts +172 -0
- package/src/salsa20.ts +143 -0
- package/src/store.ts +37 -0
- package/src/test/salsa20.test.ts +522 -0
- package/src/utils.ts +77 -0
- package/src/wdc.ts +788 -0
package/dist/index.d.ts
CHANGED
|
@@ -1,261 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
}
|
|
11
|
-
declare class ADBReader {
|
|
12
|
-
build: number;
|
|
13
|
-
entries: HotfixEntry[];
|
|
14
|
-
tableEntries: Map<number, HotfixEntry[]>;
|
|
15
|
-
constructor(buffer: Buffer);
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
interface MissingKeyBlock {
|
|
19
|
-
offset: number;
|
|
20
|
-
size: number;
|
|
21
|
-
blockIndex: number;
|
|
22
|
-
keyName: string;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
interface ArchiveIndex {
|
|
26
|
-
key: string;
|
|
27
|
-
size: number;
|
|
28
|
-
offset: number;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
interface EncodingData {
|
|
32
|
-
eSpec: string[];
|
|
33
|
-
cKey2FileSize: Map<string, number>;
|
|
34
|
-
cKey2EKey: Map<string, string | string[]>;
|
|
35
|
-
eKey2ESpecIndex: Map<string, number>;
|
|
36
|
-
eKey2FileSize: Map<string, number>;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
interface Version {
|
|
40
|
-
Region: string;
|
|
41
|
-
BuildConfig: string;
|
|
42
|
-
CDNConfig: string;
|
|
43
|
-
KeyRing: string;
|
|
44
|
-
BuildId: string;
|
|
45
|
-
VersionsName: string;
|
|
46
|
-
ProductConfig: string;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
interface FileInfo {
|
|
50
|
-
cKey: string;
|
|
51
|
-
contentFlags: number;
|
|
52
|
-
localeFlags: number;
|
|
53
|
-
}
|
|
54
|
-
interface RootData {
|
|
55
|
-
fileDataID2CKey: Map<number, FileInfo[]>;
|
|
56
|
-
nameHash2FileDataID: Map<string, number>;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
interface ClientPreloadData {
|
|
60
|
-
prefixes: string[];
|
|
61
|
-
archives: Map<string, ArchiveIndex>;
|
|
62
|
-
encoding: EncodingData;
|
|
63
|
-
rootFile: RootData;
|
|
64
|
-
}
|
|
65
|
-
interface FileFetchResultFull {
|
|
66
|
-
type: 'full';
|
|
67
|
-
buffer: Buffer;
|
|
68
|
-
blocks: undefined;
|
|
69
|
-
}
|
|
70
|
-
interface FileFetchResultPartial {
|
|
71
|
-
type: 'partial';
|
|
72
|
-
buffer: Buffer;
|
|
73
|
-
blocks: MissingKeyBlock[];
|
|
74
|
-
}
|
|
75
|
-
type FileFetchResult = FileFetchResultFull | FileFetchResultPartial;
|
|
76
|
-
declare enum LogLevel {
|
|
77
|
-
error = 0,
|
|
78
|
-
warn = 1,
|
|
79
|
-
info = 2,
|
|
80
|
-
debug = 3
|
|
81
|
-
}
|
|
82
|
-
declare class CASCClient {
|
|
83
|
-
readonly region: string;
|
|
84
|
-
readonly product: string;
|
|
85
|
-
readonly version: Version;
|
|
86
|
-
readonly name2FileDataID: Map<string, number>;
|
|
87
|
-
readonly keys: Map<string, Uint8Array<ArrayBufferLike>>;
|
|
88
|
-
preload?: ClientPreloadData;
|
|
89
|
-
static getProductVersion(region: string, product: string): Promise<Version | undefined>;
|
|
90
|
-
static LocaleFlags: {
|
|
91
|
-
readonly enUS: 2;
|
|
92
|
-
readonly koKR: 4;
|
|
93
|
-
readonly frFR: 16;
|
|
94
|
-
readonly deDE: 32;
|
|
95
|
-
readonly zhCN: 64;
|
|
96
|
-
readonly esES: 128;
|
|
97
|
-
readonly zhTW: 256;
|
|
98
|
-
readonly enGB: 512;
|
|
99
|
-
readonly esMX: 4096;
|
|
100
|
-
readonly ruRU: 8192;
|
|
101
|
-
readonly ptBR: 16384;
|
|
102
|
-
readonly itIT: 32768;
|
|
103
|
-
readonly ptPT: 65536;
|
|
104
|
-
};
|
|
105
|
-
static ContentFlags: {
|
|
106
|
-
readonly Install: 4;
|
|
107
|
-
readonly LoadOnWindows: 8;
|
|
108
|
-
readonly LoadOnMacOS: 16;
|
|
109
|
-
readonly x86_32: 32;
|
|
110
|
-
readonly x86_64: 64;
|
|
111
|
-
readonly LowViolence: 128;
|
|
112
|
-
readonly DoNotLoad: 256;
|
|
113
|
-
readonly UpdatePlugin: 2048;
|
|
114
|
-
readonly ARM64: 32768;
|
|
115
|
-
readonly Encrypted: 134217728;
|
|
116
|
-
readonly NoNameHash: 268435456;
|
|
117
|
-
readonly UncommonResolution: 536870912;
|
|
118
|
-
readonly Bundle: 1073741824;
|
|
119
|
-
readonly NoCompression: 2147483648;
|
|
120
|
-
};
|
|
121
|
-
static LogLevel: typeof LogLevel;
|
|
122
|
-
logLevel: LogLevel;
|
|
123
|
-
constructor(region: string, product: string, version: Version, logLevel?: LogLevel);
|
|
124
|
-
private log;
|
|
125
|
-
init(): Promise<void>;
|
|
126
|
-
loadRemoteListFile(): Promise<void>;
|
|
127
|
-
loadRemoteTACTKeys(): Promise<void>;
|
|
128
|
-
loadTACTKeys(): Promise<void>;
|
|
129
|
-
loadBroadcastTACTKeys(adb: ADBReader): void;
|
|
130
|
-
getFileDataIDByName(name: string): number | undefined;
|
|
131
|
-
getContentKeysByFileDataID(fileDataID: number): FileInfo[] | undefined;
|
|
132
|
-
getFileByContentKey(cKey: string, allowMissingKey?: false): Promise<FileFetchResultFull>;
|
|
133
|
-
getFileByContentKey(cKey: string, allowMissingKey: true): Promise<FileFetchResult>;
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
interface FieldStructure {
|
|
137
|
-
size: number;
|
|
138
|
-
position: number;
|
|
139
|
-
}
|
|
140
|
-
interface FieldStorageInfoCompressionNone {
|
|
141
|
-
fieldOffsetBits: number;
|
|
142
|
-
fieldSizeBits: number;
|
|
143
|
-
additionalDataSize: number;
|
|
144
|
-
storageType: 'none';
|
|
145
|
-
}
|
|
146
|
-
interface FieldStorageInfoCompressionBitpacked {
|
|
147
|
-
fieldOffsetBits: number;
|
|
148
|
-
fieldSizeBits: number;
|
|
149
|
-
additionalDataSize: number;
|
|
150
|
-
storageType: 'bitpacked';
|
|
151
|
-
bitpackingOffsetBits: number;
|
|
152
|
-
bitpackingSizeBits: number;
|
|
153
|
-
flags: number;
|
|
154
|
-
}
|
|
155
|
-
interface FieldStorageInfoCompressionCommonData {
|
|
156
|
-
fieldOffsetBits: number;
|
|
157
|
-
fieldSizeBits: number;
|
|
158
|
-
additionalDataSize: number;
|
|
159
|
-
storageType: 'commonData';
|
|
160
|
-
defaultValue: number;
|
|
161
|
-
}
|
|
162
|
-
interface FieldStorageInfoCompressionBitpackedIndexed {
|
|
163
|
-
fieldOffsetBits: number;
|
|
164
|
-
fieldSizeBits: number;
|
|
165
|
-
additionalDataSize: number;
|
|
166
|
-
storageType: 'bitpackedIndexed';
|
|
167
|
-
bitpackingOffsetBits: number;
|
|
168
|
-
bitpackingSizeBits: number;
|
|
169
|
-
}
|
|
170
|
-
interface FieldStorageInfoCompressionBitpackedIndexedArray {
|
|
171
|
-
fieldOffsetBits: number;
|
|
172
|
-
fieldSizeBits: number;
|
|
173
|
-
additionalDataSize: number;
|
|
174
|
-
storageType: 'bitpackedIndexedArray';
|
|
175
|
-
bitpackingOffsetBits: number;
|
|
176
|
-
bitpackingSizeBits: number;
|
|
177
|
-
arrayCount: number;
|
|
178
|
-
}
|
|
179
|
-
interface FieldStorageInfoCompressionBitpackedSigned {
|
|
180
|
-
fieldOffsetBits: number;
|
|
181
|
-
fieldSizeBits: number;
|
|
182
|
-
additionalDataSize: number;
|
|
183
|
-
storageType: 'bitpackedSigned';
|
|
184
|
-
bitpackingOffsetBits: number;
|
|
185
|
-
bitpackingSizeBits: number;
|
|
186
|
-
flags: number;
|
|
187
|
-
}
|
|
188
|
-
type FieldStorageInfo = FieldStorageInfoCompressionNone | FieldStorageInfoCompressionBitpacked | FieldStorageInfoCompressionCommonData | FieldStorageInfoCompressionBitpackedIndexed | FieldStorageInfoCompressionBitpackedIndexedArray | FieldStorageInfoCompressionBitpackedSigned;
|
|
189
|
-
interface ParsedFieldNone {
|
|
190
|
-
type: 'none';
|
|
191
|
-
data: number | bigint;
|
|
192
|
-
string?: string;
|
|
193
|
-
}
|
|
194
|
-
interface ParsedFieldCommonData {
|
|
195
|
-
type: 'commonData';
|
|
196
|
-
data: number;
|
|
197
|
-
}
|
|
198
|
-
interface ParsedFieldBitpacked {
|
|
199
|
-
type: 'bitpacked';
|
|
200
|
-
data: number;
|
|
201
|
-
}
|
|
202
|
-
interface ParsedFieldBitpackedArray {
|
|
203
|
-
type: 'bitpackedArray';
|
|
204
|
-
data: number[];
|
|
205
|
-
}
|
|
206
|
-
type ParsedField = ParsedFieldNone | ParsedFieldCommonData | ParsedFieldBitpacked | ParsedFieldBitpackedArray;
|
|
207
|
-
interface SparseRow {
|
|
208
|
-
type: 'sparse';
|
|
209
|
-
data: Buffer;
|
|
210
|
-
}
|
|
211
|
-
interface HotfixModify {
|
|
212
|
-
type: 'modify';
|
|
213
|
-
data: Buffer;
|
|
214
|
-
}
|
|
215
|
-
interface HotfixDelete {
|
|
216
|
-
type: 'delete';
|
|
217
|
-
}
|
|
218
|
-
type Hotfix = HotfixModify | HotfixDelete;
|
|
219
|
-
declare class WDCReader {
|
|
220
|
-
readonly tableHash: number;
|
|
221
|
-
readonly layoutHash: number;
|
|
222
|
-
readonly locale: number;
|
|
223
|
-
readonly isNormal: boolean;
|
|
224
|
-
readonly hasRelationshipData: boolean;
|
|
225
|
-
readonly fields: FieldStructure[];
|
|
226
|
-
readonly fieldsInfo: FieldStorageInfo[];
|
|
227
|
-
readonly rows: Map<number, SparseRow | ParsedField[]>;
|
|
228
|
-
readonly relationships: Map<number, number>;
|
|
229
|
-
readonly copyTable: Map<number, number>;
|
|
230
|
-
readonly hotfixes: Map<number, Hotfix>;
|
|
231
|
-
constructor(buffer: Buffer, blocks?: MissingKeyBlock[], adb?: ADBReader);
|
|
232
|
-
getAllIDs(): number[];
|
|
233
|
-
getRowData(id: number): ParsedField[] | SparseRow | undefined;
|
|
234
|
-
getRowRelationship(id: number): number | undefined;
|
|
235
|
-
}
|
|
236
|
-
|
|
237
|
-
interface Column {
|
|
238
|
-
name: string;
|
|
239
|
-
type: string;
|
|
240
|
-
isID: boolean;
|
|
241
|
-
isInline: boolean;
|
|
242
|
-
isRelation: boolean;
|
|
243
|
-
isSigned: boolean;
|
|
244
|
-
size?: number;
|
|
245
|
-
arraySize?: number;
|
|
246
|
-
}
|
|
247
|
-
type BasicColumnData = number | bigint | string | undefined;
|
|
248
|
-
type ColumnData = BasicColumnData | BasicColumnData[];
|
|
249
|
-
declare class DBDParser {
|
|
250
|
-
readonly wdc: WDCReader;
|
|
251
|
-
readonly definitions: Map<string, string>;
|
|
252
|
-
columns: Column[];
|
|
253
|
-
private cache;
|
|
254
|
-
private constructor();
|
|
255
|
-
private init;
|
|
256
|
-
static parse(wdc: WDCReader): Promise<DBDParser>;
|
|
257
|
-
getAllIDs(): number[];
|
|
258
|
-
getRowData(id: number): Record<string, ColumnData> | undefined;
|
|
259
|
-
}
|
|
260
|
-
|
|
261
|
-
export { ADBReader, type ArchiveIndex, type BasicColumnData, CASCClient, type ClientPreloadData, type Column, type ColumnData, DBDParser, type EncodingData, type FieldStorageInfo, type FieldStorageInfoCompressionBitpacked, type FieldStorageInfoCompressionBitpackedIndexed, type FieldStorageInfoCompressionBitpackedIndexedArray, type FieldStorageInfoCompressionBitpackedSigned, type FieldStorageInfoCompressionCommonData, type FieldStorageInfoCompressionNone, type FieldStructure, type FileFetchResult, type FileFetchResultFull, type FileFetchResultPartial, type FileInfo, type Hotfix, type HotfixDelete, type HotfixEntry, type HotfixModify, type MissingKeyBlock, type ParsedField, type ParsedFieldBitpacked, type ParsedFieldBitpackedArray, type ParsedFieldCommonData, type ParsedFieldNone, type RootData, type SparseRow, type Version, WDCReader };
|
|
1
|
+
export { default as ADBReader } from './adb.ts';
|
|
2
|
+
export { default as CASCClient } from './client.ts';
|
|
3
|
+
export { default as DBDParser } from './dbd.ts';
|
|
4
|
+
export { default as WDCReader } from './wdc.ts';
|
|
5
|
+
export type { HotfixEntry } from './adb.ts';
|
|
6
|
+
export type { Version, ClientPreloadData, ArchiveIndex, EncodingData, RootData, FileInfo, FileFetchResultFull, FileFetchResultPartial, FileFetchResult, MissingKeyBlock, } from './client.ts';
|
|
7
|
+
export type { Column, ColumnData, BasicColumnData, } from './dbd.ts';
|
|
8
|
+
export type { FieldStructure, FieldStorageInfo, FieldStorageInfoCompressionNone, FieldStorageInfoCompressionBitpacked, FieldStorageInfoCompressionCommonData, FieldStorageInfoCompressionBitpackedIndexed, FieldStorageInfoCompressionBitpackedIndexedArray, FieldStorageInfoCompressionBitpackedSigned, ParsedField, ParsedFieldNone, ParsedFieldCommonData, ParsedFieldBitpacked, ParsedFieldBitpackedArray, SparseRow, Hotfix, HotfixModify, HotfixDelete, } from './wdc.ts';
|
|
9
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,UAAU,CAAC;AAChD,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,aAAa,CAAC;AACpD,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,UAAU,CAAC;AAChD,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,UAAU,CAAC;AAEhD,YAAY,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAC5C,YAAY,EACR,OAAO,EACP,iBAAiB,EACjB,YAAY,EACZ,YAAY,EACZ,QAAQ,EACR,QAAQ,EACR,mBAAmB,EACnB,sBAAsB,EACtB,eAAe,EACf,eAAe,GAClB,MAAM,aAAa,CAAC;AACrB,YAAY,EACR,MAAM,EACN,UAAU,EACV,eAAe,GAClB,MAAM,UAAU,CAAC;AAClB,YAAY,EACR,cAAc,EACd,gBAAgB,EAChB,+BAA+B,EAC/B,oCAAoC,EACpC,qCAAqC,EACrC,2CAA2C,EAC3C,gDAAgD,EAChD,0CAA0C,EAC1C,WAAW,EACX,eAAe,EACf,qBAAqB,EACrB,oBAAoB,EACpB,yBAAyB,EACzB,SAAS,EACT,MAAM,EACN,YAAY,EACZ,YAAY,GACf,MAAM,UAAU,CAAC"}
|
package/dist/index.mjs
CHANGED
|
@@ -7,18 +7,12 @@ import fs from 'node:fs/promises';
|
|
|
7
7
|
import http from 'node:http';
|
|
8
8
|
import path from 'node:path';
|
|
9
9
|
|
|
10
|
-
var __defProp$6 = Object.defineProperty;
|
|
11
|
-
var __defNormalProp$6 = (obj, key, value) => key in obj ? __defProp$6(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
12
|
-
var __publicField$6 = (obj, key, value) => {
|
|
13
|
-
__defNormalProp$6(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
14
|
-
return value;
|
|
15
|
-
};
|
|
16
10
|
const ADB_MAGIC = 1481004104;
|
|
17
11
|
class ADBReader {
|
|
12
|
+
build;
|
|
13
|
+
entries = [];
|
|
14
|
+
tableEntries = /* @__PURE__ */ new Map();
|
|
18
15
|
constructor(buffer) {
|
|
19
|
-
__publicField$6(this, "build");
|
|
20
|
-
__publicField$6(this, "entries", []);
|
|
21
|
-
__publicField$6(this, "tableEntries", /* @__PURE__ */ new Map());
|
|
22
16
|
const magic = buffer.readUInt32BE(0);
|
|
23
17
|
assert(magic === ADB_MAGIC, `[ADB]: Invalid magic: ${magic.toString(16).padStart(8, "0")}`);
|
|
24
18
|
const version = buffer.readUInt32LE(4);
|
|
@@ -58,21 +52,15 @@ class ADBReader {
|
|
|
58
52
|
}
|
|
59
53
|
}
|
|
60
54
|
|
|
61
|
-
var __defProp$5 = Object.defineProperty;
|
|
62
|
-
var __defNormalProp$5 = (obj, key, value) => key in obj ? __defProp$5(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
63
|
-
var __publicField$5 = (obj, key, value) => {
|
|
64
|
-
__defNormalProp$5(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
65
|
-
return value;
|
|
66
|
-
};
|
|
67
55
|
class Salsa20 {
|
|
56
|
+
fixed;
|
|
57
|
+
key;
|
|
58
|
+
nonce;
|
|
59
|
+
counter = new Uint32Array([0, 0]);
|
|
60
|
+
state = new Uint32Array(16);
|
|
61
|
+
block = new Uint8Array(64);
|
|
62
|
+
position = 0;
|
|
68
63
|
constructor(key, nonce) {
|
|
69
|
-
__publicField$5(this, "fixed");
|
|
70
|
-
__publicField$5(this, "key");
|
|
71
|
-
__publicField$5(this, "nonce");
|
|
72
|
-
__publicField$5(this, "counter", new Uint32Array([0, 0]));
|
|
73
|
-
__publicField$5(this, "state", new Uint32Array(16));
|
|
74
|
-
__publicField$5(this, "block", new Uint8Array(64));
|
|
75
|
-
__publicField$5(this, "position", 0);
|
|
76
64
|
assert(key.length === 32 || key.length === 16, "Salsa20 requires 128-bit or 256-bit key");
|
|
77
65
|
assert(nonce.length === 8, "Salsa20 requires 64-bit nonce");
|
|
78
66
|
this.key = new Uint32Array(8);
|
|
@@ -176,23 +164,17 @@ class Salsa20 {
|
|
|
176
164
|
}
|
|
177
165
|
}
|
|
178
166
|
|
|
179
|
-
var __defProp$4 = Object.defineProperty;
|
|
180
|
-
var __defNormalProp$4 = (obj, key, value) => key in obj ? __defProp$4(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
181
|
-
var __publicField$4 = (obj, key, value) => {
|
|
182
|
-
__defNormalProp$4(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
183
|
-
return value;
|
|
184
|
-
};
|
|
185
167
|
const BLTE_MAGIC = 1112298565;
|
|
186
168
|
const ENC_TYPE_SALSA20 = 83;
|
|
187
169
|
const EMPTY_HASH = "00000000000000000000000000000000";
|
|
188
170
|
class BLTEReader {
|
|
171
|
+
buffer;
|
|
172
|
+
blte;
|
|
173
|
+
blocks = [];
|
|
174
|
+
keys;
|
|
175
|
+
processedBlock = 0;
|
|
176
|
+
processedOffset = 0;
|
|
189
177
|
constructor(buffer, eKey, keys = /* @__PURE__ */ new Map()) {
|
|
190
|
-
__publicField$4(this, "buffer");
|
|
191
|
-
__publicField$4(this, "blte");
|
|
192
|
-
__publicField$4(this, "blocks", []);
|
|
193
|
-
__publicField$4(this, "keys");
|
|
194
|
-
__publicField$4(this, "processedBlock", 0);
|
|
195
|
-
__publicField$4(this, "processedOffset", 0);
|
|
196
178
|
this.blte = buffer;
|
|
197
179
|
this.buffer = Buffer.alloc(0);
|
|
198
180
|
this.keys = keys;
|
|
@@ -332,17 +314,11 @@ class BLTEReader {
|
|
|
332
314
|
}
|
|
333
315
|
}
|
|
334
316
|
|
|
335
|
-
var __defProp$3 = Object.defineProperty;
|
|
336
|
-
var __defNormalProp$3 = (obj, key, value) => key in obj ? __defProp$3(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
337
|
-
var __publicField$3 = (obj, key, value) => {
|
|
338
|
-
__defNormalProp$3(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
339
|
-
return value;
|
|
340
|
-
};
|
|
341
317
|
class Store {
|
|
318
|
+
data;
|
|
319
|
+
dataFile;
|
|
320
|
+
promise;
|
|
342
321
|
constructor(dataFile) {
|
|
343
|
-
__publicField$3(this, "data");
|
|
344
|
-
__publicField$3(this, "dataFile");
|
|
345
|
-
__publicField$3(this, "promise");
|
|
346
322
|
this.dataFile = dataFile;
|
|
347
323
|
this.data = {};
|
|
348
324
|
this.promise = new Promise((resolve) => {
|
|
@@ -433,7 +409,7 @@ const downloadFile = (prefixes, type, key, {
|
|
|
433
409
|
return urls.reduce(
|
|
434
410
|
(prev, url, index) => prev.catch((err) => {
|
|
435
411
|
if (showAttemptFail === true && index > 0 && err instanceof Error) {
|
|
436
|
-
console.warn(`${( new Date()).toISOString()} [WARN]:`, err.message);
|
|
412
|
+
console.warn(`${(/* @__PURE__ */ new Date()).toISOString()} [WARN]:`, err.message);
|
|
437
413
|
}
|
|
438
414
|
return requestData(url, { partialOffset, partialLength, showProgress });
|
|
439
415
|
}),
|
|
@@ -549,26 +525,37 @@ const hashlittle2 = (key, pc = 0, pb = 0) => {
|
|
|
549
525
|
switch (length - offset) {
|
|
550
526
|
case 12:
|
|
551
527
|
c += key.charCodeAt(offset + 11) << 24;
|
|
528
|
+
// falls through
|
|
552
529
|
case 11:
|
|
553
530
|
c += key.charCodeAt(offset + 10) << 16;
|
|
531
|
+
// falls through
|
|
554
532
|
case 10:
|
|
555
533
|
c += key.charCodeAt(offset + 9) << 8;
|
|
534
|
+
// falls through
|
|
556
535
|
case 9:
|
|
557
536
|
c += key.charCodeAt(offset + 8);
|
|
537
|
+
// falls through
|
|
558
538
|
case 8:
|
|
559
539
|
b += key.charCodeAt(offset + 7) << 24;
|
|
540
|
+
// falls through
|
|
560
541
|
case 7:
|
|
561
542
|
b += key.charCodeAt(offset + 6) << 16;
|
|
543
|
+
// falls through
|
|
562
544
|
case 6:
|
|
563
545
|
b += key.charCodeAt(offset + 5) << 8;
|
|
546
|
+
// falls through
|
|
564
547
|
case 5:
|
|
565
548
|
b += key.charCodeAt(offset + 4);
|
|
549
|
+
// falls through
|
|
566
550
|
case 4:
|
|
567
551
|
a += key.charCodeAt(offset + 3) << 24;
|
|
552
|
+
// falls through
|
|
568
553
|
case 3:
|
|
569
554
|
a += key.charCodeAt(offset + 2) << 16;
|
|
555
|
+
// falls through
|
|
570
556
|
case 2:
|
|
571
557
|
a += key.charCodeAt(offset + 1) << 8;
|
|
558
|
+
// falls through
|
|
572
559
|
case 1:
|
|
573
560
|
a += key.charCodeAt(offset + 0);
|
|
574
561
|
}
|
|
@@ -962,18 +949,14 @@ const JEDEC = [
|
|
|
962
949
|
"YB"
|
|
963
950
|
];
|
|
964
951
|
const formatFileSize = (input) => {
|
|
965
|
-
if (Number.isNaN(input))
|
|
966
|
-
return "";
|
|
952
|
+
if (Number.isNaN(input)) return "";
|
|
967
953
|
let size = Number(input);
|
|
968
954
|
const isNegative = size < 0;
|
|
969
955
|
const result = [];
|
|
970
|
-
if (isNegative)
|
|
971
|
-
size = -size;
|
|
956
|
+
if (isNegative) size = -size;
|
|
972
957
|
let exponent = Math.floor(Math.log(size) / Math.log(1024));
|
|
973
|
-
if (exponent < 0)
|
|
974
|
-
|
|
975
|
-
if (exponent > 8)
|
|
976
|
-
exponent = 8;
|
|
958
|
+
if (exponent < 0) exponent = 0;
|
|
959
|
+
if (exponent > 8) exponent = 8;
|
|
977
960
|
if (size === 0) {
|
|
978
961
|
result[0] = 0;
|
|
979
962
|
result[1] = JEDEC[exponent];
|
|
@@ -986,8 +969,7 @@ const formatFileSize = (input) => {
|
|
|
986
969
|
}
|
|
987
970
|
result[1] = JEDEC[exponent];
|
|
988
971
|
}
|
|
989
|
-
if (isNegative)
|
|
990
|
-
result[0] = -result[0];
|
|
972
|
+
if (isNegative) result[0] = -result[0];
|
|
991
973
|
return result.join(" ");
|
|
992
974
|
};
|
|
993
975
|
const resolveCDNHost = async (hosts, path) => {
|
|
@@ -1006,12 +988,6 @@ const resolveCDNHost = async (hosts, path) => {
|
|
|
1006
988
|
return resolved.map((result) => `http://${result.host}/${path}`);
|
|
1007
989
|
};
|
|
1008
990
|
|
|
1009
|
-
var __defProp$2 = Object.defineProperty;
|
|
1010
|
-
var __defNormalProp$2 = (obj, key, value) => key in obj ? __defProp$2(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
1011
|
-
var __publicField$2 = (obj, key, value) => {
|
|
1012
|
-
__defNormalProp$2(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
1013
|
-
return value;
|
|
1014
|
-
};
|
|
1015
991
|
const WDC5_MAGIC = 1464091445;
|
|
1016
992
|
const readBitpackedValue = (buffer, fieldOffsetBits, fieldSizeBits, signed = false) => {
|
|
1017
993
|
const offsetBytes = fieldOffsetBits >>> 3;
|
|
@@ -1031,18 +1007,18 @@ const readBitpackedValue = (buffer, fieldOffsetBits, fieldSizeBits, signed = fal
|
|
|
1031
1007
|
return signed ? BigInt.asIntN(fieldSizeBits, value >> BigInt(bitOffset)) : BigInt.asUintN(fieldSizeBits, value >> BigInt(bitOffset));
|
|
1032
1008
|
};
|
|
1033
1009
|
class WDCReader {
|
|
1010
|
+
tableHash;
|
|
1011
|
+
layoutHash;
|
|
1012
|
+
locale;
|
|
1013
|
+
isNormal;
|
|
1014
|
+
hasRelationshipData;
|
|
1015
|
+
fields;
|
|
1016
|
+
fieldsInfo;
|
|
1017
|
+
rows = /* @__PURE__ */ new Map();
|
|
1018
|
+
relationships = /* @__PURE__ */ new Map();
|
|
1019
|
+
copyTable = /* @__PURE__ */ new Map();
|
|
1020
|
+
hotfixes = /* @__PURE__ */ new Map();
|
|
1034
1021
|
constructor(buffer, blocks = [], adb) {
|
|
1035
|
-
__publicField$2(this, "tableHash");
|
|
1036
|
-
__publicField$2(this, "layoutHash");
|
|
1037
|
-
__publicField$2(this, "locale");
|
|
1038
|
-
__publicField$2(this, "isNormal");
|
|
1039
|
-
__publicField$2(this, "hasRelationshipData");
|
|
1040
|
-
__publicField$2(this, "fields");
|
|
1041
|
-
__publicField$2(this, "fieldsInfo");
|
|
1042
|
-
__publicField$2(this, "rows", /* @__PURE__ */ new Map());
|
|
1043
|
-
__publicField$2(this, "relationships", /* @__PURE__ */ new Map());
|
|
1044
|
-
__publicField$2(this, "copyTable", /* @__PURE__ */ new Map());
|
|
1045
|
-
__publicField$2(this, "hotfixes", /* @__PURE__ */ new Map());
|
|
1046
1022
|
const magic = buffer.readUInt32BE(0);
|
|
1047
1023
|
const fieldCount = buffer.readUInt32LE(140);
|
|
1048
1024
|
const recordSize = buffer.readUInt32LE(144);
|
|
@@ -1499,12 +1475,6 @@ class WDCReader {
|
|
|
1499
1475
|
}
|
|
1500
1476
|
}
|
|
1501
1477
|
|
|
1502
|
-
var __defProp$1 = Object.defineProperty;
|
|
1503
|
-
var __defNormalProp$1 = (obj, key, value) => key in obj ? __defProp$1(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
1504
|
-
var __publicField$1 = (obj, key, value) => {
|
|
1505
|
-
__defNormalProp$1(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
1506
|
-
return value;
|
|
1507
|
-
};
|
|
1508
1478
|
var LogLevel = /* @__PURE__ */ ((LogLevel2) => {
|
|
1509
1479
|
LogLevel2[LogLevel2["error"] = 0] = "error";
|
|
1510
1480
|
LogLevel2[LogLevel2["warn"] = 1] = "warn";
|
|
@@ -1519,30 +1489,36 @@ const textLogLevel = [
|
|
|
1519
1489
|
"DEBUG"
|
|
1520
1490
|
];
|
|
1521
1491
|
class CASCClient {
|
|
1492
|
+
region;
|
|
1493
|
+
product;
|
|
1494
|
+
version;
|
|
1495
|
+
name2FileDataID = /* @__PURE__ */ new Map();
|
|
1496
|
+
keys = /* @__PURE__ */ new Map();
|
|
1497
|
+
preload;
|
|
1498
|
+
static async getProductVersion(region, product) {
|
|
1499
|
+
const versionsText = await getProductVersions(region, product);
|
|
1500
|
+
const versions = parseProductVersions(versionsText);
|
|
1501
|
+
return versions.find((version) => version.Region === region);
|
|
1502
|
+
}
|
|
1503
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
1504
|
+
static LocaleFlags = LocaleFlags;
|
|
1505
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
1506
|
+
static ContentFlags = ContentFlags;
|
|
1507
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
1508
|
+
static LogLevel = LogLevel;
|
|
1509
|
+
logLevel;
|
|
1522
1510
|
constructor(region, product, version, logLevel = 2 /* info */) {
|
|
1523
|
-
__publicField$1(this, "region");
|
|
1524
|
-
__publicField$1(this, "product");
|
|
1525
|
-
__publicField$1(this, "version");
|
|
1526
|
-
__publicField$1(this, "name2FileDataID", /* @__PURE__ */ new Map());
|
|
1527
|
-
__publicField$1(this, "keys", /* @__PURE__ */ new Map());
|
|
1528
|
-
__publicField$1(this, "preload");
|
|
1529
|
-
__publicField$1(this, "logLevel");
|
|
1530
1511
|
this.region = region;
|
|
1531
1512
|
this.product = product;
|
|
1532
1513
|
this.version = version;
|
|
1533
1514
|
this.logLevel = logLevel;
|
|
1534
1515
|
}
|
|
1535
|
-
static async getProductVersion(region, product) {
|
|
1536
|
-
const versionsText = await getProductVersions(region, product);
|
|
1537
|
-
const versions = parseProductVersions(versionsText);
|
|
1538
|
-
return versions.find((version) => version.Region === region);
|
|
1539
|
-
}
|
|
1540
1516
|
log(level, message) {
|
|
1541
1517
|
if (level <= this.logLevel) {
|
|
1542
1518
|
if (level <= 0 /* error */) {
|
|
1543
|
-
console.error(`${( new Date()).toISOString()} [${textLogLevel[level]}]:`, message);
|
|
1519
|
+
console.error(`${(/* @__PURE__ */ new Date()).toISOString()} [${textLogLevel[level]}]:`, message);
|
|
1544
1520
|
} else {
|
|
1545
|
-
console.info(`${( new Date()).toISOString()} [${textLogLevel[level]}]:`, message);
|
|
1521
|
+
console.info(`${(/* @__PURE__ */ new Date()).toISOString()} [${textLogLevel[level]}]:`, message);
|
|
1546
1522
|
}
|
|
1547
1523
|
}
|
|
1548
1524
|
}
|
|
@@ -1769,19 +1745,7 @@ class CASCClient {
|
|
|
1769
1745
|
};
|
|
1770
1746
|
}
|
|
1771
1747
|
}
|
|
1772
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
1773
|
-
__publicField$1(CASCClient, "LocaleFlags", LocaleFlags);
|
|
1774
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
1775
|
-
__publicField$1(CASCClient, "ContentFlags", ContentFlags);
|
|
1776
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
1777
|
-
__publicField$1(CASCClient, "LogLevel", LogLevel);
|
|
1778
1748
|
|
|
1779
|
-
var __defProp = Object.defineProperty;
|
|
1780
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
1781
|
-
var __publicField = (obj, key, value) => {
|
|
1782
|
-
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
1783
|
-
return value;
|
|
1784
|
-
};
|
|
1785
1749
|
const PATTERN_COLUMN = /^(int|float|locstring|string)(<[^:]+::[^>]+>)?\s([^\s]+)/;
|
|
1786
1750
|
const PATTERN_LAYOUT = /^LAYOUT\s(.*)/;
|
|
1787
1751
|
const PATTERN_FIELD = /^(\$([^$]+)\$)?([^<[]+)(<(u|)(\d+)>)?(\[(\d+)\])?$/;
|
|
@@ -1823,11 +1787,11 @@ const getCastBuffer = (value, srcSize, dstSize) => {
|
|
|
1823
1787
|
return castBuffer;
|
|
1824
1788
|
};
|
|
1825
1789
|
class DBDParser {
|
|
1790
|
+
wdc;
|
|
1791
|
+
definitions = /* @__PURE__ */ new Map();
|
|
1792
|
+
columns = [];
|
|
1793
|
+
cache = /* @__PURE__ */ new Map();
|
|
1826
1794
|
constructor(wdc) {
|
|
1827
|
-
__publicField(this, "wdc");
|
|
1828
|
-
__publicField(this, "definitions", /* @__PURE__ */ new Map());
|
|
1829
|
-
__publicField(this, "columns", []);
|
|
1830
|
-
__publicField(this, "cache", /* @__PURE__ */ new Map());
|
|
1831
1795
|
this.wdc = wdc;
|
|
1832
1796
|
}
|
|
1833
1797
|
async init() {
|
|
@@ -2091,3 +2055,4 @@ class DBDParser {
|
|
|
2091
2055
|
}
|
|
2092
2056
|
|
|
2093
2057
|
export { ADBReader, CASCClient, DBDParser, WDCReader };
|
|
2058
|
+
//# sourceMappingURL=index.mjs.map
|