fix: 개인 기록에 장수별 실행 시각을 보존
로그 발생 시각과 트랜잭션 flush 시각을 분리하고, 정규 및 즉시 장수 행동 로그에는 실행 전 장수 턴 시각을 기록한다. 기존 로그 행은 변경하지 않는다.
This commit is contained in:
@@ -159,6 +159,25 @@ const makeState = (meta: Record<string, unknown> = {}): TurnWorldState => ({
|
||||
});
|
||||
|
||||
describe('legacy general turn lifecycle', () => {
|
||||
it('timestamps action logs with the executing general turn instead of the shared flush cursor', async () => {
|
||||
const flushCursor = new Date('0200-01-01T00:35:00.000Z');
|
||||
const generalTurnTime = new Date('0200-01-01T00:37:43.000Z');
|
||||
const harness = await createTurnTestHarness({
|
||||
snapshot: makeSnapshot([makeGeneral({ turnTime: generalTurnTime })]),
|
||||
state: { ...makeState(), lastTurnTime: flushCursor },
|
||||
schedule,
|
||||
map,
|
||||
});
|
||||
harness.reservedTurnStore.getGeneralTurns(1)[0] = { action: '휴식', args: {} };
|
||||
|
||||
await harness.runOneTick();
|
||||
|
||||
const actionLog = harness.world
|
||||
.peekDirtyState()
|
||||
.logs.find((log) => log.text.includes('아무것도 실행하지 않았습니다.'));
|
||||
expect(actionLog?.occurredAt).toEqual(generalTurnTime);
|
||||
});
|
||||
|
||||
it('emits legacy plain logs when command gains cross experience and dedication levels', async () => {
|
||||
const harness = await createTurnTestHarness({
|
||||
snapshot: makeSnapshot([
|
||||
|
||||
Reference in New Issue
Block a user