diff --git a/packages/main/coreLoader/index.ts b/packages/main/coreLoader/index.ts index 3cf316a2..6db67df3 100644 --- a/packages/main/coreLoader/index.ts +++ b/packages/main/coreLoader/index.ts @@ -272,7 +272,6 @@ class CoreLoader { } public GetCoreInstanceByUUID(uuid: string): any { - console.log('type of this.MeoAsstPtr[uuid]', typeof this.MeoAsstPtr[uuid]) return this.MeoAsstPtr[uuid] } diff --git a/packages/main/deviceDetector/adapters/winAdapter.ts b/packages/main/deviceDetector/adapters/winAdapter.ts index 6aaddba9..9ab11e5c 100644 --- a/packages/main/deviceDetector/adapters/winAdapter.ts +++ b/packages/main/deviceDetector/adapters/winAdapter.ts @@ -258,7 +258,7 @@ class WindowsAdapter implements EmulatorAdapter { } protected async getMumu12(e: Emulator): Promise { - e.config = 'MuMuEmulator' + e.config = 'MuMuEmulator12' e.displayName = 'MuMu模拟器12' const emuPath = await getPnamePath('MuMuPlayer.exe') // 模拟器启动器路径 e.adbPath = path.resolve(emuPath, '../adb.exe') // 模拟器adb路径 diff --git a/packages/main/hooks/asst.ts b/packages/main/hooks/asst.ts index 5d42db6f..b3c9d3c6 100644 --- a/packages/main/hooks/asst.ts +++ b/packages/main/hooks/asst.ts @@ -22,7 +22,7 @@ const hooks: IpcMainHandleEventCalleeProxy['CoreLoader'] = { }, initCoreAsync(arg) { const createStatus = core.CreateEx(arg.uuid) ?? false - if (!createStatus) logger.warn(`重复创建 ${JSON.stringify(arg)}`) + if (!createStatus) logger.warn(`Instance already exist! ${JSON.stringify(arg)}`) if (!core.SetTouchMode(arg.uuid, arg.touch_mode)) logger.warn('Set touch mode failed', arg.touch_mode) return core.AsyncConnect(arg.address, arg.uuid, arg.adb_path, arg.config) diff --git a/packages/renderer/src/components/Task/NewTask.vue b/packages/renderer/src/components/Task/NewTask.vue index 83736f20..23d4ffaf 100644 --- a/packages/renderer/src/components/Task/NewTask.vue +++ b/packages/renderer/src/components/Task/NewTask.vue @@ -71,10 +71,10 @@ const options: DropdownMixedOption[] = [ label: '无限肉鸽', key: 'Roguelike', }, - // { - // label: '生息演算', - // key: 'ReclamationAlgorithm' - // } + { + label: '生息演算', + key: 'ReclamationAlgorithm', + }, ], }, { diff --git a/packages/renderer/src/components/Task/configurations/Index.vue b/packages/renderer/src/components/Task/configurations/Index.vue index ad7ed2c3..3ae3a481 100644 --- a/packages/renderer/src/components/Task/configurations/Index.vue +++ b/packages/renderer/src/components/Task/configurations/Index.vue @@ -6,6 +6,7 @@ import Fighting from './Fighting.vue' import Infrast from './Infrast.vue' import Mall from './Mall.vue' import NoConfiguration from './NoConfiguration.vue' +import ReclamationAlgorithm from './ReclamationAlgorithm.vue' import Recruit from './Recruit.vue' import Rogue from './Rogue.vue' import Shutdown from './Shutdown.vue' @@ -20,6 +21,7 @@ const components: Record = { Roguelike: Rogue, Mall: Mall, Shutdown: Shutdown, + ReclamationAlgorithm: ReclamationAlgorithm, } export default defineComponent({ diff --git a/packages/renderer/src/components/Task/configurations/ReclamationAlgorithm.vue b/packages/renderer/src/components/Task/configurations/ReclamationAlgorithm.vue new file mode 100644 index 00000000..fd5d14a3 --- /dev/null +++ b/packages/renderer/src/components/Task/configurations/ReclamationAlgorithm.vue @@ -0,0 +1,70 @@ + + + + + diff --git a/packages/renderer/src/components/Task/results/Index.vue b/packages/renderer/src/components/Task/results/Index.vue index f261a7ba..46bc42a0 100644 --- a/packages/renderer/src/components/Task/results/Index.vue +++ b/packages/renderer/src/components/Task/results/Index.vue @@ -7,6 +7,7 @@ import Game from './Game.vue' import Infrast from './Infrast.vue' import Mall from './Mall.vue' import NoProgress from './NoProgress.vue' +import ReclamationAlgorithm from './ReclamationAlgorithm.vue' import Recruit from './Recruit.vue' import Rogue from './Rogue.vue' import Shutdown from './Shutdown.vue' diff --git a/packages/renderer/src/components/Task/results/ReclamationAlgorithm.vue b/packages/renderer/src/components/Task/results/ReclamationAlgorithm.vue new file mode 100644 index 00000000..ded2bbd8 --- /dev/null +++ b/packages/renderer/src/components/Task/results/ReclamationAlgorithm.vue @@ -0,0 +1,3 @@ + diff --git a/packages/renderer/src/hooks/events/callback.ts b/packages/renderer/src/hooks/events/callback.ts index 748b853e..22ab07b1 100644 --- a/packages/renderer/src/hooks/events/callback.ts +++ b/packages/renderer/src/hooks/events/callback.ts @@ -291,6 +291,20 @@ export default function useCallbackEvents(): void { deviceStore.updateDeviceStatus(uuid, 'disconnected') break } + case 'ConnectFailed': { + // FIXME: 这个事件中uuid是空字符串 + // if (messages[uuid]) { + // messages[uuid].destroy() + // } + // const device = deviceStore.getDevice(uuid) + switch (data.why) { + case 'ConfigNotFound': { + showMessage(`不支持的设备配置`, { type: 'error', duration:0, closable:true }, true) + // deviceStore.updateDeviceStatus(uuid, 'disconnected') + break + } + } + } default: break } diff --git a/packages/renderer/src/store/devices.ts b/packages/renderer/src/store/devices.ts index 10602805..5d1ac503 100644 --- a/packages/renderer/src/store/devices.ts +++ b/packages/renderer/src/store/devices.ts @@ -52,6 +52,7 @@ const useDeviceStore = defineStore<'device', DeviceState, {}, DeviceAction>('dev origin.address = device.address // origin.displayName = device.displayName origin.commandLine = device.commandLine + origin.config = device.config ?? 'General' } } }, diff --git a/packages/renderer/src/store/tasks.ts b/packages/renderer/src/store/tasks.ts index d6f20f1b..1186b4ba 100644 --- a/packages/renderer/src/store/tasks.ts +++ b/packages/renderer/src/store/tasks.ts @@ -41,7 +41,6 @@ type NoTemplateTask = | 'SSSCopilot' | 'Depot' | 'OperBox' - | 'ReclamationAlgorithm' | 'Custom' | 'SingleStep' | 'VideoRecognition' @@ -189,17 +188,17 @@ export const taskTemplate: { }, results: {}, }, - // ReclamationAlgorithm: { - // name: 'ReclamationAlgorithm', - // task_id: -1, - // title: '生息演算', - // status: 'idle', - // enable: false, - // configurations: { - // mode: 0 - // }, - // results: {} - // } + ReclamationAlgorithm: { + name: 'ReclamationAlgorithm', + task_id: -1, + title: '生息演算', + status: 'idle', + enable: false, + configurations: { + mode: 0 + }, + results: {} + } } function hasTemplate(task_name: Task['name']): task_name is Exclude { @@ -218,6 +217,7 @@ const defaultTaskConf: typeof taskTemplate = { Award: _.cloneDeep(taskTemplate.Award), Roguelike: _.cloneDeep(taskTemplate.Roguelike), Shutdown: _.cloneDeep(taskTemplate.Shutdown), + ReclamationAlgorithm: _.cloneDeep(taskTemplate.ReclamationAlgorithm) } export const defaultTask = Object.values(defaultTaskConf) diff --git a/packages/types/device/device.ts b/packages/types/device/device.ts index f8b483e9..2b19229f 100644 --- a/packages/types/device/device.ts +++ b/packages/types/device/device.ts @@ -82,4 +82,5 @@ export interface NativeDevice { adbPath?: string tag?: string commandLine?: string + config?: EmulatorName } diff --git a/packages/types/game/index.ts b/packages/types/game/index.ts index bf74c627..d2b7834f 100644 --- a/packages/types/game/index.ts +++ b/packages/types/game/index.ts @@ -3,6 +3,7 @@ export type * from './infrast' export type * from './recruit' export type * from './rogue' export * from './rogue' +export type * from './reclamation_algorithm' export type ClientType = 'Official' | 'Bilibili' | 'txwy' | 'YoStarEN' | 'YoStarJP' | 'YoStarKR' // 客户端资源类型, b服和官服都是CN diff --git a/packages/types/game/reclamation_algorithm.ts b/packages/types/game/reclamation_algorithm.ts new file mode 100644 index 00000000..51b36cab --- /dev/null +++ b/packages/types/game/reclamation_algorithm.ts @@ -0,0 +1,4 @@ +export type ReclamationAlgorithmType = 0 | 1 +// 模式,可选项。默认 0 +// 0 - 刷分与建造点,进入战斗直接退出 +// 1 - 刷赤金,联络员买水后基地锻造 \ No newline at end of file diff --git a/packages/types/task/callbackInfo/ConnectionInfo.ts b/packages/types/task/callbackInfo/ConnectionInfo.ts index bfd35717..d393b7f5 100644 --- a/packages/types/task/callbackInfo/ConnectionInfo.ts +++ b/packages/types/task/callbackInfo/ConnectionInfo.ts @@ -1,3 +1,5 @@ +type ConnectFailedWhy = 'ConfigNotFound' | 'Connection command failed to exec' | 'Uuid command failed to exec' | 'Display command failed to exec' | 'ConfigNotFound' + export type ConnectionInfoMapper = { Reconnecting: { why: '' @@ -22,7 +24,7 @@ export type ConnectionInfoMapper = { } } ConnectFailed: { - why: string // "ConfigNotFound" | "Connection command failed to exec" | "Uuid command failed to exec" | "Display command failed to exec" + why: ConnectFailedWhy details: { adb: string address: string @@ -89,11 +91,13 @@ export type ConnectionInfoMapper = { height: number } } + } type ConnectionInfoWhat = keyof ConnectionInfoMapper type ConnectionInfoCallbackTemplate = { + why?: ConnectionInfoMapper[What]['why'] uuid: string what: What } diff --git a/packages/types/task/mapper.ts b/packages/types/task/mapper.ts index 45ebf418..7490d435 100644 --- a/packages/types/task/mapper.ts +++ b/packages/types/task/mapper.ts @@ -3,6 +3,7 @@ import type { Facility, MizukiSquadType, PhantomSquadType, + ReclamationAlgorithmType, RolesType, Server, } from '@type/game' @@ -122,10 +123,6 @@ export type CoreTaskObjectMapper = { OperBox: { enable?: boolean } - ReclamationAlgorithm: { - enable?: boolean - mode: 0 | 1 - } Custom: { enable?: boolean task_names: string[] @@ -153,6 +150,10 @@ export type CoreTaskObjectMapper = { enable?: boolean filename: string } + ReclamationAlgorithm: { + enable?: boolean + mode: ReclamationAlgorithmType + } // Debug? }