mirror of
https://github.com/schlagmichdoch/PairDrop.git
synced 2025-04-20 15:06:15 -04:00
Use JSON.stringify instead of toString
This commit is contained in:
parent
0ccd4c6e7b
commit
6a940acad2
1 changed files with 4 additions and 3 deletions
|
@ -94,7 +94,7 @@ exports.create = function(server) {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function notifyBuddiesX() {
|
function notifyBuddies() {
|
||||||
var locations = {};
|
var locations = {};
|
||||||
//group all clients by location (by public ip address)
|
//group all clients by location (by public ip address)
|
||||||
forEachClient(function(client) {
|
forEachClient(function(client) {
|
||||||
|
@ -120,7 +120,8 @@ exports.create = function(server) {
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}, []);
|
}, []);
|
||||||
var currState = hash(buddies.toString());
|
var currState = hash(JSON.stringify(buddies));
|
||||||
|
console.log(currState);
|
||||||
var socket = client.socket;
|
var socket = client.socket;
|
||||||
//protocol
|
//protocol
|
||||||
var msg = {
|
var msg = {
|
||||||
|
@ -137,5 +138,5 @@ exports.create = function(server) {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
setInterval(notifyBuddiesX, 3000);
|
setInterval(notifyBuddies, 3000);
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue