From 5f345828049cb221dd5ab9fbb6ab27aa3af0f454 Mon Sep 17 00:00:00 2001 From: Kristjan Kirpu Date: Fri, 7 Aug 2015 00:12:37 +0300 Subject: [PATCH] Removed ping --- package.json | 3 +-- protocols/core.js | 12 +----------- 2 files changed, 2 insertions(+), 13 deletions(-) diff --git a/package.json b/package.json index 34938e7..e472ceb 100644 --- a/package.json +++ b/package.json @@ -34,8 +34,7 @@ "request": "~2.51.0", "minimist": "~1.1.0", "varint": "~4.0.0", - "moment": "~2.9.0", - "jjg-ping": "~1.0.1" + "moment": "~2.9.0" }, "bin": { "gamedig": "bin/gamedig.js" diff --git a/protocols/core.js b/protocols/core.js index 5d064ac..1ed7d4d 100644 --- a/protocols/core.js +++ b/protocols/core.js @@ -3,8 +3,7 @@ var EventEmitter = require('events').EventEmitter, net = require('net'), async = require('async'), Class = require('../lib/Class'), - Reader = require('../lib/reader'), - ping = require('jjg-ping'); + Reader = require('../lib/reader'); module.exports = Class.extend(EventEmitter,{ init: function() { @@ -19,7 +18,6 @@ module.exports = Class.extend(EventEmitter,{ this.encoding = 'utf8'; this.byteorder = 'le'; this.delimiter = '\0'; - this.ping = 0; var self = this; this.globalTimeoutTimer = setTimeout(function() { @@ -70,7 +68,6 @@ module.exports = Class.extend(EventEmitter,{ if('port_query' in this.options) state.query.port_query = this.options.port_query; state.query.type = this.type; if('pretty' in this) state.query.pretty = this.pretty; - state.query.server_ping = this.ping; this.reset(); this.finished = true; @@ -110,13 +107,6 @@ module.exports = Class.extend(EventEmitter,{ self.parseDns(options.host,c); } }, - function(c) { - // not sure if this is the best way to ping a host - ping.system.ping(options.host, function(latency, status) { - if(status) self.ping = latency; - }); - c(); - }, function(c) { // calculate query port if needed if(!('port_query' in options) && 'port' in options) {