diff --git a/backend/src/Dex.ts b/backend/src/Dex.ts index 39b835b..6d2d40d 100644 --- a/backend/src/Dex.ts +++ b/backend/src/Dex.ts @@ -181,15 +181,21 @@ export class Dex { let index = 1; for await (const entry of zip) { const isDir = entry.fileName.endsWith("/"); - console.log(index, entry.fileName); + logger.info(`index: ${index}, fileName: ${entry.fileName}`); if (isDir) { + if (this._ublack(entry.fileName)) { + this.message.unzip(entry.fileName, zip.length, index); + index++; + continue; + } await fs.promises.mkdir(`${instancePath}/${entry.fileName}`, { recursive: true, }); } else if (entry.fileName.startsWith("overrides/")) { // 跳过黑名单文件 if (this._ublack(entry.fileName)) { - console.log("Skip blacklist file", entry.fileName); + logger.info("Skip blacklist file", entry.fileName); + this.message.unzip(entry.fileName, zip.length, index); index++; continue; } @@ -222,7 +228,10 @@ export class Dex { "overrides/options.txt", "shaderpacks", "essential", - "resourcepacks" + "resourcepacks", + "PCL", + "CustomSkinLoader", + "overrides" ]; return blacklist.some(item => filename.includes(item)); diff --git a/backend/src/utils/DeEarth.ts b/backend/src/utils/DeEarth.ts index 9b56edb..6613500 100644 --- a/backend/src/utils/DeEarth.ts +++ b/backend/src/utils/DeEarth.ts @@ -113,8 +113,10 @@ export class DeEarth { const serverMods: string[] = []; const modIds: string[] = []; const map: Map = new Map(); + try{ for (const file of this.files) { for (const info of file.infos) { + try{ const config = JSON.parse(info.data); const keys = Object.keys(config); if (keys.includes("id")) { @@ -124,6 +126,9 @@ export class DeEarth { modIds.push(config.mods[0].modId); map.set(config.mods[0].modId, file.filename); } + }catch(error: any){ + logger.error("Checking mod info file failed, filename: " + file.filename, error); + } } } const modids = modIds; @@ -146,6 +151,9 @@ export class DeEarth { } } } + }catch(error: any){ + logger.error("Dexpub check failed", error); + } return { serverMods, clientMods }; }