Added communication structure

This commit is contained in:
logsol 2012-07-08 01:37:53 +02:00
parent 980af70259
commit 94f63fc7b2
10 changed files with 292 additions and 129 deletions

22
lib/Server/Channel.js Normal file
View file

@ -0,0 +1,22 @@
define(function() {
function Channel(name) {
this.name = name;
this.users = {};
}
Channel.prototype.validateName = function(name){
return true;
}
Channel.prototype.addUser = function(user){
this.users[user.id] = user;
}
Channel.prototype.releaseUser = function(user){
delete this.users[user.id];
}
return Channel;
});