fixed bug
This commit is contained in:
parent
11cc9897fb
commit
e92b68673e
2
app.js
2
app.js
@ -270,7 +270,7 @@ client.on('connection', function (clientSpark)
|
|||||||
clientSpark.on('client-pong', function (data)
|
clientSpark.on('client-pong', function (data)
|
||||||
{
|
{
|
||||||
var start = (!_.isUndefined(data) && !_.isUndefined(data.serverTime) ? data.serverTime : clientLatency);
|
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 });
|
clientSpark.emit('client-latency', { latency: latency });
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user