Skip to content

Instantly share code, notes, and snippets.

View lorecrafting's full-sized avatar
📖
crafting lore!

lorecrafting lorecrafting

📖
crafting lore!
View GitHub Profile
var newdirs = ['e','w','s'];
for (var i = 0; i < newdirs.length; i++) {
Meteor.setTimeout(function(){
engine.movePlayer(newdirs[i]);
},3000);
}
'click #confirm': function() {
var selectedLine = Session.get('lineSelect');
if (selectedLine === 'line2') {
Session.set('selectedDragon', "Metal Dragon")
Session.set('leftUiStage', 2)
Session.set('rightUiStage', 2)
Meteor.users.update(Meteor.userId(),{$set: {profile: Dragons.find({_id: "Yn96cfK5MGPKZTKTN"}).fetch()[0]}})
//If I put the Meteror.users.update... line before the session.sets, the helper will update the database, but it won't set the sessions.
Template.addRoom.isBuilder = function(){
var currentUserEmail = Meteor.user().emails[0].address;
var builderEmail = 'builder@builder';
if (currentUserEmail === builderEmail){
return true;
} else{
return false;
}
};