-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrooms-server.js
More file actions
17 lines (16 loc) · 909 Bytes
/
Copy pathrooms-server.js
File metadata and controls
17 lines (16 loc) · 909 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
//room-server.js
if (Meteor.isServer) {
Meteor.startup(function () {
Meteor.methods({
createRoom: function(name) {
Gamestate.insert({ name: name, daytime: true, day: 1, winning_team: null });
},
joinGame: function(roomId) {
Meteor.users.update({ _id: Meteor.userId() }, { $set: { 'profile.roomId': roomId, 'profile.alive': false, 'profile.role': null, 'profile.team': null, 'profile.death': null, 'profile.death_location': null, 'profile.reveal_role': null, 'profile.reveal_team': null } })
},
clearData: function () {
Meteor.users.update({ _id: Meteor.userId() }, { $set: { 'profile.roomId': null, 'profile.alive': false, 'profile.role': null, 'profile.team': null, 'profile.death': null, 'profile.death_location': null, 'profile.reveal_role': null, 'profile.reveal_team': null } })
},
})
})
}