From 2190a28845a9cfdd71652a743e02f26063005262 Mon Sep 17 00:00:00 2001 From: small268 <68784391+small268@users.noreply.github.com> Date: Tue, 14 Apr 2026 01:12:44 +0800 Subject: [PATCH] Enable phone auth mock and fix inventory build toast --- .env.local | 5 ++++- .../inventory/inventoryStoryActionService.ts | 16 +++++++--------- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/.env.local b/.env.local index b74994b6..bb3b6abd 100644 --- a/.env.local +++ b/.env.local @@ -6,5 +6,8 @@ DASHSCOPE_API_KEY="sk-65a0c6fa5e294b9887ace860f9d65990" EMBEDDING_MODEL="doubao-embedding-text-240715" VOLCENGINE_ACCESS_KEY_ID="AKLTZWFjMmYzZTdjZTIxNDRiNTkzMTZiMTk2NzVmNTUxOGI" VOLCENGINE_SECRET_ACCESS_KEY="TURRMk56bGhZalE0TjJReE5ERmpNMkpoTUdaa1lqRmtaVGt5TVRrM1lXSQ==" -WECHAT_AUTH_ENABLED="true" +WECHAT_AUTH_ENABLED="false" WECHAT_AUTH_PROVIDER="mock" + +SMS_AUTH_ENABLED="true" +SMS_AUTH_PROVIDER="mock" diff --git a/server-node/src/modules/inventory/inventoryStoryActionService.ts b/server-node/src/modules/inventory/inventoryStoryActionService.ts index bfea1371..39670c2f 100644 --- a/server-node/src/modules/inventory/inventoryStoryActionService.ts +++ b/server-node/src/modules/inventory/inventoryStoryActionService.ts @@ -4,9 +4,8 @@ import type { } from '../../../../packages/shared/src/contracts/story.js'; import { conflict, invalidRequest } from '../../errors.js'; import { - calculatePlayerBuildSnapshot, - type RuntimeGameState as BuildRuntimeGameState, -} from '../build/buildCalculationService.js'; + getPlayerBuildDamageBreakdown, +} from '../runtime/runtimeBuildModule.js'; import { craftForgeRecipe, dismantleInventoryItem, @@ -96,15 +95,14 @@ function refreshSessionFromGameState( export function buildBuildToast( nextState: InventoryMutationSuccess['nextState'], ) { - const snapshot = calculatePlayerBuildSnapshot( - nextState as BuildRuntimeGameState, - ); - if (!snapshot.ok) { + if (!nextState.playerCharacter) { return null; } - const buildMultiplier = - snapshot.value.buildBreakdown.buildDamageMultiplier.toFixed(2); + const buildMultiplier = getPlayerBuildDamageBreakdown( + nextState, + nextState.playerCharacter, + ).buildDamageMultiplier.toFixed(2); return `当前 Build 倍率 x${buildMultiplier}`; }