Skip to content

Not a Issue, but a question #51

@ECEstal

Description

@ECEstal

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

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions