node-srcds-rcon icon indicating copy to clipboard operation
node-srcds-rcon copied to clipboard

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

Open AmyJeanes opened this issue 10 years ago • 1 comments

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.

AmyJeanes avatar Jan 10 '16 01:01 AmyJeanes

I added tests. I've developed and tested against the latest csgo binaries. You may run the tests yourself, but you need to set up an integration server (see readme).

What game are you using?

randunel avatar Jan 10 '16 10:01 randunel