Merge pull request #172 from cubedro/develop

fixed bug
This commit is contained in:
Marian OANCΞA 2015-06-02 05:07:22 +03:00
commit 75430b2153

2
app.js
View File

@ -270,7 +270,7 @@ client.on('connection', function (clientSpark)
clientSpark.on('client-pong', function (data)
{
var start = (!_.isUndefined(data) && !_.isUndefined(data.serverTime) ? data.serverTime : clientLatency);
var latency = Math.ceil( (_.now() - data.serverTime) / 2 );
var latency = Math.ceil( (_.now() - start) / 2 );
clientSpark.emit('client-latency', { latency: latency });
});