Skip to content

Commit 1861530

Browse files
committed
Try to fix the flood ban bug by sleeping for floodRate after connecting
There have been issues where the server would flood ban queries shortly after connecting (after roughly 10 commands). However, if they didn't get banned at the start, the query would run fine at a 350ms/command rate indefinitely. Adding a startup delay should thus fix the issue. Users of the UNLIMITED flood rate are unaffected by this change.
1 parent f4f2443 commit 1861530

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

src/main/java/com/github/theholywaffle/teamspeak3/SocketWriter.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,9 @@ public SocketWriter(QueryIO io, TS3Config config) throws IOException {
5858
@Override
5959
public void run() {
6060
try {
61+
// Initial sleep to prevent flood ban shortly after connecting
62+
if (floodRate > 0) Thread.sleep(floodRate);
63+
6164
while (!isInterrupted()) {
6265
final Command c = sendQueue.take();
6366
final String msg = c.toString();

0 commit comments

Comments
 (0)