debug
This commit is contained in:
parent
66fb5411b4
commit
b5aec17dd4
|
|
@ -12,11 +12,6 @@ export const useWebsocketStore = defineStore("websocket", {
|
||||||
init(gameId) {
|
init(gameId) {
|
||||||
const player = usePlayerStore()
|
const player = usePlayerStore()
|
||||||
const game = useGameStore()
|
const game = useGameStore()
|
||||||
console.log(game, game.opponent.id, player.id)
|
|
||||||
if (window.location.pathname != '/lobby/' + game.id && (game.owner == player.id || game.opponent.id == player.id)) {
|
|
||||||
window.location.href = window.location.origin + '/lobby/' + game.id
|
|
||||||
return
|
|
||||||
}
|
|
||||||
this.connection = new WebSocket(connectionUrl + "?gameId=" + gameId + "&playerId=" + player.id);
|
this.connection = new WebSocket(connectionUrl + "?gameId=" + gameId + "&playerId=" + player.id);
|
||||||
this.connection.onopen = function (event) {
|
this.connection.onopen = function (event) {
|
||||||
console.log(event);
|
console.log(event);
|
||||||
|
|
|
||||||
|
|
@ -12,6 +12,11 @@ const player = usePlayerStore()
|
||||||
const game = useGameStore()
|
const game = useGameStore()
|
||||||
const bot = useBotStore()
|
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()
|
game.$reset()
|
||||||
bot.$reset()
|
bot.$reset()
|
||||||
localStorage.removeItem('game')
|
localStorage.removeItem('game')
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user