Commit 992b8979 authored by Chunchi Che's avatar Chunchi Che

update small

parent 5220b672
Pipeline #22097 passed with stages
in 18 minutes and 59 seconds
......@@ -3,10 +3,6 @@
//
// 因此封装了一个`WebSocketStream`类,当每次Websocket连接中有消息到达时,往流中添加event,
// 同时执行器会不断地从流中获取event进行处理。
import { sleep } from "./sleep";
const SLEEP_INTERVAL = 200;
export class WebSocketStream {
public ws: WebSocket;
stream: ReadableStream;
......@@ -52,9 +48,7 @@ export class WebSocketStream {
return;
} else {
// websocket not closed, sleep sometime, wait for next message from server
await sleep(SLEEP_INTERVAL);
// websocket not closed, handle next message from server
return reader.read().then(process);
}
}
......
import { ygopro } from "@/api";
import { sleep } from "@/infra";
import { cardStore, fetchEsHintMeta, matStore } from "@/stores";
export default async (attack: ygopro.StocGameMessage.MsgAttack) => {
......@@ -18,7 +17,7 @@ export default async (attack: ygopro.StocGameMessage.MsgAttack) => {
if (attack.direct_attack) {
attacker.directAttack = true;
await sleep(500);
// await sleep(500);
attacker.directAttack = false;
} else {
const target = cardStore.at(
......@@ -33,7 +32,7 @@ export default async (attack: ygopro.StocGameMessage.MsgAttack) => {
...target,
};
await sleep(500);
// await sleep(500);
attacker.attackTarget = undefined;
}
}
......
import { ygopro } from "@/api";
import { useConfig } from "@/config";
import { eventbus, sleep, Task } from "@/infra";
import { eventbus, Task } from "@/infra";
import { cardStore, fetchEsHintMeta, matStore } from "@/stores";
export default async (chaining: ygopro.StocGameMessage.MsgChaining) => {
......@@ -11,7 +10,6 @@ export default async (chaining: ygopro.StocGameMessage.MsgChaining) => {
await cardStore.setChaining(chaining.location, chaining.code, true);
await sleep(useConfig().ui.chainingDelay);
const location = chaining.location;
// 恢复成非`chaining`状态
......
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