Trigger CreateGame event
This commit is contained in:
parent
878ccd1ed8
commit
8dce2a4284
1 changed files with 10 additions and 2 deletions
|
|
@ -18,7 +18,10 @@ export default {
|
||||||
methods: {
|
methods: {
|
||||||
createGame() {
|
createGame() {
|
||||||
let name = prompt(`What is your name?`);
|
let name = prompt(`What is your name?`);
|
||||||
console.log(`Creating a new game for ${name}`);
|
|
||||||
|
this.$socket.client.emit(`CreateGame`, {
|
||||||
|
name: name,
|
||||||
|
});
|
||||||
},
|
},
|
||||||
joinGame() {
|
joinGame() {
|
||||||
// Get the user's name
|
// Get the user's name
|
||||||
|
|
@ -39,7 +42,12 @@ export default {
|
||||||
},
|
},
|
||||||
sockets: {
|
sockets: {
|
||||||
GameJoined(data) {},
|
GameJoined(data) {},
|
||||||
GameCreated(data) {},
|
GameCreated(data) {
|
||||||
|
console.log(data)
|
||||||
|
if (200 <= data.status && data.status < 300) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
},
|
||||||
},
|
},
|
||||||
mounted() {},
|
mounted() {},
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue