Add rulesets

This commit is contained in:
Michael Zhang 2020-11-27 02:23:31 -06:00
parent 43065902ae
commit 8ed8449b11
Signed by: michael
GPG key ID: BDA47A31A3C8EE6B
2 changed files with 5 additions and 1 deletions

View file

@ -11,6 +11,9 @@ Meteor.methods({
let roomId = undefined; let roomId = undefined;
let state = "waitingRoom"; let state = "waitingRoom";
let ruleset = {
decks: 2,
};
// attempt to get a valid room code 10 times // attempt to get a valid room code 10 times
let remainingAttempts = 10; let remainingAttempts = 10;
@ -20,7 +23,7 @@ Meteor.methods({
let started = new Date(); let started = new Date();
try { try {
let result = Rooms.insert({ joinCode, started, state }); let result = Rooms.insert({ joinCode, started, state, ruleset });
roomId = result; roomId = result;
break; break;
} catch (e) { } catch (e) {

View file

@ -4,6 +4,7 @@
<p>Join code: {{ currentRoom.joinCode }}</p> <p>Join code: {{ currentRoom.joinCode }}</p>
<p>State: {{ currentRoom.state }} <p>State: {{ currentRoom.state }}
<p>Owner: {{ playerNames[currentRoom.owner] }}</p> <p>Owner: {{ playerNames[currentRoom.owner] }}</p>
<p>Rules: <br /><pre>{{ JSON.stringify(currentRoom.ruleset, null, 2) }}</pre></p>
<p> <p>
Players: Players:
<ul> <ul>