-
Notifications
You must be signed in to change notification settings - Fork 4
/
CachedAssetsManager.ts
633 lines (539 loc) · 24.6 KB
/
CachedAssetsManager.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
import fs from "fs";
import path from "path";
import { Axios } from "axios";
import unzip, { Entry } from "unzip-stream";
import { ConfigFile, JsonObject, JsonReader, bindOptions, move } from "config_file.js";
import { fetchJSON } from "../utils/axios_utils";
import ObjectKeysManager from "./ObjectKeysManager";
import StarRail from "./StarRail";
import { getStableHash } from "../utils/hash_utils";
const languages: LanguageCode[] = ["chs", "cht", "de", "en", "es", "fr", "id", "jp", "kr", "pt", "ru", "th", "vi"];
let dataMemory: { [key: string]: { [key: string]: JsonObject } } = {};
const initialLangDataMemory: NullableLanguageMap = { chs: null, cht: null, de: null, en: null, es: null, fr: null, id: null, jp: null, kr: null, pt: null, ru: null, th: null, vi: null };
let langDataMemory: NullableLanguageMap = { ...initialLangDataMemory };
let objectKeysManager: ObjectKeysManager | null;
export type NullableLanguageMap = { [key in LanguageCode]: { [key: string]: string } | null };
export type LanguageMap = { [key in LanguageCode]: { [key: string]: string } };
export type LanguageCode = "chs" | "cht" | "de" | "en" | "es" | "fr" | "id" | "jp" | "kr" | "pt" | "ru" | "th" | "vi";
// Thanks @Dimbreath
const contentBaseUrl = "https://raw.githubusercontent.com/Dimbreath/StarRailData/master";
const contents = [
"AvatarConfig", // Characters
"ItemConfigAvatar", // Characters as Items
"DamageType", // Combat Types
"AvatarBaseType", // Paths
"AvatarSkillConfig", // Character Skills
"AvatarSkillTreeConfig", // Character Skill Trees
"AvatarRankConfig", // Character Eidolons
"AvatarPromotionConfig", // Character Promotions and Character Basic Stats.
"EquipmentConfig", // Light Cones
"ItemConfigEquipment", // Light Cones as Items
"EquipmentExpType", // Light Cone Exp Types
"EquipmentSkillConfig", // Light Cone Superimpositions
"EquipmentPromotionConfig", // Light Cone Promotions and Light Cone Basic Stats
"RelicConfig", // Relics
"ItemConfigRelic", // Relics as Items
"RelicExpType", // Relic Exp Types
"RelicMainAffixConfig", // Relic Main Stats
"RelicSubAffixConfig", // Relic Sub Stats
"RelicSetConfig", // Relic Sets
"RelicSetSkillConfig", // Relic Set Bonus
"RelicBaseType", // Relic Types
"AvatarPropertyConfig", // StatProperty
// Character Icon for a player
"ItemConfigAvatarPlayerIcon",
"AvatarPlayerIcon",
// Other Icon for a player
"ItemPlayerCard",
"PlayerIcon",
];
const textMapWhiteList: number[] = [
];
const getGitRemoteAPIUrl = (useRawStarRailData: boolean, rawDate: Date, date: Date) => useRawStarRailData
? `https://api.github.com/repos/Dimbreath/StarRailData/commits?sha=master&since=${rawDate.toISOString()}`
: `https://api.github.com/repos/yuko1101/starrail.js/commits?sha=main&path=cache.zip&since=${date.toISOString()}`;
class CachedAssetsManager {
/** The client that instantiated this */
readonly client: StarRail;
/** Default path of StarRail cache data directory */
readonly defaultCacheDirectoryPath: string;
/** List of the names of the files this library uses */
readonly _contentsSrc: string[];
/** List of supported languages */
readonly _langs: string[];
/** Path of directory where StarRail cache data is stored */
cacheDirectoryPath: string;
_cacheUpdater: NodeJS.Timer | null;
_githubCache: ConfigFile | null;
_isFetching: boolean;
constructor(client: StarRail) {
this.client = client;
this.defaultCacheDirectoryPath = path.resolve(__dirname, "..", "..", "cache");
this._contentsSrc = contents;
this._langs = languages;
this.cacheDirectoryPath = client.options.cacheDirectory ?? this.defaultCacheDirectoryPath;
this._cacheUpdater = null;
this._githubCache = null;
this._isFetching = false;
}
/** Create the necessary folders and files, and if the directory [cacheDirectoryPath](#cacheDirectoryPath) did not exist, move the cache files from the default path. */
async cacheDirectorySetup(): Promise<void> {
if (!fs.existsSync(this.cacheDirectoryPath)) {
fs.mkdirSync(this.cacheDirectoryPath);
const defaultCacheFiles = fs.readdirSync(this.defaultCacheDirectoryPath);
if (defaultCacheFiles.length > 0) {
try {
move(this.defaultCacheDirectoryPath, this.cacheDirectoryPath);
} catch (e) {
console.error(`Auto-Moving cache data failed with error: ${e}`);
}
}
}
if (!fs.existsSync(path.resolve(this.cacheDirectoryPath, "data"))) {
fs.mkdirSync(path.resolve(this.cacheDirectoryPath, "data"));
}
if (!fs.existsSync(path.resolve(this.cacheDirectoryPath, "langs"))) {
fs.mkdirSync(path.resolve(this.cacheDirectoryPath, "langs"));
}
if (!fs.existsSync(path.resolve(this.cacheDirectoryPath, "github"))) {
fs.mkdirSync(path.resolve(this.cacheDirectoryPath, "github"));
}
const githubCachePath = path.resolve(this.cacheDirectoryPath, "github", "starrail_data.json");
if (!fs.existsSync(githubCachePath) || !this._githubCache) {
this._githubCache = await new ConfigFile(githubCachePath, {
"lastUpdate": 0,
"rawLastUpdate": 0,
}).load();
}
}
/** Obtains a text map for a specific language. */
async fetchLanguageData(lang: LanguageCode): Promise<{ [key: string]: string }> {
await this.cacheDirectorySetup();
const url = `${contentBaseUrl}/TextMap/TextMap${lang.toUpperCase()}.json`;
const json = (await fetchJSON(url, this.client)).data;
return json;
}
/**
* @param useRawStarRailData Whether to fetch from github repo ({@link https://github.com/Dimbreath/StarRailData}) instead of downloading cache.zip
* @returns Whether the game data update is available or not.
*/
async checkForUpdates(useRawStarRailData = false): Promise<boolean> {
await this.cacheDirectorySetup();
const url = getGitRemoteAPIUrl(useRawStarRailData, new Date(this._githubCache?.getValue("rawLastUpdate") as (number | null | undefined) ?? 0), new Date(this._githubCache?.getValue("lastUpdate") as (number | null | undefined) ?? 0));
const res = await fetchJSON(url, this.client);
if (res.status !== 200) {
throw new Error("Request Failed");
}
const data = res.data;
return data.length !== 0;
}
/**
* @param options.useRawStarRailData Whether to fetch from github repo ({@link https://github.com/Dimbreath/StarRailData}) instead of downloading cache.zip
* @param options.ghproxy Whether to use ghproxy.com
*/
async fetchAllContents(options: { useRawStarRailData?: boolean, ghproxy?: boolean }): Promise<void> {
if (this._isFetching) {
throw new Error("You are already fetching assets.");
}
options = bindOptions({
useRawStarRailData: false,
}, options);
await this.cacheDirectorySetup();
this._isFetching = true;
if (!options.useRawStarRailData) {
if (this.client.options.showFetchCacheLog) {
console.info("Downloading cache.zip...");
}
await this._downloadCacheZip();
await this._githubCache?.set("lastUpdate", Date.now()).save();
if (this.client.options.showFetchCacheLog) {
console.info("Download completed");
}
} else {
if (this.client.options.showFetchCacheLog) {
console.info("Downloading structure data files...");
}
const promises: Promise<void>[] = [];
const excelOutputData: { [s: string]: { [s: string]: JsonObject } } = {};
for (const content of contents) {
const fileName = `${content}.json`;
const url = `${contentBaseUrl}/ExcelOutput/${fileName}`;
promises.push((async () => {
const json = (await fetchJSON(url, this.client)).data;
if (this.client.options.showFetchCacheLog) {
console.info(`Downloaded data/${fileName}`);
}
excelOutputData[content] = json;
})());
}
await Promise.all(promises);
if (this.client.options.showFetchCacheLog) {
console.info("> Downloaded all structure data files");
console.info("Downloading language files...");
}
const langsData: NullableLanguageMap = { ...initialLangDataMemory };
const langPromises: Promise<void>[] = [];
for (const lang of languages) {
langPromises.push(
(async () => {
const data = await this.fetchLanguageData(lang);
if (this.client.options.showFetchCacheLog) {
console.info(`Downloaded langs/${lang}.json`);
}
langsData[lang] = data;
})(),
);
}
await Promise.all(langPromises);
if (this.client.options.showFetchCacheLog) {
console.info("> Downloaded all language files");
console.info("Parsing data... (This may take more than 10 minutes)");
}
const clearLangsData: NullableLanguageMap = this.removeUnusedTextData(excelOutputData, langsData as LanguageMap);
if (this.client.options.showFetchCacheLog) {
console.info("> Parsing completed");
console.info("Saving into files...");
}
for (const lang of Object.keys(clearLangsData) as LanguageCode[]) {
fs.writeFileSync(path.resolve(this.cacheDirectoryPath, "langs", `${lang}.json`), JSON.stringify(clearLangsData[lang]));
}
for (const key in excelOutputData) {
fs.writeFileSync(path.resolve(this.cacheDirectoryPath, "data", `${key}.json`), JSON.stringify(excelOutputData[key]));
}
await this._githubCache?.set("rawLastUpdate", Date.now()).save();
if (this.client.options.showFetchCacheLog) {
console.info(">> All Completed");
}
}
this._isFetching = false;
}
/**
* @returns whether all StarRail cache data files exist.
*/
hasAllContents(): boolean {
for (const lang of languages) {
if (!fs.existsSync(path.resolve(this.cacheDirectoryPath, "langs", `${lang}.json`))) return false;
}
for (const content of contents) {
const fileName = `${content}.json`;
if (!fs.existsSync(path.resolve(this.cacheDirectoryPath, "data", fileName))) return false;
}
return true;
}
/**
* @param options.useRawStarRailData Whether to fetch from github repo ({@link https://github.com/Dimbreath/StarRailData}) instead of downloading cache.zip
* @param options.ghproxy Whether to use ghproxy.com
* @returns true if there were any updates, false if there were no updates.
*/
async updateContents(options: { useRawStarRailData?: boolean, ghproxy?: boolean, onUpdateStart?: () => Promise<void>, onUpdateEnd?: () => Promise<void> } = {}): Promise<void> {
options = bindOptions({
useRawStarRailData: false,
ghproxy: false,
onUpdateStart: null,
onUpdateEnd: null,
}, options);
await this.cacheDirectorySetup();
const url = getGitRemoteAPIUrl(!!options.useRawStarRailData, new Date((this._githubCache?.getValue("rawLastUpdate") ?? 0) as number), new Date((this._githubCache?.getValue("lastUpdate") ?? 0) as number));
const res = await fetchJSON(url, this.client);
if (res.status !== 200) {
throw new Error("Request Failed");
}
const data = res.data;
if (data.length !== 0) {
await options.onUpdateStart?.();
// fetch all because large file diff cannot be retrieved
await this.fetchAllContents({ useRawStarRailData: options.useRawStarRailData, ghproxy: options.ghproxy });
await options.onUpdateEnd?.();
}
}
/**
* @param options.useRawStarRailData Whether to fetch from github repo ({@link https://github.com/Dimbreath/StarRailData}) instead of downloading cache.zip
* @param options.ghproxy Whether to use ghproxy.com
* @param options.timeout in milliseconds
*/
activateAutoCacheUpdater(options: { useRawStarRailData?: boolean, instant?: boolean, ghproxy?: boolean, timeout?: number, onUpdateStart?: () => Promise<void>, onUpdateEnd?: () => Promise<void>, onError?: (error: Error) => Promise<void> } = {}): void {
options = bindOptions({
useRawStarRailData: false,
instant: true,
ghproxy: false,
timeout: 60 * 60 * 1000,
onUpdateStart: null,
onUpdateEnd: null,
onError: null,
}, options);
if (options.timeout as number < 60 * 1000) throw new Error("timeout cannot be shorter than 1 minute.");
if (options.instant) this.updateContents({ onUpdateStart: options.onUpdateStart, onUpdateEnd: options.onUpdateEnd, useRawStarRailData: options.useRawStarRailData, ghproxy: options.ghproxy });
this._cacheUpdater = setInterval(async () => {
if (this._isFetching) return;
try {
this.updateContents({ onUpdateStart: options.onUpdateStart, onUpdateEnd: options.onUpdateEnd, useRawStarRailData: options.useRawStarRailData, ghproxy: options.ghproxy });
} catch (e) {
if (e instanceof Error) options.onError?.(e);
}
}, options.timeout);
}
/**
* Disables the updater activated by [activateAutoCacheUpdater](#activateAutoCacheUpdater)
*/
deactivateAutoCacheUpdater(): void {
if (this._cacheUpdater !== null) {
clearInterval(this._cacheUpdater);
this._cacheUpdater = null;
}
}
/**
* @returns text map file path for a specific language
*/
getLanguageDataPath(lang: LanguageCode): string {
return path.resolve(this.cacheDirectoryPath, "langs", `${lang}.json`);
}
/**
* @param name without extensions (.json)
* @returns excel bin file path
*/
getJSONDataPath(name: string): string {
return path.resolve(this.cacheDirectoryPath, "data", `${name}.json`);
}
/**
* @param name without extensions (.json)
*/
getStarRailCacheData(name: string): { [key: string]: JsonObject } {
if (!Object.keys(dataMemory).includes(name)) {
dataMemory[name] = JSON.parse(fs.readFileSync(this.getJSONDataPath(name), "utf-8"));
}
return dataMemory[name];
}
/**
* @returns text map for a specific language
*/
getLanguageData(lang: LanguageCode): { [key: string]: string } {
langDataMemory[lang] ??= JSON.parse(fs.readFileSync(this.getLanguageDataPath(lang), "utf-8"));
return langDataMemory[lang] ?? {};
}
/**
* @returns ObjectKeysManager of this
*/
getObjectKeysManager(): ObjectKeysManager {
if (!objectKeysManager) objectKeysManager = new ObjectKeysManager(this);
return objectKeysManager;
}
/**
* Clean memory of cache data.
* Then reload data that was loaded before the clean if `reload` is true.
* If `reload` is false, load each file as needed.
*/
refreshAllData(reload = false): void {
const loadedData = reload ? Object.keys(dataMemory) : null;
const loadedLangs = reload ? Object.keys(langDataMemory) as LanguageCode[] : null;
dataMemory = {};
langDataMemory = { ...initialLangDataMemory };
objectKeysManager = null;
if (reload && loadedData && loadedLangs) {
for (const name of loadedData) {
this.getStarRailCacheData(name);
}
for (const lang of loadedLangs) {
this.getLanguageData(lang);
}
objectKeysManager = new ObjectKeysManager(this);
}
}
/**
* Remove all unused text map entries
*/
removeUnusedTextData(data: { [s: string]: { [s: string]: JsonObject } }, langsData: LanguageMap, showLog = true): LanguageMap {
const required: number[] = [];
function push(...keys: number[]) {
const len = keys.length;
for (let i = 0; i < len; i++) {
const key = keys[i];
if (!required.includes(key)) required.push(key);
}
}
push(...textMapWhiteList);
Object.values(data["AvatarConfig"]).forEach(c => {
const json = new JsonReader(c);
push(
json.getAsNumber("AvatarName", "Hash"),
);
});
Object.values(data["ItemConfigAvatar"]).forEach(c => {
const json = new JsonReader(c);
push(
json.getAsNumber("ItemBGDesc", "Hash"),
);
});
Object.values(data["DamageType"]).forEach(d => {
const json = new JsonReader(d);
push(
json.getAsNumber("DamageTypeName", "Hash"),
json.getAsNumber("DamageTypeIntro", "Hash"),
);
});
Object.values(data["AvatarBaseType"]).forEach(p => {
const json = new JsonReader(p);
push(
json.getAsNumber("BaseTypeText", "Hash"),
json.getAsNumber("BaseTypeDesc", "Hash"),
);
});
Object.values(data["AvatarSkillConfig"]).forEach(s => {
Object.values(s).forEach(l => {
const json = new JsonReader(l);
push(
json.getAsNumber("SkillName", "Hash"),
json.getAsNumber("SkillTag", "Hash"),
json.getAsNumber("SkillTypeDesc", "Hash"),
json.getAsNumber("SkillDesc", "Hash"),
json.getAsNumber("SimpleSkillDesc", "Hash"),
);
});
});
Object.values(data["AvatarSkillTreeConfig"]).forEach(s => {
Object.values(s).forEach(l => {
const json = new JsonReader(l);
const name = json.getAsString("PointName");
if (name !== "") push(getStableHash(name));
const description = json.getAsString("PointDesc");
if (description !== "") push(getStableHash(description));
});
});
Object.values(data["AvatarRankConfig"]).forEach(e => {
const json = new JsonReader(e);
push(
getStableHash(json.getAsString("Name")),
getStableHash(json.getAsString("Desc")),
);
});
Object.values(data["EquipmentConfig"]).forEach(l => {
const json = new JsonReader(l);
push(
json.getAsNumber("EquipmentName", "Hash"),
json.getAsNumber("EquipmentDesc", "Hash"),
);
});
Object.values(data["ItemConfigEquipment"]).forEach(l => {
const json = new JsonReader(l);
push(
json.getAsNumber("ItemBGDesc", "Hash"),
json.getAsNumber("ItemDesc", "Hash"),
);
});
Object.values(data["EquipmentSkillConfig"]).forEach(s => {
Object.values(s).forEach(l => {
const json = new JsonReader(l);
push(
json.getAsNumber("SkillName", "Hash"),
json.getAsNumber("SkillDesc", "Hash"),
);
});
});
Object.values(data["ItemConfigRelic"]).forEach(r => {
const json = new JsonReader(r);
push(
json.getAsNumber("ItemName", "Hash"),
json.getAsNumber("ItemBGDesc", "Hash"),
);
});
Object.values(data["RelicSetConfig"]).forEach(s => {
const json = new JsonReader(s);
push(
json.getAsNumber("SetName", "Hash"),
);
});
Object.values(data["RelicSetSkillConfig"]).forEach(s => {
Object.values(s).forEach(b => {
const json = new JsonReader(b);
push(
getStableHash(json.getAsString("SkillDesc")),
);
});
});
Object.values(data["RelicBaseType"]).forEach(t => {
const json = new JsonReader(t);
push(
json.getAsNumber("BaseTypeText", "Hash"),
);
});
Object.values(data["AvatarPropertyConfig"]).forEach(s => {
const json = new JsonReader(s);
push(
json.getAsNumber("PropertyName", "Hash"),
json.getAsNumber("PropertyNameSkillTree", "Hash"),
json.getAsNumber("PropertyNameRelic", "Hash"),
json.getAsNumber("PropertyNameFilter", "Hash"),
);
});
[...Object.values(data["ItemConfigAvatarPlayerIcon"]), ...Object.values(data["ItemPlayerCard"])].forEach(i => {
const json = new JsonReader(i);
push(
json.getAsNumber("ItemName", "Hash"),
);
});
const requiredStringKeys = required.filter(key => key).map(key => key.toString());
if (showLog) console.info(`Required keys have been loaded (${requiredStringKeys.length.toLocaleString()} keys)`);
const clearLangsData: NullableLanguageMap = { ...initialLangDataMemory };
const keyCount = requiredStringKeys.length;
for (const lang of Object.keys(langsData) as LanguageCode[]) {
if (showLog) console.info(`Modifying language "${lang}"...`);
clearLangsData[lang] = {};
for (let i = 0; i < keyCount; i++) {
const key = requiredStringKeys[i];
const text = langsData[lang][key];
if (text) {
(clearLangsData[lang] as JsonObject)[key] = text;
} else {
// console.warn(`Required key ${key} was not found in language ${lang}.`);
}
}
// console.log(Object.keys(langData).length + " keys in " + lang);
// console.log(Object.keys(clearLangsData).length + " langs");
}
if (showLog) console.info("Removing unused keys completed.");
return clearLangsData as LanguageMap;
}
/**
* Download the zip file, which contains StarRail cache data, from {@link https://raw.githubusercontent.com/yuko1101/starrail.js/main/cache.zip}
* @param options.ghproxy Whether to use ghproxy.com
*/
async _downloadCacheZip(options: { ghproxy?: boolean } = {}): Promise<void> {
options = bindOptions({
ghproxy: false,
}, options);
const axios = new Axios({});
const url = (options.ghproxy ? "https://ghproxy.com/" : "") + "https://raw.githubusercontent.com/yuko1101/starrail.js/main/cache.zip";
const res = await axios.get(url, {
responseType: "stream",
}).catch(e => {
throw new Error(`Failed to download StarRail data from ${url} with an error: ${e}`);
});
if (res.status == 200) {
await new Promise<void>(resolve => {
res.data
.pipe(unzip.Parse())
.on("entry", (entry: Entry) => {
const entryPath = entry.path.replace(/^cache\/?/, "");
const extractPath = path.resolve(this.cacheDirectoryPath, entryPath);
if (entry.type === "Directory") {
if (!fs.existsSync(extractPath)) fs.mkdirSync(extractPath, { recursive: true });
entry.autodrain();
} else if (entryPath.startsWith("github/")) {
if (fs.existsSync(extractPath)) {
entry.autodrain();
return;
}
entry.pipe(fs.createWriteStream(extractPath));
} else {
entry.pipe(fs.createWriteStream(extractPath));
}
});
res.data.on("close", () => {
resolve();
});
});
} else {
throw new Error(`Failed to download StarRail data from ${url} with status ${res.status} - ${res.statusText}`);
}
}
}
export default CachedAssetsManager;