node-srcds-rcon
node-srcds-rcon copied to clipboard
Unable to get rcon.command(cmd).then working
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.
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?