Merge pull request #194 from cubedro/develop

fixed serverTime
This commit is contained in:
Marian OANCΞA 2015-06-17 04:14:11 +03:00
commit d0828a5836

2
app.js
View File

@ -345,7 +345,7 @@ client.on('connection', function (clientSpark)
clientSpark.on('client-pong', function (data)
{
var serverTime = _.get(data, "serverTime", 0);
var latency = Math.ceil( (_.now() - data.serverTime) / 2 );
var latency = Math.ceil( (_.now() - serverTime) / 2 );
clientSpark.emit('client-latency', { latency: latency });
});