Refactor server-rs runtime and update related docs

This commit is contained in:
2026-04-25 14:29:44 +08:00
parent 019dd9efba
commit 6be3afe45a
56 changed files with 1561 additions and 1158 deletions

View File

@@ -784,7 +784,6 @@ function buildOpeningSceneSearchText(
return [
campScene.name,
campScene.description,
campScene.dangerLevel,
profile.playerGoal,
profile.summary,
'开局场景',
@@ -920,7 +919,6 @@ function buildLandmarkSearchText(
return [
landmark.name,
landmark.description,
landmark.dangerLevel,
...landmark.sceneNpcIds.map((npcId) => storyNpcById.get(npcId)?.name ?? ''),
...landmark.connections.flatMap((connection) => [
landmarkById.get(connection.targetLandmarkId)?.name ?? '',

View File

@@ -190,7 +190,6 @@ function createProfile(): CustomWorldProfile {
camp: {
name: '潮灯居',
description: '玩家最初落脚的旧灯塔内院。',
dangerLevel: 'medium',
},
landmarks: [],
creatorIntent: null,
@@ -215,7 +214,6 @@ function createProfileWithLandmark(): CustomWorldProfile {
id: 'landmark-1',
name: '沉钟栈桥',
description: '旧钟与潮声常年相撞的码头栈桥。',
dangerLevel: 'medium',
imageSrc: '/generated-custom-world-scenes/original-scene.png',
sceneNpcIds: ['story-1', 'story-2', 'story-3'],
connections: [],
@@ -277,7 +275,6 @@ function CampEditorFlowHarness() {
id: 'custom-scene-camp',
name: '潮灯居',
description: '玩家最初落脚的旧灯塔内院。',
dangerLevel: 'medium',
imageSrc: '/generated-custom-world-scenes/original-camp.png',
sceneNpcIds: ['story-1', 'story-2', 'story-3'],
connections: [

View File

@@ -182,7 +182,6 @@ const baseProfile = {
camp: {
name: '潮灯居',
description: '玩家最初落脚的旧灯塔内院。',
dangerLevel: 'medium',
},
anchorContent: {
worldPromise: {
@@ -233,7 +232,6 @@ const baseProfile = {
id: 'landmark-1',
name: '沉钟栈桥',
description: '旧钟与潮声常年相撞的码头栈桥。',
dangerLevel: 'medium',
sceneNpcIds: ['story-1'],
connections: [],
},

View File

@@ -352,9 +352,7 @@ export function GameCanvasEntityLayer({
const isCampCompanionEncounter =
encounter.specialBehavior === 'initial_companion'
|| encounter.specialBehavior === 'camp_companion';
const peacefulAnchorX = isCampCompanionEncounter
? RESOLVED_ENTITY_X_METERS
: encounter.xMeters ?? monsterAnchorMeters;
const peacefulAnchorX = RESOLVED_ENTITY_X_METERS;
const isPeacefulEncounterMoving =
(!isCampCompanionEncounter && sceneTransitionPhase !== 'idle')
|| Math.abs(peacefulAnchorX - RESOLVED_ENTITY_X_METERS) > 0.01;
@@ -373,10 +371,7 @@ export function GameCanvasEntityLayer({
const peacefulBottomOffsetPx = peacefulResolvedCharacter
? getCharacterBottomOffsetPx(stageLiftPx, peacefulResolvedCharacter)
: stageLiftPx + peacefulHostileBottomOffsetPx;
const peacefulNpcSpriteFacing =
encounter.kind === 'treasure' || peacefulResolvedCharacter
? towardPeacefulPlayer
: getRenderableNpcFacing(encounter, towardPeacefulPlayer, {medievalVisual: true});
const peacefulNpcSpriteFacing = towardPeacefulPlayer;
return (
<div

View File

@@ -241,7 +241,6 @@ export function createLandmarkDraft(
),
name: `自定义场景${profile.landmarks.length + 1}`,
description: '',
dangerLevel: '中',
imageSrc: undefined,
sceneNpcIds: profile.storyNpcs.slice(0, 3).map((npc) => npc.id),
connections: previousLandmark

View File

@@ -434,7 +434,6 @@ const compiledAgentDraftSession: CustomWorldAgentSessionSnapshot = {
id: 'landmark-1',
name: '回潮旧灯塔',
description: '旧灯塔是整片群岛最先看见异动的地方。',
dangerLevel: 'high',
sceneNpcIds: ['story-1'],
connections: [],
},