@@ -3,7 +3,7 @@ import { adminStorage } from '../services/storage';
33import { AdminDomainApis } from '../services/domainApi' ;
44import { buildAcceptanceAssertionGroups , buildAcceptanceTraceTree , filterAcceptanceCases , flattenAcceptanceTraceTree , toText as acceptanceToText } from '../services/skillAcceptanceAnalysis' ;
55import { buildSkillAnalysisEntityRelations , buildSkillAnalysisFilterOptions , buildSkillAnalysisTree , buildTimelineFromAnalysisNodes , buildTimelineFromRuntimeEvents , createDefaultSkillAnalysisFilter , filterSkillAnalysisNodes , flattenSkillAnalysisTree } from '../services/skillAnalysisProjection' ;
6- import type { AdminApiCallLogItem , AdminClusterDiagnostics , AdminDashboardResponse , AdminServerOperationResponse , AdminServerStatus , AdminSkillAcceptanceArtifactDirectoryList , AdminSkillAcceptanceBatch , AdminSkillAcceptanceCase , AdminSkillAcceptanceDeleteResponse , AdminSkillAcceptanceRunPlan , AdminSkillAcceptanceRunRequest , AdminSkillAcceptanceRunResponse , AdminSkillAcceptanceTemplateList , AdminSkillAnalysisModel , AdminSkillDiagnosticsEvents , AdminSkillDiagnosticsSummary , ApiResult , CreateRoomResponse , GameplayDescriptor , RestoreRoomResponse , RoomRuntimeState , RoomSnapshot , RoomSummary , SessionResponse , ShooterSandboxState , ShooterWorldDiagnostics , SkillAnalysisFlatNodeProjection } from '../types' ;
6+ import type { AddRoomRobotsResponse , AdminApiCallLogItem , AdminClusterDiagnostics , AdminDashboardResponse , AdminServerOperationResponse , AdminServerStatus , AdminSkillAcceptanceArtifactDirectoryList , AdminSkillAcceptanceBatch , AdminSkillAcceptanceCase , AdminSkillAcceptanceDeleteResponse , AdminSkillAcceptanceRunPlan , AdminSkillAcceptanceRunRequest , AdminSkillAcceptanceRunResponse , AdminSkillAcceptanceTemplateList , AdminSkillAnalysisModel , AdminSkillDiagnosticsEvents , AdminSkillDiagnosticsSummary , ApiResult , CreateRoomResponse , GameplayDescriptor , RestoreRoomResponse , RoomRuntimeState , RoomSnapshot , RoomSummary , SessionResponse , ShooterSandboxState , ShooterWorldDiagnostics , SkillAnalysisFlatNodeProjection } from '../types' ;
77
88const apis = new AdminDomainApis ( ) ;
99
@@ -31,6 +31,7 @@ const acceptanceTemplates = ref<AdminSkillAcceptanceTemplateList | null>(null);
3131const acceptanceLastRun = ref < AdminSkillAcceptanceRunResponse | null > ( null ) ;
3232const shooterWorldDiagnostics = ref < ShooterWorldDiagnostics | null > ( null ) ;
3333const lastResponse = ref ( '' ) ;
34+ const lastRobotAdd = ref < AddRoomRobotsResponse | null > ( null ) ;
3435const apiCallLog = ref < AdminApiCallLogItem [ ] > ( [ ] ) ;
3536let apiCallLogId = 0 ;
3637
@@ -40,6 +41,7 @@ const battle = reactive({ gameplayId: 2, ruleSetId: 0, configVersion: 1, protoco
4041const skillLoadout = reactive ( { heroId : 1 , teamId : 1 , spawnPointId : 1 , level : 1 , attributeTemplateId : 1 , basicAttackSkillId : 1001 , skillIdsText : '1002,1003,1004' } ) ;
4142const skillEventFilter = reactive < { battleId : string ; actorId : number | null ; skillId : number | null ; limit : number } > ( { battleId : '' , actorId : null , skillId : null , limit : 100 } ) ;
4243const sandbox = reactive < { sandboxId : string ; botCount : number ; maxPlayers : number ; tickRate : number ; state : ShooterSandboxState | null } > ( { sandboxId : 'default' , botCount : 3 , maxPlayers : 4 , tickRate : 30 , state : null } ) ;
44+ const roomRobots = reactive ( { count : 1 , accountPrefix : 'room-robot' , autoReady : true , mountBattleAi : true , battleAiProfileId : 'simple-battle' } ) ;
4345const serverOperation = reactive ( { reason : '后台控制台操作' } ) ;
4446const acceptance = reactive ( { artifactDirectory : 'artifacts/moba-acceptance' , selectedCaseId : '' , selectedCaseIds : [ ] as string [ ] , traceLimit : 500 , statusFilter : 'all' , searchText : '' , categoryFilter : '' , tagFilter : '' , sortKey : 'caseId' , selectedTemplateId : 'single-skill-damage' , runCaseId : '' , runDescription : '后台参数化战斗分析导出' , runActorId : 1 , runTargetActorId : 2 , runSkillId : 1002 , runEffectId : 2001 , runProjectileId : 0 , runAreaId : 0 , runBuffId : 0 , runShieldId : 5001 , runBaseDamage : 120 , runMitigatedDamage : 96 , runShieldAbsorb : 60 , runHpDamage : 36 , runTickRate : 30 , runDurationFrames : 12 , runOperatorReason : '后台战斗分析导出' } ) ;
4547const acceptanceAnalysisFilter = reactive ( createDefaultSkillAnalysisFilter ( ) ) ;
@@ -689,6 +691,17 @@ async function setRoomReady(ready: boolean): Promise<void> {
689691 await refreshDashboard ( ) ;
690692}
691693
694+ async function addRoomRobots ( ) : Promise < void > {
695+ if ( ! effectiveRoomId . value ) return ;
696+ const data = await call < AddRoomRobotsResponse > ( apis . rooms . addRobots ( { sessionToken : sessionToken . value , roomId : effectiveRoomId . value , count : Number ( roomRobots . count || 1 ) , accountPrefix : roomRobots . accountPrefix || null , autoReady : roomRobots . autoReady === true , mountBattleAi : roomRobots . mountBattleAi === true , battleAiProfileId : roomRobots . battleAiProfileId || 'simple-battle' } ) ) ;
697+ if ( ! data ) return ;
698+ lastRobotAdd . value = data ;
699+ snapshot . value = data . snapshot ;
700+ roomId . value = data . roomId || roomId . value ;
701+ await refreshDashboard ( ) ;
702+ await refreshSkillDiagnostics ( ) ;
703+ }
704+
692705async function startBattle ( ) : Promise < void > {
693706 await call ( apis . rooms . startBattle ( { sessionToken : sessionToken . value , roomId : roomId . value , gameplayId : Number ( battle . gameplayId || 0 ) , ruleSetId : Number ( battle . ruleSetId || 0 ) , configVersion : Number ( battle . configVersion || 1 ) , protocolVersion : Number ( battle . protocolVersion || 1 ) , worldType : battle . worldType || null , clientId : 'admin-console' , syncTemplateId : battle . syncTemplateId || null , syncModel : null , networkEnvironmentId : 'admin-console' , carrierName : 'admin' , enableAuthoritativeWorld : true , interpolationEnabled : true , inputDelayFrames : 0 } ) ) ;
694707 await refreshDashboard ( ) ;
@@ -742,13 +755,15 @@ export function useAdminConsoleStore() {
742755 acceptanceLastRun,
743756 shooterWorldDiagnostics,
744757 lastResponse,
758+ lastRobotAdd,
745759 apiCallLog,
746760 account,
747761 create,
748762 battle,
749763 skillLoadout,
750764 skillEventFilter,
751765 sandbox,
766+ roomRobots,
752767 serverOperation,
753768 acceptance,
754769 acceptanceAnalysisFilter,
@@ -843,6 +858,7 @@ export function useAdminConsoleStore() {
843858 closeRoom,
844859 setRoomReady,
845860 startShooterRoomQuick,
861+ addRoomRobots,
846862 startBattle,
847863 startShooterSandbox,
848864 refreshShooterSandboxState,
0 commit comments