You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
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.
The text was updated successfully, but these errors were encountered: