antoine-pous / node-teamspeak3-client

😱 A TeamSpeak3 ServerQuery client with anti-ban feature, prepared statements and a lot of cool stuffs
ISC License
5 stars 0 forks source link

AntiFlood feature should not be based on query id #8

Open antoine-pous opened 6 years ago

antoine-pous commented 6 years ago

The current behavior for the antiflood feature is wrong, it use the query id instead of a query count to detect the flood.

This code broke the AFL and the client can be banned

// Add many queries to the queue
for(let i = 0; i < 1000; i++) {
    TS3Client.send(`clientlist`).catch((e: iError) => {
        console.log(e.id, e.msg);
    });
}

TS3Client.sendNow(`clientlist`).catch((e: iError) => {
    console.log(e.id, e.msg);
});