mirror of
https://github.com/logsol/chuck.js.git
synced 2026-05-11 10:37:34 +00:00
replaced all tabs with 4 spaces
This commit is contained in:
parent
5d11540c55
commit
26f3d22db7
30 changed files with 1017 additions and 1011 deletions
|
|
@ -1,36 +1,36 @@
|
|||
define([
|
||||
'socket.io'
|
||||
'socket.io'
|
||||
],
|
||||
|
||||
function(io) {
|
||||
|
||||
function Socket(server, options, coordinator) {
|
||||
function Socket(server, options, coordinator) {
|
||||
options.logLevel = typeof options.logLevel != 'undefined'
|
||||
? options.logLevel
|
||||
: 0;
|
||||
|
||||
this.coordinator = coordinator;
|
||||
this.socket = io.listen(server);
|
||||
this.coordinator = coordinator;
|
||||
this.socket = io.listen(server);
|
||||
|
||||
this.init(options);
|
||||
}
|
||||
this.init(options);
|
||||
}
|
||||
|
||||
Socket.prototype.init = function(options){
|
||||
Socket.prototype.init = function(options){
|
||||
|
||||
var self = this;
|
||||
this.socket.configure('development', function(){
|
||||
this.set('log level', options.logLevel);
|
||||
});
|
||||
var self = this;
|
||||
this.socket.configure('development', function(){
|
||||
this.set('log level', options.logLevel);
|
||||
});
|
||||
|
||||
this.socket.on('connection', function(user){
|
||||
self.onConnection(user);
|
||||
});
|
||||
}
|
||||
this.socket.on('connection', function(user){
|
||||
self.onConnection(user);
|
||||
});
|
||||
}
|
||||
|
||||
Socket.prototype.onConnection = function(socketLink){
|
||||
this.coordinator.createUser(socketLink);
|
||||
}
|
||||
Socket.prototype.onConnection = function(socketLink){
|
||||
this.coordinator.createUser(socketLink);
|
||||
}
|
||||
|
||||
return Socket;
|
||||
|
||||
return Socket;
|
||||
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue