diff --git a/src/views/Lobby.vue b/src/views/Lobby.vue index 0f030cc..053d600 100644 --- a/src/views/Lobby.vue +++ b/src/views/Lobby.vue @@ -36,8 +36,7 @@
- -
+
@@ -108,6 +107,12 @@ export default { ban: false, }); }, + start_game() { + this.$socket.emit(`StartGame`, { + game_code: this.game_code, + user: this.username, + }); + }, }, sockets: { PlayerList(data) { @@ -156,6 +161,19 @@ export default { }, 3000); }; }, + Starting(data) { + if (!data.success) { + this.$emit(`alert`, { + message: data.message, + classes: [`error`] + }); + setTimeout(() => { + this.$emit(`alert`, { message: ``, classes: [] }, 3000) + }) + } else { + this.$emit(`go-to`, `in-game`); + }; + } }, }