moved files towards new structure. fixes #22

This commit is contained in:
logsol 2012-07-21 21:20:29 +02:00
parent 8cf8f057bb
commit 9de3147406
40 changed files with 0 additions and 110 deletions

32
app/bootstrap/Socket.js Normal file
View file

@ -0,0 +1,32 @@
define(['socket.io'], function(io) {
function Socket(server, options, coordinator) {
options.logLevel = typeof options.logLevel != 'undefined'
? options.logLevel
: 0;
this.coordinator = coordinator;
this.socket = io.listen(server);
this.init(options);
}
Socket.prototype.init = function(options){
var self = this;
this.socket.configure('development', function(){
this.set('log level', options.logLevel);
});
this.socket.on('connection', function(user){
self.onConnection(user);
});
}
Socket.prototype.onConnection = function(socketLink){
this.coordinator.createUser(socketLink);
}
return Socket;
});