debug
This commit is contained in:
parent
b5aec17dd4
commit
49b1b9bd13
|
|
@ -12,26 +12,31 @@ const player = usePlayerStore()
|
|||
const game = useGameStore()
|
||||
const bot = useBotStore()
|
||||
|
||||
if (game.owner == player.id || game.opponent.id == player.id) {
|
||||
window.location.href = window.location.origin + '/lobby/' + game.id
|
||||
return
|
||||
}
|
||||
|
||||
game.$reset()
|
||||
bot.$reset()
|
||||
localStorage.removeItem('game')
|
||||
localStorage.removeItem('bot')
|
||||
|
||||
const websocket = useWebsocketStore()
|
||||
if (player.id == null) player.initPlayer()
|
||||
websocket.init(route.params.gameId)
|
||||
|
||||
const join = () => {
|
||||
res = websocket.send({
|
||||
action: 'join',
|
||||
from: player.id
|
||||
})
|
||||
}
|
||||
|
||||
onBeforeMount(() => {
|
||||
console.log(game.owner, game.opponent.id, player.id)
|
||||
if (game.owner == player.id || game.opponent.id == player.id) {
|
||||
window.location.href = window.location.origin + '/lobby/' + game.id
|
||||
return
|
||||
}
|
||||
})
|
||||
|
||||
onMounted(() => {
|
||||
game.$reset()
|
||||
bot.$reset()
|
||||
localStorage.removeItem('game')
|
||||
localStorage.removeItem('bot')
|
||||
|
||||
const websocket = useWebsocketStore()
|
||||
if (player.id == null) player.initPlayer()
|
||||
websocket.init(route.params.gameId)
|
||||
})
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user