fixed serverTime

This commit is contained in:
cubedro 2015-06-17 04:13:55 +03:00
parent 6c2df3f59c
commit 80dc078839

2
app.js
View File

@ -345,7 +345,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 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 }); clientSpark.emit('client-latency', { latency: latency });
}); });