From 80dc078839dae8e36a4267fa9f4b9ef684d2496c Mon Sep 17 00:00:00 2001 From: cubedro Date: Wed, 17 Jun 2015 04:13:55 +0300 Subject: [PATCH] fixed serverTime --- app.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app.js b/app.js index 61f9c5b..e04657e 100644 --- a/app.js +++ b/app.js @@ -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 }); });