fix: 자동 외교 설정을 제거하고 관련된 모든 부분을 업데이트
This commit is contained in:
@@ -61,10 +61,9 @@ export const AVAILABLE_INSTANT_TURN: Record<string, boolean> = {
|
||||
NPC전방발령: true,
|
||||
};
|
||||
|
||||
export type UserRulerAutomationFeature = 'diplomacy' | 'war' | 'promotion' | 'finance' | 'capital';
|
||||
export type UserRulerAutomationFeature = 'war' | 'promotion' | 'finance' | 'capital';
|
||||
|
||||
const USER_RULER_AUTOMATION_META_KEY = {
|
||||
diplomacy: 'use_auto_nation_diplomacy',
|
||||
war: 'use_auto_nation_war',
|
||||
promotion: 'use_auto_nation_promotion',
|
||||
finance: 'use_auto_nation_finance',
|
||||
@@ -72,7 +71,6 @@ const USER_RULER_AUTOMATION_META_KEY = {
|
||||
} as const satisfies Record<UserRulerAutomationFeature, string>;
|
||||
|
||||
const USER_RULER_ACTION_FEATURE: Readonly<Record<string, UserRulerAutomationFeature>> = {
|
||||
불가침제의: 'diplomacy',
|
||||
선전포고: 'war',
|
||||
천도: 'capital',
|
||||
};
|
||||
|
||||
@@ -142,12 +142,11 @@ const zSetMySetting = z.object({
|
||||
type: z.literal('setMySetting'),
|
||||
userId: z.string().min(1),
|
||||
generalId: zFiniteNumber,
|
||||
settings: z.object({
|
||||
settings: z.strictObject({
|
||||
tnmt: z.number().int().optional(),
|
||||
defence_train: z.number().int().optional(),
|
||||
use_treatment: z.number().int().optional(),
|
||||
use_auto_nation_turn: z.number().int().optional(),
|
||||
use_auto_nation_diplomacy: z.number().int().optional(),
|
||||
use_auto_nation_war: z.number().int().optional(),
|
||||
use_auto_nation_promotion: z.number().int().optional(),
|
||||
use_auto_nation_finance: z.number().int().optional(),
|
||||
|
||||
@@ -1896,7 +1896,6 @@ async function handleSetMySetting(
|
||||
nextMeta.use_auto_nation_turn = settings.use_auto_nation_turn === 0 ? 0 : 1;
|
||||
}
|
||||
for (const key of [
|
||||
'use_auto_nation_diplomacy',
|
||||
'use_auto_nation_war',
|
||||
'use_auto_nation_promotion',
|
||||
'use_auto_nation_finance',
|
||||
|
||||
@@ -98,6 +98,23 @@ describe('authenticated actor-bound command registry and execution', () => {
|
||||
).toBeNull();
|
||||
});
|
||||
|
||||
it('rejects the removed automatic diplomacy setting at the daemon boundary', () => {
|
||||
expect(
|
||||
normalizeTurnDaemonCommand({
|
||||
requestId: 'set-my-setting:removed-diplomacy',
|
||||
sentAt: '2026-08-28T00:00:00.000Z',
|
||||
command: {
|
||||
type: 'setMySetting',
|
||||
userId: 'user-7',
|
||||
generalId: 7,
|
||||
settings: {
|
||||
use_auto_nation_diplomacy: 1,
|
||||
},
|
||||
} as unknown as TurnDaemonCommand,
|
||||
})
|
||||
).toBeNull();
|
||||
});
|
||||
|
||||
it('rejects every actor-bound queue payload that omits userId', () => {
|
||||
for (const command of buildActorBoundCommands()) {
|
||||
const {
|
||||
|
||||
@@ -826,7 +826,7 @@ describe('legacy NPC user-chief promotion parity', () => {
|
||||
expect(run(3, 0, 1)).toEqual([{ generalId: 2, officerLevel: 11, officerCity: 0, permission: 'ambassador' }]);
|
||||
});
|
||||
|
||||
it('keeps user-ruler duties individually disabled until each setting is enabled', () => {
|
||||
it('keeps non-aggression proposals NPC-only while user-ruler duties remain opt-in', () => {
|
||||
const ruler = makePromotionGeneral({ id: 1, officerLevel: 12, npcState: 0, meta: { killturn: 0 } });
|
||||
expect(canUseAutomatedNationAction(ruler, '선전포고')).toBe(false);
|
||||
expect(canUseAutomatedNationAction(ruler, '불가침제의')).toBe(false);
|
||||
@@ -839,18 +839,21 @@ describe('legacy NPC user-chief promotion parity', () => {
|
||||
use_auto_nation_capital: 1,
|
||||
use_auto_nation_finance: 1,
|
||||
};
|
||||
expect(canUseAutomatedNationAction(ruler, '불가침제의')).toBe(true);
|
||||
// 기존 DB에 제거된 플래그가 남아 있어도 사용자 군주에게는 다시 활성화되지 않는다.
|
||||
expect(canUseAutomatedNationAction(ruler, '불가침제의')).toBe(false);
|
||||
expect(canUseAutomatedNationAction(ruler, '선전포고')).toBe(false);
|
||||
expect(canUseAutomatedNationAction(ruler, '천도')).toBe(true);
|
||||
expect(canUseRulerAutomation(ruler, 'finance')).toBe(true);
|
||||
|
||||
ruler.meta = {
|
||||
...ruler.meta,
|
||||
use_auto_nation_diplomacy: 0,
|
||||
use_auto_nation_war: 1,
|
||||
};
|
||||
expect(canUseAutomatedNationAction(ruler, '불가침제의')).toBe(false);
|
||||
expect(canUseAutomatedNationAction(ruler, '선전포고')).toBe(true);
|
||||
|
||||
const npcRuler = makePromotionGeneral({ id: 2, officerLevel: 12, npcState: 2, meta: { killturn: 0 } });
|
||||
expect(canUseAutomatedNationAction(npcRuler, '불가침제의')).toBe(true);
|
||||
});
|
||||
|
||||
it('honors the existing automatic nation-turn master switch for user chiefs only', () => {
|
||||
|
||||
@@ -237,7 +237,6 @@ describe('my information world commands', () => {
|
||||
defence_train: 94,
|
||||
use_treatment: 200,
|
||||
use_auto_nation_turn: 0,
|
||||
use_auto_nation_diplomacy: 1,
|
||||
use_auto_nation_war: 1,
|
||||
use_auto_nation_promotion: 1,
|
||||
use_auto_nation_finance: 1,
|
||||
@@ -254,7 +253,6 @@ describe('my information world commands', () => {
|
||||
defence_train: 999,
|
||||
use_treatment: 100,
|
||||
use_auto_nation_turn: 0,
|
||||
use_auto_nation_diplomacy: 1,
|
||||
use_auto_nation_war: 1,
|
||||
use_auto_nation_promotion: 1,
|
||||
use_auto_nation_finance: 1,
|
||||
|
||||
Reference in New Issue
Block a user