Hello!
Been using your library with my Discord bot and works like a charm!
The only issue I'm getting is if I try to rcon a server that is down (or changing map for example), it doesn't report any kind of timed out (at least when using UDP because of how the protocol works) and I have to handle that by myself with a timer or something (haven't tried yet).
Since there's no param for this in the library, it would be nice to have one :)
Here's how I'm using. If the server is up, everything works as expected.
asyncSendMsgRcon(target,msg){returnnewPromise((resolve,reject)=>{// max rcon data we can send is 509constmaxrcondatasize=509;constbasesize=16+target.rcon.length;// rcon challenge and rcon lengthconstbasecomm=`some command here `;letconn=newRcon(target.serverip,target.serverport,target.rcon,{tcp: false});conn.on('auth',()=>{//console.log("Authed!");conn.send(basecomm+`"${msg.slice(0,(maxrcondatasize-basesize-basecomm.length-2))}"`);}).on('response',(str)=>{//console.dir("Got response: " + str);conn.disconnect();// handle statusconststatus=str.replace(/\n|\0/g,"");if(status=='OK')resolve(true);else/*if(status == 'BADMSG')*/resolve(false);}).on('end',()=>{console.log("Rcon socket closed!");}).on('error',(error)=>{console.log("error");conn.disconnect();reject(null);});conn.connect();});}```
Thankyouforyourtime.
Hello!
Been using your library with my Discord bot and works like a charm!
The only issue I'm getting is if I try to rcon a server that is down (or changing map for example), it doesn't report any kind of timed out (at least when using UDP because of how the protocol works) and I have to handle that by myself with a timer or something (haven't tried yet).
Since there's no param for this in the library, it would be nice to have one :)
Here's how I'm using. If the server is up, everything works as expected.