Skip to content

Instantly share code, notes, and snippets.

@azizulhakim
Created October 29, 2016 04:40
Show Gist options
  • Save azizulhakim/080de549d4903b1800079b79d38ab02a to your computer and use it in GitHub Desktop.
Save azizulhakim/080de549d4903b1800079b79d38ab02a to your computer and use it in GitHub Desktop.
socket.on('*', function(msg) {
isLoggedIn(socket.request, null, function(){
if (clientSockets[socket.request.sessionID]){
callbacks[msg.data[0]](io, socket, msg.data[1]);
}
else{
sockbase.onLogout(io, socket, null);
socket.emit('failure', 'you are logged out');
socket.disconnect();
console.log('disconnect');
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment