Created
October 6, 2010 19:41
-
-
Save dshaw/613945 to your computer and use it in GitHub Desktop.
dreadnode game.gamecast()
This file contains hidden or 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
| // Optimize gamecast with ( http://github.com/LearnBoost/Socket.IO-node/blob/master/lib/socket.io/listener.js#L83-90 ): | |
| Listener.prototype.broadcast = function(message, except){ | |
| for (var i = 0, k = Object.keys(this.clients), l = k.length; i < l; i++){ | |
| if (this.clients[k[i]] && (!except || [].concat(except).indexOf(this.clients[k[i]].sessionId) == -1)){ | |
| this.clients[k[i]].send(message); | |
| } | |
| } | |
| return this; | |
| }; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment