merge: 최신 main을 턴 실패 개인 기록 작업에 반영

# Conflicts:
#	app/game-engine/src/turn/reservedTurnHandler.ts
This commit is contained in:
2026-08-20 16:25:00 +00:00
44 changed files with 2619 additions and 276 deletions
+11 -2
View File
@@ -814,7 +814,11 @@ export class InMemoryTurnWorld {
};
}
pushLog(entry: LogEntryDraft): void {
pushLog(entry: LogEntryDraft, occurredAt?: Date): void {
if (occurredAt && !entry.occurredAt) {
this.logs.push({ ...entry, occurredAt: new Date(occurredAt.getTime()) });
return;
}
this.logs.push(entry);
}
@@ -1382,7 +1386,12 @@ export class InMemoryTurnWorld {
this.dirtyNationIds.add(result.nation.id);
}
if (result.logs && result.logs.length > 0) {
this.logs.push(...result.logs);
// Ref command logs use the executing general's pre-advance turntime.
// Preserve that per-entry occurrence time instead of replacing every
// log in the transaction with the shared completion cursor at flush.
for (const log of result.logs) {
this.pushLog(log, currentGeneral.turnTime);
}
}
if (result.messages && result.messages.length > 0) {
this.messages.push(...result.messages);
@@ -2273,9 +2273,7 @@ export const createImmediateGeneralActionExecutor = async (options: {
definition.formatConstraintFailure?.(reason, constraintCtx, args, view) ??
`${reason} ${definition.name} 실패.`;
if (input.actionKey === 'che_접경귀환' || input.actionKey === 'che_등용수락') {
options.world.pushLog({
...createGeneralActionLog(general.id, failureText),
});
options.world.pushLog(createGeneralActionLog(general.id, failureText), general.turnTime);
}
return { ok: false, reason: failureText };
}
@@ -2352,7 +2350,7 @@ export const createImmediateGeneralActionExecutor = async (options: {
if (input.actionKey === 'che_접경귀환' && (resolution.general as TurnGeneral).cityId === general.cityId) {
for (const log of resolution.logs) {
options.world.pushLog(log);
options.world.pushLog(log, general.turnTime);
}
return { ok: false, reason: '가까운 아국 도시가 없습니다.' };
}
@@ -2436,7 +2434,7 @@ export const createImmediateGeneralActionExecutor = async (options: {
options.world.removeTroop(troopId);
}
for (const log of [...resolution.logs, ...progressionLogs]) {
options.world.pushLog(log);
options.world.pushLog(log, general.turnTime);
}
options.world.updateGeneral(input.generalId, nextGeneral);
return { ok: true };