Skip to content

Unable to get rcon.command(cmd).then working #10

Description

@AmyJeanes

Here's my code:

rcon.connect().then(() => {
    socket.emit(id,{msg:"Command sent", success:true})
    rcon.command(cmd).then(() => {
        console.log('ran command!');
    });
}).catch(err => {
    socket.emit(id,{msg:"Command failed, server may be offline or starting up", success:false})
})

I want to move the socket.emit(id,{msg:"Command sent", success:true}) bit inside the command.then bit but it doesn't seem to be called. If I understand it correctly that section with the console.log('ran command!'); should be called after the command is successfully run on the server - but even though the command is run it doesn't seem to call the function.

I'm using latest GitHub version of course.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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