fix(engine): finalize united events and auctions compatibly

This commit is contained in:
2026-07-31 14:56:57 +00:00
parent d8a893e6a8
commit bb6d2f524e
15 changed files with 995 additions and 138 deletions
@@ -1506,6 +1506,10 @@ async function handleAuctionOpen(
ctx: CommandHandlerContext,
command: Extract<TurnDaemonCommand, { type: 'auctionOpen' }>
): Promise<TurnDaemonCommandResult> {
const worldMeta = asRecord(ctx.world.getState().meta);
if (Number(worldMeta.isUnited ?? 0) !== 0 || Number(worldMeta.isunited ?? 0) !== 0) {
return { type: 'auctionOpen', ok: false, reason: '천하통일 후에는 경매를 이용할 수 없습니다.' };
}
return openAuction(command, ctx.world, ctx.commandDb);
}
@@ -1513,6 +1517,15 @@ async function handleAuctionBid(
ctx: CommandHandlerContext,
command: Extract<TurnDaemonCommand, { type: 'auctionBid' }>
): Promise<TurnDaemonCommandResult> {
const worldMeta = asRecord(ctx.world.getState().meta);
if (Number(worldMeta.isUnited ?? 0) !== 0 || Number(worldMeta.isunited ?? 0) !== 0) {
return {
type: 'auctionBid',
ok: false,
auctionId: command.auctionId,
reason: '천하통일 후에는 경매를 이용할 수 없습니다.',
};
}
if (!ctx.auctionBidder) {
return {
type: 'auctionBid',