From 458e310086a52ac748caf6afdb0be6dd1ab350fd Mon Sep 17 00:00:00 2001
From: Michael Zhang
Date: Thu, 14 Jan 2021 14:09:01 -0600
Subject: [PATCH] a
---
.meteor/packages | 1 +
.meteor/versions | 5 +++++
imports/ui/App.vue | 19 ++++++++++++++++---
imports/ui/components/WaitingRoom.vue | 12 +++++++++++-
4 files changed, 33 insertions(+), 4 deletions(-)
diff --git a/.meteor/packages b/.meteor/packages
index cd6d70f..ac08e79 100644
--- a/.meteor/packages
+++ b/.meteor/packages
@@ -22,3 +22,4 @@ akryum:vue-component # Vue-CLI template to publish components
meteortesting:mocha # A package for writing and running your meteor app and package tests with mocha
johanbrook:publication-collector # Test a Meteor publication by collecting its output
+accounts-base
diff --git a/.meteor/versions b/.meteor/versions
index 32c30a5..93431f0 100644
--- a/.meteor/versions
+++ b/.meteor/versions
@@ -1,3 +1,4 @@
+accounts-base@1.7.0
akryum:vue-component@0.15.2
akryum:vue-component-dev-client@0.4.7
akryum:vue-component-dev-server@0.1.4
@@ -16,6 +17,7 @@ check@1.3.1
ddp@1.4.0
ddp-client@2.3.3
ddp-common@1.4.0
+ddp-rate-limiter@1.0.9
ddp-server@2.3.2
deps@1.0.12
diff-sequence@1.1.1
@@ -37,6 +39,7 @@ inter-process-messaging@0.1.1
johanbrook:publication-collector@1.1.0
launch-screen@1.2.0
livedata@1.0.18
+localstorage@1.2.0
logging@1.1.20
meteor@1.9.3
meteor-base@1.4.0
@@ -59,10 +62,12 @@ npm-mongo@3.8.1
ordered-dict@1.1.0
promise@0.11.2
random@1.2.0
+rate-limit@1.0.9
reactive-var@1.0.11
reload@1.3.0
retry@1.1.0
routepolicy@1.1.0
+service-configuration@1.0.11
shell-server@0.5.0
socket-stream-client@0.3.1
spacebars-compiler@1.1.3
diff --git a/imports/ui/App.vue b/imports/ui/App.vue
index c75e4e9..a37015f 100644
--- a/imports/ui/App.vue
+++ b/imports/ui/App.vue
@@ -8,6 +8,8 @@
v-on:newGame="newGame"
v-on:joinGame="joinGame"
>
+
+ User ID: {{ userId }}
@@ -39,21 +41,32 @@ export default {
data() {
return {
roomInfo: null,
- whatScreen: Lobby,
};
},
+ computed: {
+ whatScreen: function() {
+ if (this.roomInfo === null)
+ return Lobby;
+ else if (this.currentRoom === null || this.currentRoom.state === "waitingRoom")
+ return WaitingRoom;
+ },
+
+ userId: function() {
+ console.log("userId", Meteor.userId());
+ return Meteor.userId();
+ },
+ },
+
methods: {
newGame: function(args) {
this.roomInfo = args;
- this.whatScreen = WaitingRoom;
Meteor.subscribe("players", args.roomId);
Meteor.subscribe("currentRoom", args.roomId);
},
joinGame: function(args) {
this.roomInfo = args;
- this.whatScreen = WaitingRoom;
Meteor.subscribe("players", args.roomId);
Meteor.subscribe("currentRoom", args.roomId);
},
diff --git a/imports/ui/components/WaitingRoom.vue b/imports/ui/components/WaitingRoom.vue
index cd2d39c..f38bae5 100644
--- a/imports/ui/components/WaitingRoom.vue
+++ b/imports/ui/components/WaitingRoom.vue
@@ -13,7 +13,11 @@
-
+
+
+
@@ -47,6 +51,12 @@ export default {
return val;
},
},
+
+ methods: {
+ start: function() {
+ Meteor.call("startGame");
+ },
+ },
}