Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 20 additions & 17 deletions .meteor/packages
Original file line number Diff line number Diff line change
@@ -1,28 +1,31 @@
# Meteor packages used by this project, one per line.

# Check this file (and the other files in this directory) into your repository.

#

# 'meteor add' and 'meteor remove' will edit this file for you,

# but you can also edit it by hand.

fortawesome:fontawesome
momentjs:moment
meteor-base@1.5.1
mobile-experience@1.1.1
mongo@1.16.8
session@1.2.1
tracker@1.3.3
logging@1.3.3
reload@1.3.1
random@1.2.1
ejson@1.1.3
meteor-base@1.5.2
mobile-experience@1.1.2
mongo@2.0.2
session@1.2.2
tracker@1.3.4
logging@1.3.5
reload@1.3.2
random@1.2.2
ejson@1.1.4
spacebars
check@1.3.2
standard-minifier-js@2.8.1
shell-server@0.5.0
dynamic-import@0.7.3
underscore@1.6.0
fourseven:scss
seba:minifiers-autoprefixer
check@1.4.2
standard-minifier-js@3.0.0
shell-server@0.6.0
dynamic-import@0.7.4
underscore@1.6.4
blaze-html-templates
jquery
msavin:mongol
activitree:scss3
standard-minifier-css
2 changes: 1 addition & 1 deletion .meteor/release
Original file line number Diff line number Diff line change
@@ -1 +1 @@
METEOR@2.15
METEOR@3.0.3
160 changes: 80 additions & 80 deletions .meteor/versions
Original file line number Diff line number Diff line change
@@ -1,82 +1,82 @@
allow-deny@1.1.1
autoupdate@1.8.0
babel-compiler@7.10.5
babel-runtime@1.5.1
base64@1.0.12
binary-heap@1.0.11
blaze@2.9.0
blaze-html-templates@2.0.1
blaze-tools@1.1.4
boilerplate-generator@1.7.2
caching-compiler@1.2.2
caching-html-compiler@1.2.2
callback-hook@1.5.1
check@1.3.2
ddp@1.4.1
ddp-client@2.6.1
ddp-common@1.4.0
ddp-server@2.7.0
diff-sequence@1.1.2
dynamic-import@0.7.3
ecmascript@0.16.8
ecmascript-runtime@0.8.1
ecmascript-runtime-client@0.12.1
ecmascript-runtime-server@0.11.0
ejson@1.1.3
es5-shim@4.8.0
fetch@0.1.4
activitree:scss3@1.0.3
allow-deny@2.0.0
autoupdate@2.0.0
babel-compiler@7.11.0
babel-runtime@1.5.2
base64@1.0.13
binary-heap@1.0.12
blaze@3.0.0
blaze-html-templates@3.0.0
blaze-tools@2.0.0
boilerplate-generator@2.0.0
caching-compiler@2.0.0
caching-html-compiler@2.0.0
callback-hook@1.6.0
check@1.4.2
core-runtime@1.0.0
ddp@1.4.2
ddp-client@3.0.1
ddp-common@1.4.4
ddp-server@3.0.1
diff-sequence@1.1.3
dynamic-import@0.7.4
ecmascript@0.16.9
ecmascript-runtime@0.8.2
ecmascript-runtime-client@0.12.2
ecmascript-runtime-server@0.11.1
ejson@1.1.4
es5-shim@4.8.1
facts-base@1.0.2
fetch@0.1.5
fortawesome:fontawesome@4.7.0
fourseven:scss@4.16.0
geojson-utils@1.0.11
hot-code-push@1.0.4
html-tools@1.1.4
htmljs@1.2.1
id-map@1.1.1
inter-process-messaging@0.1.1
jquery@3.0.0
launch-screen@2.0.0
logging@1.3.3
meteor@1.11.5
meteor-base@1.5.1
meteortoys:toykit@10.0.0
minifier-css@1.6.4
minifier-js@2.7.5
minimongo@1.9.3
mobile-experience@1.1.1
mobile-status-bar@1.1.0
modern-browsers@0.1.10
modules@0.20.0
modules-runtime@0.13.1
geojson-utils@1.0.12
hot-code-push@1.0.5
html-tools@2.0.0
htmljs@2.0.1
id-map@1.2.0
inter-process-messaging@0.1.2
jquery@3.0.1
launch-screen@2.0.1
logging@1.3.5
meteor@2.0.1
meteor-base@1.5.2
minifier-css@2.0.0
minifier-js@3.0.0
minimongo@2.0.1
mobile-experience@1.1.2
mobile-status-bar@1.1.1
modern-browsers@0.1.11
modules@0.20.1
modules-runtime@0.13.2
momentjs:moment@2.30.1
mongo@1.16.9
mongo-decimal@0.1.3
mongo-dev-server@1.1.0
mongo-id@1.0.8
msavin:mongol@10.0.1
npm-mongo@4.17.2
observe-sequence@1.0.22
ordered-dict@1.1.0
promise@0.12.2
random@1.2.1
react-fast-refresh@0.2.8
reactive-dict@1.3.1
reactive-var@1.0.12
reload@1.3.1
retry@1.1.0
routepolicy@1.1.1
seba:minifiers-autoprefixer@2.0.1
session@1.2.1
shell-server@0.5.0
socket-stream-client@0.5.2
spacebars@1.6.0
spacebars-compiler@1.3.2
standard-minifier-js@2.8.1
templating@1.4.3
templating-compiler@1.4.2
templating-runtime@1.6.4
templating-tools@1.2.3
tracker@1.3.3
typescript@4.9.5
underscore@1.6.1
webapp@1.13.8
webapp-hashing@1.1.1
mongo@2.0.2
mongo-decimal@0.1.4
mongo-dev-server@1.1.1
mongo-id@1.0.9
npm-mongo@4.17.4
observe-sequence@2.0.0
ordered-dict@1.2.0
promise@1.0.0
random@1.2.2
react-fast-refresh@0.2.9
reactive-dict@1.3.2
reactive-var@1.0.13
reload@1.3.2
retry@1.1.1
routepolicy@1.1.2
session@1.2.2
shell-server@0.6.0
socket-stream-client@0.5.3
spacebars@2.0.0
spacebars-compiler@2.0.0
standard-minifier-css@1.9.3
standard-minifier-js@3.0.0
templating@1.4.4
templating-compiler@2.0.0
templating-runtime@2.0.0
templating-tools@2.0.0
tracker@1.3.4
typescript@5.4.3
underscore@1.6.4
webapp@2.0.2
webapp-hashing@1.1.2
5 changes: 5 additions & 0 deletions .postcss.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module.exports = {
plugins: {
autoprefixer: {},
},
};
12 changes: 6 additions & 6 deletions client/lib/methods.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
Meteor.methods({
// Meteor methods stubs to mimic real methods called on backend
// for the sake of latency compensation.
flipUpCard: function(gameId, thisMove, lastMove) {
return Games.update(
{_id: gameId, 'grid.idx': thisMove.cardIdx},
{$set: {'grid.$.class': 'turned-up player-' + thisMove.playerIdx}}
async flipUpCard(gameId, thisMove, lastMove) {
return await Games.updateAsync(
{ _id: gameId, "grid.idx": thisMove.cardIdx },
{ $set: { "grid.$.class": "turned-up player-" + thisMove.playerIdx } }
);
}
});
},
});
48 changes: 27 additions & 21 deletions client/lib/startup.js
Original file line number Diff line number Diff line change
@@ -1,34 +1,40 @@
Meteor.startup(function() {
Session.set('message', 'test message');
if (!(localStorage.getItem('sm_deviceId'))) {
Meteor.startup(async function () {
Session.set("message", "test message");
if (!localStorage.getItem("sm_deviceId")) {
// if no sm_deviceId, then try to get it from sm_gameId query

// if search fails genereate new id
var newId = new Meteor.Collection.ObjectID;
localStorage.setItem('sm_deviceId', newId._str);
var newId = new Meteor.Collection.ObjectID();
localStorage.setItem("sm_deviceId", newId._str);
}
Session.set('deviceId', localStorage.sm_deviceId);
Session.set('gameId', localStorage.sm_gameId);

Session.set("deviceId", localStorage.sm_deviceId);
Session.set("gameId", localStorage.sm_gameId);

// override current game if linked to new game
if (window.location.hash) {
var urlHash = window.location.hash.substring(1);
var urlOrigin = window.location.origin;
if (urlHash.length === 17) {
Session.set('gameId', '');
localStorage.setItem('sm_gameId', '');
Games.update(
{_id: urlHash},
{$addToSet: {players: {device: Session.get('deviceId'), matches: [], totalScore: 0, deviceName: 'Green'}}},
function(err, res) {
Session.set('gameId', urlHash);
localStorage.setItem('sm_gameId', urlHash);
window.location.href = urlOrigin;

Session.set('message', 'Game on! Player 2 has the first move.');
Session.set("gameId", "");
localStorage.setItem("sm_gameId", "");
await Games.updateAsync(
{ _id: urlHash },
{
$addToSet: {
players: {
device: Session.get("deviceId"),
matches: [],
totalScore: 0,
deviceName: "Green",
},
},
}
);
}
Session.set("gameId", urlHash);
localStorage.setItem("sm_gameId", urlHash);
window.location.href = urlOrigin;

Session.set("message", "Game on! Player 2 has the first move.");
}
}
});
});
Loading