add users on join

This commit is contained in:
Jeena Paradies 2012-07-13 23:39:07 +02:00
parent e43fbc5223
commit e751210345
2 changed files with 9 additions and 1 deletions

View file

@ -12,9 +12,11 @@ define(["Chuck/ServerGame"], function(ServerGame) {
}
Channel.prototype.addUser = function(user){
var userIds = Object.keys(this.users);
this.users[user.id] = user;
user.sendCommand('joinSuccess', {channelName: this.name, id: user.id});
user.sendCommand('joinSuccess', {channelName: this.name, id: user.id, userIds: userIds});
this.sendCommandToAllUsersExcept('userJoined', user.id, user);
this.serverGame.createPlayerForUser(user)