diff --git a/src/components/Menu.vue b/src/components/Menu.vue index 734a8e3..c8d6649 100644 --- a/src/components/Menu.vue +++ b/src/components/Menu.vue @@ -233,6 +233,7 @@ export default { } }, hostSession() { + if (this.session.sessionId) return; const sessionId = prompt( "Enter a channel number / name for your session", Math.round(Math.random() * 10000) @@ -277,6 +278,7 @@ export default { } }, joinSession() { + if (this.session.sessionId) return; const sessionId = prompt( "Enter the channel number / name of the session you want to join" ); diff --git a/src/store/socket.js b/src/store/socket.js index b018833..d6de6aa 100644 --- a/src/store/socket.js +++ b/src/store/socket.js @@ -423,13 +423,14 @@ class LiveSession { } /** - * Update a player based on incoming data. + * Update a player based on incoming data. Player only. * @param index * @param property * @param value * @private */ _updatePlayer({ index, property, value }) { + if (!this._isSpectator) return; const player = this._store.state.players.players[index]; if (!player) return; // special case where a player stops being a traveler @@ -559,7 +560,7 @@ class LiveSession { this._store.commit("players/update", { player, property, value }); } // update player session list as if this was a ping - this._handlePing([true, value]); + this._handlePing([true, value, 0]); } /**