update:修复射箭无效只触发一次的问题
This commit is contained in:
@@ -318,6 +318,22 @@ function enqueueBattleMessage(message) {
|
|||||||
if (battleEnded && message.type !== MESSAGETYPESV2.BattleEnd) return;
|
if (battleEnded && message.type !== MESSAGETYPESV2.BattleEnd) return;
|
||||||
if (message.type === MESSAGETYPESV2.BattleEnd) battleEnded = true;
|
if (message.type === MESSAGETYPESV2.BattleEnd) battleEnded = true;
|
||||||
|
|
||||||
|
if (message.type === MESSAGETYPESV2.InvalidShot) {
|
||||||
|
const receivedAt = Date.now();
|
||||||
|
const order = ++queueOrder;
|
||||||
|
battleQueue.value.push({
|
||||||
|
message,
|
||||||
|
type: message.type,
|
||||||
|
key: `${message.type}:invalid:${receivedAt}:${order}`,
|
||||||
|
serverTime: 0,
|
||||||
|
receivedAt,
|
||||||
|
order,
|
||||||
|
});
|
||||||
|
sortBattleQueue();
|
||||||
|
runBattleQueue();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// 入队阶段只做排序、去重和时间边界判断,不直接改 UI。
|
// 入队阶段只做排序、去重和时间边界判断,不直接改 UI。
|
||||||
const serverTime = getServerTime(message);
|
const serverTime = getServerTime(message);
|
||||||
const key = getMessageKey(message);
|
const key = getMessageKey(message);
|
||||||
|
|||||||
Reference in New Issue
Block a user