mirror of
https://github.com/logsol/chuck.js.git
synced 2026-05-11 10:37:34 +00:00
Added communication structure
This commit is contained in:
parent
980af70259
commit
94f63fc7b2
10 changed files with 292 additions and 129 deletions
22
lib/Server/Channel.js
Normal file
22
lib/Server/Channel.js
Normal 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;
|
||||
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue