From 587ed05bf04c58a8dfd40612d7be493d1c317861 Mon Sep 17 00:00:00 2001 From: troytt <47798984@qq.com> Date: Thu, 1 Oct 2026 11:34:59 +0000 Subject: [PATCH] data(tbl): pack 1.13c index-only Battle.net connection-loss strings string.tbl 5349/5351/5352/5353/5357 and patchstring.tbl 1066 are keyed "x" in the MPQ, so emit them under string# / patchstring# aliases (ENG+CHI) for the online session-lost UI. Only the new alias lines were applied to canonical-tbl-strings.ts (a full regen currently drifts unrelated CHI runeword/skill names). --- src/baker/packers/pack-canonical-tbl.ts | 23 ++++++++++++++++++++++- src/common/data/canonical-tbl-strings.ts | 16 ++++++++++++++-- 2 files changed, 36 insertions(+), 3 deletions(-) diff --git a/src/baker/packers/pack-canonical-tbl.ts b/src/baker/packers/pack-canonical-tbl.ts index a800b45..2434a46 100644 --- a/src/baker/packers/pack-canonical-tbl.ts +++ b/src/baker/packers/pack-canonical-tbl.ts @@ -18,6 +18,7 @@ import { fileSource } from '../io/file-source.ts' import { MountedArchives } from '../../common/mpq/mount.ts' import { loadStringTableChain } from '../../common/items/item-names.ts' import { parseTable } from '../../common/items/tables.ts' +import { decodeTbl } from '../../common/formats/tbl.ts' import { ITEM_NAMES_ZH, MAGIC_PREFIX_ZH, @@ -545,7 +546,8 @@ async function main() { // (patchstring index n = global tbl index 10000 + n). They are emitted from the MPQ under the alias // key `patchstring#`. // - 95: Repair All button hover text "Repair all equipment: %d" (D2Client string index 10095) - for (const idx of [95]) { + // - 1066: "Diablo II was unable to connect to the realm server. ..." (string index 11066) + for (const idx of [95, 1066]) { const alias = `patchstring#${idx}` const ev = eng.tables[0]?.[idx] const cv = chi.tables[0]?.[idx] @@ -554,6 +556,25 @@ async function main() { chiOut[alias] = cv } + // Index-only string.tbl (d2data.mpq) Battle.net connection strings, all keyed "x" in the MPQ, emitted + // under `string#` (string.tbl index n = global tbl index n). Read straight from string.tbl so the + // index cannot shift with the patch/expansion chain order. + // - 5349: "Timed out waiting for response." + // - 5351: "Lost Connection to battle.net." + // - 5352: "Your connection to Battle.net has been lost." + // - 5353: "Battle.net is not responding. Please try connecting again in a few minutes." + // - 5357: "Your connection has been interrupted" + const engStringTbl = decodeTbl(await archives.read('data\\local\\lng\\eng\\string.tbl'), 'windows-1252') + const chiStringTbl = decodeTbl(await archives.read('data\\local\\lng\\chi\\string.tbl'), 'utf-8') + for (const idx of [5349, 5351, 5352, 5353, 5357]) { + const alias = `string#${idx}` + const ev = engStringTbl[idx] + const cv = chiStringTbl[idx] + if (ev === undefined || cv === undefined) throw new Error(`string.tbl index ${idx} missing (ENG or CHI)`) + engOut[alias] = ev + chiOut[alias] = cv + } + const outPath = path.join(process.cwd(), 'src/common/data/canonical-tbl-strings.ts') const fileContent = `/** * AUTO-GENERATED by \`src/baker/packers/pack-canonical-tbl.ts\` from authoritative 1.13c MPQ archives: diff --git a/src/common/data/canonical-tbl-strings.ts b/src/common/data/canonical-tbl-strings.ts index ae159f9..1fce1cf 100644 --- a/src/common/data/canonical-tbl-strings.ts +++ b/src/common/data/canonical-tbl-strings.ts @@ -4016,7 +4016,13 @@ export const CANONICAL_ENG_TBL_DICT: Readonly> = { "uniquemultishot": "Multiple Shots", "UniqueAuraEnchanted": "Aura Enchanted", "strethereal": "Ethereal (Cannot be Repaired)", - "patchstring#95": "Repair all equipment: %d" + "patchstring#95": "Repair all equipment: %d", + "patchstring#1066": "Diablo II was unable to connect to the realm server. The realm you selected may be unavailable or you may be encountering connection issues. Please make sure your internet connection is working properly and/or your firewall has port 6112 opened.", + "string#5349": "Timed out waiting for response.", + "string#5351": "Lost Connection to battle.net.", + "string#5352": "Your connection to Battle.net has been lost.", + "string#5353": "Battle.net is not responding. Please try connecting again in a few minutes.", + "string#5357": "Your connection has been interrupted" } export const CANONICAL_CHI_TBL_DICT: Readonly> = { @@ -7419,7 +7425,13 @@ export const CANONICAL_CHI_TBL_DICT: Readonly> = { "uniquemultishot": "多重射擊", "UniqueAuraEnchanted": "靈氣加強", "strethereal": "无形的 (无法修复)", - "patchstring#95": "修復所有裝備:%d" + "patchstring#95": "修復所有裝備:%d", + "patchstring#1066": "《暗黑破壞神二》無法連上國度伺服器。 你所選擇的國度可能無法使用,也可能是你遭遇了網路連線的問題。 請確認你的網路連線運作正常,以及/或你的防火牆設定有開啟port 6112。", + "string#5349": "等候回應時間超過。", + "string#5351": "與battle.net失去連線。", + "string#5352": "你和battle.net的連線已經中斷了。", + "string#5353": "Battle.net沒有回應,請稍候數分鐘之後再重試。", + "string#5357": "你的連線被中斷了" } export const CANONICAL_ISC_DESC_TABLE: Readonly> = {