Clean up some comments
This commit is contained in:
parent
11c757b4f0
commit
c227097f37
7
index.js
7
index.js
|
@ -92,11 +92,9 @@ client.on('message', async msg => {
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.log(e);
|
console.log(e);
|
||||||
}
|
}
|
||||||
//console.log(query);
|
|
||||||
let serverStatus = "Stopped";
|
let serverStatus = "Stopped";
|
||||||
let serverTPS = "---";
|
let serverTPS = "---";
|
||||||
if ( server.rconPort != 0 ) {
|
if ( server.rconPort != 0 ) {
|
||||||
//console.log("Making new rcon connection...");
|
|
||||||
const rcon = new Rcon({
|
const rcon = new Rcon({
|
||||||
host: server.rconAddress,
|
host: server.rconAddress,
|
||||||
port: server.rconPort,
|
port: server.rconPort,
|
||||||
|
@ -105,7 +103,6 @@ client.on('message', async msg => {
|
||||||
});
|
});
|
||||||
const connection = rcon.connect({
|
const connection = rcon.connect({
|
||||||
onSuccess: function() {
|
onSuccess: function() {
|
||||||
//console.log("Connected! " + serverStatus);
|
|
||||||
serverStatus = "Running";
|
serverStatus = "Running";
|
||||||
},
|
},
|
||||||
onError: function() {
|
onError: function() {
|
||||||
|
@ -115,7 +112,7 @@ client.on('message', async msg => {
|
||||||
});
|
});
|
||||||
connection.auth({
|
connection.auth({
|
||||||
onSuccess: function () {
|
onSuccess: function () {
|
||||||
//console.log("Successfully authenticated to: " + server.name);
|
// Don't need to do anything on successful auth to rcon
|
||||||
},
|
},
|
||||||
onError: function (error) {
|
onError: function (error) {
|
||||||
console.log("Could not authenticate to rcon server: " + server.name + " " + server.rconAddress + " " + server.rconPort);
|
console.log("Could not authenticate to rcon server: " + server.name + " " + server.rconAddress + " " + server.rconPort);
|
||||||
|
@ -124,7 +121,6 @@ client.on('message', async msg => {
|
||||||
});
|
});
|
||||||
await connection.send(server.rconTPSCommand, {
|
await connection.send(server.rconTPSCommand, {
|
||||||
onSuccess: function (response) {
|
onSuccess: function (response) {
|
||||||
//console.log(response);
|
|
||||||
if ( ['1.2.5', '1.4.7'].includes(server.mcVersion) ) {
|
if ( ['1.2.5', '1.4.7'].includes(server.mcVersion) ) {
|
||||||
let tpsParts = response.trim().split("\n");
|
let tpsParts = response.trim().split("\n");
|
||||||
serverTPS = tpsParts[0].split(" ").pop().slice(2);
|
serverTPS = tpsParts[0].split(" ").pop().slice(2);
|
||||||
|
@ -133,7 +129,6 @@ client.on('message', async msg => {
|
||||||
serverTPS = tpsParts.pop();
|
serverTPS = tpsParts.pop();
|
||||||
if ( serverTPS.includes("*") ) serverTPS = serverTPS.split("*").pop();
|
if ( serverTPS.includes("*") ) serverTPS = serverTPS.split("*").pop();
|
||||||
}
|
}
|
||||||
//console.log("Got it all!_" + hostStatus + "_" + serverStatus + "_" + serverTPS + "_");
|
|
||||||
const q = new Query({host: server.rconAddress, port: server.queryPort, timeout: 250});
|
const q = new Query({host: server.rconAddress, port: server.queryPort, timeout: 250});
|
||||||
try {
|
try {
|
||||||
q.fullStat()
|
q.fullStat()
|
||||||
|
|
Loading…
Reference in New Issue
Block a user