细节优化
This commit is contained in:
@@ -57,6 +57,24 @@ async function onReceiveMessage(messages = []) {
|
||||
if (msg.constructor === MESSAGETYPES.ShootResult) {
|
||||
if (melee.value && msg.userId !== user.value.id) return;
|
||||
if (msg.userId === user.value.id) currentShot.value++;
|
||||
if (msg.battleInfo && msg.userId === user.value.id) {
|
||||
const players = [
|
||||
...(msg.battleInfo.blueTeam || []),
|
||||
...(msg.battleInfo.redTeam || []),
|
||||
];
|
||||
const currentPlayer = players.find((p) => p.id === msg.userId);
|
||||
currentShot.value = 0;
|
||||
try {
|
||||
if (
|
||||
currentPlayer &&
|
||||
currentPlayer.shotHistory &&
|
||||
currentPlayer.shotHistory[msg.battleInfo.currentRound]
|
||||
) {
|
||||
currentShot.value =
|
||||
currentPlayer.shotHistory[msg.battleInfo.currentRound].length;
|
||||
}
|
||||
} catch (_) {}
|
||||
}
|
||||
if (!halfTime.value && msg.target) {
|
||||
currentSound.value = msg.target.ring
|
||||
? `${msg.target.ring}环`
|
||||
|
||||
Reference in New Issue
Block a user