Merge remote-tracking branch 'origin/main' into fix/existing-test-failures-20260812

This commit is contained in:
2026-08-13 00:52:28 +00:00
82 changed files with 2013 additions and 849 deletions
@@ -79,6 +79,7 @@ const DEFAULT_GENERAL_RICE = 1000;
const DEFAULT_CREW_TYPE_ID = 1100;
const MAX_GENERAL_TURNS = 30;
const DEFAULT_TURN_ACTION = '휴식';
export const JOIN_WELCOME_MESSAGE = '삼국지 모의전투 HiDCHe의 세계에 오신 것을 환영합니다 ^o^';
const LEGACY_TIMEZONE_OFFSET_MS = 9 * 60 * 60 * 1000;
const LEGACY_JOIN_REMOVED_CHARACTERS = /[\\/`#|-]/gu;
@@ -460,7 +461,7 @@ const pushCreationLogs = (
logger.pushGeneralHistoryLog(`<Y>${options.name}</>, <G>${options.cityName}</>에서 큰 뜻을 품다.`);
logger.pushGeneralActionLog(
[
'삼국지 모의전투 PHP의 세계에 오신 것을 환영합니다 ^o^',
JOIN_WELCOME_MESSAGE,
'처음 하시는 경우에는 <D>도움말</>을 참고하시고,',
'문의사항이 있으시면 게시판에 글을 남겨주시면 되겠네요~',
'부디 즐거운 삼모전 되시길 바랍니다 ^^',
@@ -6,10 +6,12 @@ import {
EventDomesticTraitLoader,
isEventDomesticTraitKey,
isPersonalityTraitKey,
isWarTraitKey,
LogCategory,
LogScope,
PERSONALITY_TRAIT_KEYS,
simpleSerialize,
WarTraitLoader,
} from '@sammo-ts/logic';
import type { DatabaseClient, GamePrisma as GamePrismaTypes } from '@sammo-ts/infra';
@@ -78,6 +80,8 @@ export interface SelectPoolCandidateDto {
specialDomesticName: string;
specialDomesticInfo: string;
specialWar: string | null;
specialWarName: string | null;
specialWarInfo: string;
ego: string | null;
dex: [number, number, number, number, number];
imageServer: 0 | 1;
@@ -158,11 +162,16 @@ const candidateWeight = (candidate: SelectPoolCandidateInfo): number =>
candidate.dex.reduce((sum, value) => sum + value, 0);
const eventDomesticTraitLoader = new EventDomesticTraitLoader();
const warTraitLoader = new WarTraitLoader();
const toCandidateDto = async (candidate: SelectPoolCandidateInfo): Promise<SelectPoolCandidateDto> => {
const trait = isEventDomesticTraitKey(candidate.specialDomestic)
? await eventDomesticTraitLoader.load(candidate.specialDomestic)
: null;
const warTrait =
candidate.specialWar && isWarTraitKey(candidate.specialWar)
? await warTraitLoader.load(candidate.specialWar)
: null;
return {
uniqueName: candidate.uniqueName,
generalName: candidate.generalName,
@@ -173,6 +182,8 @@ const toCandidateDto = async (candidate: SelectPoolCandidateInfo): Promise<Selec
specialDomesticName: trait?.name ?? candidate.specialDomestic.replace(/^che_event_/, ''),
specialDomesticInfo: trait?.info ?? '',
specialWar: candidate.specialWar ?? null,
specialWarName: warTrait?.name ?? candidate.specialWar?.replace(/^che_(?:event_)?/u, '') ?? null,
specialWarInfo: warTrait?.info ?? '',
ego: candidate.ego ?? null,
dex: candidate.dex,
imageServer: candidate.imgsvr,