diff --git a/app/game-api/src/router/world/directory.ts b/app/game-api/src/router/world/directory.ts index 58dbb72a..d3976975 100644 --- a/app/game-api/src/router/world/directory.ts +++ b/app/game-api/src/router/world/directory.ts @@ -96,6 +96,7 @@ export const getNationDirectory = authedProcedure.query(async ({ ctx }) => { npcState: true, nationId: true, cityId: true, + crew: true, dedication: true, officerLevel: true, meta: true, @@ -182,6 +183,7 @@ export const getNationDirectory = authedProcedure.query(async ({ ctx }) => { capitalCityId: nation.capitalCityId ?? 0, rulerCityName: ruler ? (cityNameById.get(ruler.cityId) ?? null) : null, generalCount: readMetaNumber(nation.meta, 'gennum', nationGenerals.length), + totalCrew: nationGenerals.reduce((sum, general) => sum + general.crew, 0), cityCount: nationCities.length, officers, ambassadorNames: secretPermissions diff --git a/app/game-api/test/directoryRouter.test.ts b/app/game-api/test/directoryRouter.test.ts index dc24942f..28749e35 100644 --- a/app/game-api/test/directoryRouter.test.ts +++ b/app/game-api/test/directoryRouter.test.ts @@ -112,6 +112,7 @@ const directoryGeneral = (overrides: Record = {}) => ({ leadership: 70, strength: 60, intel: 50, + crew: 100, experience: 1_000, meta: { killturn: 3 }, penalty: {}, @@ -303,6 +304,7 @@ describe('legacy global nation/general directories', () => { expect(result[1]).toMatchObject({ id: 1, generalCount: 4, + totalCrew: 400, cityCount: 1, ambassadorNames: ['군주', '외교관'], auditorCount: 1, @@ -312,7 +314,7 @@ describe('legacy global nation/general directories', () => { officerLevel: 12, general: { id: 10, name: '군주' }, }); - expect(result[2]).toMatchObject({ name: '재 야', generalCount: 1, cityCount: 1 }); + expect(result[2]).toMatchObject({ name: '재 야', generalCount: 1, totalCrew: 100, cityCount: 1 }); }); it('projects a level-zero nation location from its ruler city even when that city belongs to another nation', async () => { diff --git a/app/game-frontend/e2e/directoryLists.spec.ts b/app/game-frontend/e2e/directoryLists.spec.ts index a769b899..1d6e4643 100644 --- a/app/game-frontend/e2e/directoryLists.spec.ts +++ b/app/game-frontend/e2e/directoryLists.spec.ts @@ -19,6 +19,7 @@ const nationDirectory = [ power: 2000, capitalCityId: 2, generalCount: 1, + totalCrew: 1_200, cityCount: 1, officers: Array.from({ length: 8 }, (_, index) => ({ officerLevel: 12 - index, @@ -38,6 +39,7 @@ const nationDirectory = [ power: 1000, capitalCityId: 1, generalCount: 2, + totalCrew: 2_500, cityCount: 1, officers: Array.from({ length: 8 }, (_, index) => ({ officerLevel: 12 - index, @@ -60,6 +62,7 @@ const nationDirectory = [ power: 0, capitalCityId: 0, generalCount: 1, + totalCrew: 0, cityCount: 1, officers: Array.from({ length: 8 }, (_, index) => ({ officerLevel: 12 - index, general: null })), ambassadorNames: [], @@ -697,6 +700,8 @@ test('nation directory reuses only the public general-directory row on hover and await page.waitForLoadState('networkidle'); await expect(page.getByRole('button', { name: '장수 일람 연동' })).toHaveCount(0); await expect(page.locator('[data-general-preview-trigger]')).toHaveCount(4); + await expect(page.locator('[data-nation-id="1"]')).toContainText('총 병사'); + await expect(page.locator('[data-nation-id="1"]')).toContainText('2,500'); expect(requestedOperations.filter((operation) => operation === 'world.getGeneralDirectory')).toHaveLength( viewport.name === 'desktop' ? 0 : 1 ); diff --git a/app/game-frontend/src/views/NationListView.vue b/app/game-frontend/src/views/NationListView.vue index 3d932003..47713bdf 100644 --- a/app/game-frontend/src/views/NationListView.vue +++ b/app/game-frontend/src/views/NationListView.vue @@ -203,6 +203,16 @@ onBeforeUnmount(() => { 장수 / 속령 {{ nation.generalCount }} / {{ nation.cityCount }} + + 총 병사 + {{ nation.totalCrew.toLocaleString('ko-KR') }} + + + + 총 병사 + {{ nation.totalCrew.toLocaleString('ko-KR') }} + +