Created
October 27, 2012 23:52
-
-
Save shripadk/3966915 to your computer and use it in GitHub Desktop.
manager.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Manager.prototype.initStore = function () { | |
this.handshaken = {}; | |
this.connected = {}; | |
this.open = {}; | |
this.closed = {}; | |
this.rooms = {}; | |
this.roomClients = {}; | |
var self = this; | |
this.store.subscribe('handshake', function (id, data) { | |
self.onHandshake(id, data); | |
}); | |
this.store.subscribe('connect', function (id) { | |
self.onConnect(id); | |
}); | |
this.store.subscribe('open', function (id) { | |
self.onOpen(id); | |
}); | |
this.store.subscribe('join', function (id, room) { | |
self.onJoin(id, room); | |
}); | |
this.store.subscribe('leave', function (id, room) { | |
self.onLeave(id, room); | |
}); | |
this.store.subscribe('close', function (id) { | |
self.onClose(id); | |
}); | |
this.store.subscribe('kick', function(id) { | |
self.onClientDisconnect(id, "socket end"); | |
}); | |
this.store.subscribe('dispatch', function (room, packet, volatile, exceptions) { | |
self.onDispatch(room, packet, volatile, exceptions); | |
}); | |
this.store.subscribe('disconnect', function (id) { | |
self.onDisconnect(id); | |
}); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment