Skip to content

Commit

Permalink
Fixing a few nowjs things.
Browse files Browse the repository at this point in the history
  • Loading branch information
gtramontina committed Jul 27, 2011
1 parent 655d914 commit 86883e5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
11 changes: 6 additions & 5 deletions lib/controllers/room.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ module.exports = (app, nowjs) ->
app.get '/:roomId', (req, res) ->
res.render 'writeboard', { title: 'Writeboard!', roomId: req.params.roomId }

everyone = nowjs.initialize app
everyone = nowjs.initialize app, socketio: 'log level': 2

everyone.now.joinRoom = (roomInfo, callback) ->
room = getRoom roomInfo

Expand Down Expand Up @@ -39,11 +40,11 @@ module.exports = (app, nowjs) ->
room = nowjs.getGroup roomInfo.id
return room if room.augumented

updateUserCount = -> room.count (numberOfPeople) ->
console.log '---------------->'+numberOfPeople
room.now.updateUserCount numberOfPeople
updateUserCount = -> room.count (numberOfPeople) -> room.now.updateUserCount numberOfPeople
room.on 'join', updateUserCount
room.on 'left', updateUserCount
room.on 'connect', updateUserCount
room.on 'disconnect', updateUserCount
room.on 'leave', updateUserCount

room.now.filter = (sourceClient, func, params...) -> @now[func] params... if sourceClient isnt @user.clientId
room.now.sendStartDrawing = (x, y) -> room.now.filter @user.clientId, 'startDrawing', x, y
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"dependencies" : {
"coffee-script" : ">=1.1.1",
"express" : ">=2.3.7",
"now" : "0.6.0",
"now" : ">=0.7.0",
"jade" : ">=0.11.0",
"stylus" : ">=0.13.0",
"nib" : ">=0.0.7"
Expand Down

0 comments on commit 86883e5

Please sign in to comment.