fix: 커맨드 차등 생명주기와 로그 그래프를 보강

장수 55종과 수뇌 35종의 상태, 로그, 메시지, 예약 턴 비교를 닫습니다.

실제 시나리오 프로필과 대표 PostgreSQL 수명주기, 즉시 외교와 출병 회귀를 추가하고 발견된 Ref 로그 및 생성 장수 저장 차이를 교정합니다.
This commit is contained in:
2026-08-23 21:48:29 +00:00
parent 85591c68ad
commit c63a49bd07
128 changed files with 8615 additions and 848 deletions
+47
View File
@@ -4,6 +4,7 @@ import {
loadGeneralTurnCommandSpecs,
loadNationTurnCommandSpecs,
} from '@sammo-ts/logic';
import { loadScenarioDefinitionById } from '@sammo-ts/game-engine/scenario/scenarioLoader.js';
import { describe, expect, it } from 'vitest';
import {
@@ -98,6 +99,52 @@ describe('turn command argument input', () => {
await expect(parseReservedTurnArgs('general', 'che_포상', {})).rejects.toThrow('Unknown general turn command');
});
it('accepts and rejects reserved commands from the real 904/905/910/912 world config', async () => {
const scenarioConsts = Object.fromEntries(
await Promise.all(
[904, 905, 910, 912].map(async (scenarioId) => [
scenarioId,
(await loadScenarioDefinitionById(scenarioId)).config.const,
])
)
) as Record<number, Record<string, unknown>>;
await expect(parseReservedTurnArgs('general', 'che_거병', {}, scenarioConsts[904])).rejects.toThrow(
'Unknown general turn command: che_거병'
);
await expect(
parseReservedTurnArgs('nation', 'che_선전포고', { destNationId: 2 }, scenarioConsts[904])
).rejects.toThrow('Unknown nation turn command: che_선전포고');
await expect(
parseReservedTurnArgs(
'general',
'che_무작위건국',
{ nationName: '신국', nationType: 'che_도적', colorType: 1 },
scenarioConsts[905]
)
).resolves.toEqual({ nationName: '신국', nationType: 'che_도적', colorType: 1 });
await expect(parseReservedTurnArgs('nation', 'che_무작위수도이전', {}, scenarioConsts[905])).resolves.toEqual(
{}
);
await expect(parseReservedTurnArgs('general', 'cr_맹훈련', {}, scenarioConsts[905])).rejects.toThrow(
'Unknown general turn command: cr_맹훈련'
);
await expect(parseReservedTurnArgs('general', 'cr_맹훈련', {}, scenarioConsts[910])).resolves.toEqual({});
await expect(
parseReservedTurnArgs('nation', 'cr_인구이동', { destCityId: 7, amount: 1234 }, scenarioConsts[910])
).resolves.toEqual({ destCityId: 7, amount: 1234 });
await expect(parseReservedTurnArgs('nation', 'che_무작위수도이전', {}, scenarioConsts[910])).rejects.toThrow(
'Unknown nation turn command: che_무작위수도이전'
);
await expect(parseReservedTurnArgs('nation', 'event_대검병연구', {}, scenarioConsts[912])).resolves.toEqual({});
await expect(parseReservedTurnArgs('nation', 'cr_인구이동', {}, scenarioConsts[912])).rejects.toThrow(
'Unknown nation turn command: cr_인구이동'
);
});
it('limits equipment trade options to the Ref default items when a scenario omits allItems', () => {
const items = buildEquipmentTradeItemOptions({
configConst: {},