room announcement update to support socket 0.7

This commit is contained in:
Ali Asaria 2011-09-24 13:09:03 -04:00
parent 0e164fce74
commit 43b0f03fd2

View file

@ -144,7 +144,7 @@ exports.add_to_room_and_announce = function (client, room, msg) {
for (var i = 0; i < clients.length; i++)
{
if (clients[i].id != client.id)
clients[i].send(msg);
clients[i].json.send(msg);
}
});
}
@ -171,7 +171,7 @@ exports.remove_from_all_rooms_and_announce = function (client, msg) {
for (var i = 0; i < clients.length; i++)
{
if (clients[i].id != client.id)
clients[i].send(msg);
clients[i].json.send(msg);
}
});
}
@ -192,7 +192,7 @@ exports.broadcast = function(msg) {
exports.broadcast_room = function(room, msg) {
var clients = exports.room_clients(room);
for (var i = 0; i < clients.length; i++)
clients[i].send(msg);
clients[i].json.send(msg);
};
// Broadcast message to all the other clients that are in rooms with this client
@ -224,6 +224,6 @@ exports.broadcast_to_roommates = function (client, msg) {
for (var i = 0; i < roommates.length; i++)
{
console.log(' - ' + roommates[i].id);
roommates[i].send(msg);
roommates[i].json.send(msg);
}
}