Permalink
Browse files

Fixing bug when client quit.

  • Loading branch information...
1 parent bf57ea7 commit db1df5024516d6a7c46d6c2d8bbdc03879f8595f @adngdb adngdb committed Jul 23, 2011
Showing with 4 additions and 2 deletions.
  1. +4 −2 node/server.js
View
@@ -80,8 +80,8 @@ everyone.on('connect', function() {
everyone.on('disconnect', function() {
var group = nowjs.getGroup(this.now.roomID);
- if (group.now.player == this.user.clientId) {
- group.now.player = null;
+ if (group.player == this.user.clientId) {
+ group.player = null;
}
});
@@ -94,6 +94,8 @@ function joinGroup(groupId, client) {
group.player = client.user.clientId;
}
+ util.log(group.player);
+
if (!group.now.amITheCurrentPlayer) {
group.now.amITheCurrentPlayer = function() {
if (nowjs.getGroup(this.now.roomID).player == this.user.clientId) {

0 comments on commit db1df50

Please sign in to comment.