Commit 72d99f09 authored by chechunchi's avatar chechunchi

finish service

parent 5dd4731c
Pipeline #21849 passed with stages
in 15 minutes and 5 seconds
import { ygopro } from "@/api"; import { fetchCard, ygopro } from "@/api";
import { sleep } from "@/infra";
import { matStore } from "@/stores";
export default async ( export default async (
confirmDeskTop: ygopro.StocGameMessage.MsgConfirmDeskTop confirmDeskTop: ygopro.StocGameMessage.MsgConfirmDeskTop
) => { ) => {
console.log(confirmDeskTop); const cards = confirmDeskTop.cards;
for (const card of cards) {
const target = matStore
.in(card.location)
.of(card.controler)
.at(card.sequence);
if (target) {
// 设置`occupant`
const meta = await fetchCard(card.code);
target.occupant = meta;
// 聚焦1s
target.focus = true;
await sleep(1000);
target.focus = false;
await sleep(200);
} else {
console.warn(`card of ${card} is null`);
}
}
}; };
...@@ -284,7 +284,7 @@ export default async function handleGameMsg(pb: ygopro.YgoStocMsg) { ...@@ -284,7 +284,7 @@ export default async function handleGameMsg(pb: ygopro.YgoStocMsg) {
break; break;
} }
case "confirm_desktop": { case "confirm_desktop": {
onConfirmDeskTop(msg.confirm_desktop); await onConfirmDeskTop(msg.confirm_desktop);
break; break;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment