Merge pull request #193 from cubedro/develop

fixed bug
This commit is contained in:
Marian OANCΞA 2015-06-17 04:10:48 +03:00
commit dc4b0fcdd2

1
app.js
View File

@ -344,6 +344,7 @@ client.on('connection', function (clientSpark)
clientSpark.on('client-pong', function (data) 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() - data.serverTime) / 2 );
clientSpark.emit('client-latency', { latency: latency }); clientSpark.emit('client-latency', { latency: latency });