Add rulesets
This commit is contained in:
parent
43065902ae
commit
8ed8449b11
2 changed files with 5 additions and 1 deletions
|
@ -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) {
|
||||||
|
|
|
@ -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>
|
||||||
|
|
Loading…
Reference in a new issue