fix: 지난 플레이 전투 자료를 보존한다

통일·장수 삭제·게임 취소 archive에 전투 집계와 숙련도, 전투 결과를 저장한다. 개인 기록과 전투 상세는 보존 대상에서 제외하고 기존 Core snapshot도 정규화한다.
This commit is contained in:
2026-08-22 09:15:45 +00:00
parent d74a8e48bb
commit d3d89cf003
12 changed files with 484 additions and 78 deletions
+9 -5
View File
@@ -585,11 +585,15 @@ export const archiveRouter = router({
const nation = resolveNation(nationMap, entry);
const snapshot = entry.snapshot;
const general = await buildGeneralDetail(entry, nation);
const battleResultEntries = (battleResultContent ?? '')
.split(/\r?\n/u)
.map((text, index) => ({ id: index + 1, text }))
.filter((item) => item.text.length > 0)
.reverse();
battleResultAvailable ||= snapshot.availability.battleResultLogs;
const battleResultEntries =
battleResultContent === null
? snapshot.records.battleResult.map((text, index, rows) => ({ id: rows.length - index, text }))
: battleResultContent
.split(/\r?\n/u)
.map((text, index) => ({ id: index + 1, text }))
.filter((item) => item.text.length > 0)
.reverse();
const logs = {
generalHistory: {
available: snapshot.availability.history,