-
Notifications
You must be signed in to change notification settings - Fork 31
Open
Description
Is it possible to save the value of the on('response') to a variable I can pull after conn.connect(), so that it can be passed over as a return value?
var response;
const rcon = require("./rcon.js");
var options = {
tcp: true,
challenge:false
};
var conn = new Rcon('192.168.1.101', 27020, rconPass, options);
conn.on('auth', function() {
conn.send("listplayers");
}).on('response', function(str) {
response = str;
});
conn.connect();
return response;
There's an example of what I'd like to do.
Metadata
Metadata
Assignees
Labels
No labels