# Forum

## Notice to all users

We are migrating towards a new forum system located at community.teamspeak.com, as such this forum will become read-only on January 29, 2020

# Thread: ServerQuery - "Open Connection" and "Banned" message issues

1. -= TeamSpeak User =-
Join Date
February 2012
Posts
18

## ServerQuery - "Open Connection" and "Banned" message issues

Note: Please move this to the correct forum if it is in the wrong place. Also, I didn't see any other threads addressing this. Please link me if it has been.

I've been running across this problem for quite a while and just now got around to troubleshooting it. When you are banned from the Teamspeak Query server for sending messages too fast, the banned message is sent without an "\n\r" appended to the end, contrary to all other messages sent to the user. This causes an issue where I can't tell if the response has been fully received or not, usually causing my program to hang indefinitely.

As for connecting to the server, normally a "error id=0 msg=ok" is not sent upon connection. However, if you are banned for flooding, then an "error id=#### msg=you are banned for x seconds" is sent immediately after the Teamspeak server's welcome message, also without an "\n\r". This also causes problematic behavior, as it causes the banned message to go unnoticed, as we are not normally expecting an error message to be received at this time.

I've only been able to work around this issue by purposefully delaying my program upon establishing a connection to see if an error message is sent, as well as hard-coding the entire error message, to make sure I have received the entire response.

Sincerely,
-Imisnew2

Originally Posted by dante696
I guess this belongs into the server section.
You are talking your program hangs? What program does hang? And can you give us an how to reproduce?

What do you use, to login into the query? Is it the ServerQuery under tools or putty/telnet?
I connect to Teamspeak using my own program, via C#. If I try to connect with PuTTY while I'm banned, PuTTY immediately closes after establishing a connection. These are the two messages sent when trying to connect to my Teamspeak server. One while I'm banned, the other while I'm not.

Not Banned:
Code:
TS3\n\rWelcome to the TeamSpeak 3 ServerQuery interface, type "help" for a list of commands and "help <command>" for information on a specific command.\n\r
Banned:
Code:
TS3\n\rWelcome to the TeamSpeak 3 ServerQuery interface, type "help" for a list of commands and "help <command>" for information on a specific command.\n\rerror id=3329 msg=connection\sfailed,\syou\sare\sbanned extra_msg=you\smay\sretry\sin\s221\sseconds
Note, the lack of a \n\r on the end of the message (I haven't poked around, but It seems to be missing \0 as well, because the socket never times out when trying to receive the rest of the message, instead it returns '0 bytes received' and loops indefinitely).

I can post the code that will allow you to re-create the issue upon request.

--- Merged ---

I'm unsure if my post got eaten, as this is my first time on the Teamspeak 3 Forums, but I'll re-iterate what I posted earlier.

"Banned" message issue:
The program I am talking about is my own program. It connects to the server query back-end and sends/receives commands fairly quickly. Whenever a "you are banned" message is received, it does not have \n\r\0 attached to the end of the packet, and thus causes the socket to believe there is still more to the packet. Moreover, without the \n\r marker, it's hard to determine when the message ends. This is what I mean:
Code:
error id=3331 msg=flood\sban
Code:
error id=3329 msg=connection\sfailed,\syou\sare\sbanned extra_msg=you\smay\sretry\sin\s538\sseconds
Note, these do NOT have the traditional \n\r\0 on the end, like other responses (note, the \0 is stripped off by the socket):
Code:
error id=0 msg=ok\n\r
This causes two issues:
- The socket does not know that it has reached the end of the packet (due to the lack of \0), and never times out on "Receives."
- The end of the message is unable to be determined (due to the lack of \n\r), and loops indefinitely waiting for the rest of the message.

"Open Connection" message issue:
Moreover, when attempting to open a connection while you are banned results in an error message being sent directly after the connection is opened. This causes us to attempt to send information to the server after the connection has been closed, as normally, an error message is not sent after the connection is opened. This is what I mean:
Code:
TS3\n\rWelcome to the TeamSpeak 3 ServerQuery interface, type "help" for a list of commands and "help <command>" for information on a specific command.\n\r
Code:
TS3\n\rWelcome to the TeamSpeak 3 ServerQuery interface, type "help" for a list of commands and "help <command>" for information on a specific command.\n\rerror id=3329 msg=connection\sfailed,\syou\sare\sbanned extra_msg=you\smay\sretry\sin\s538\sseconds
Edit:
This was tested on both Server Version 3.0.0-rc1 (Windows) and 3.0.1 (Windows).

Sincerely,
-Imisnew2

Is this forum the correct way to submit bug reports like these? If not, could someone please give me the correct procedure?
Last edited by dante696; February 13th, 2012 at 08:27 AM.

2. Join Date
June 2008
Posts
18,513
I guess this belongs into the server section.
You are talking your program hangs? What program does hang? And can you give us an how to reproduce?

What do you use, to login into the query? Is it the ServerQuery under tools or putty/telnet?

3. Join Date
June 2008
Posts
18,513

I don't see any error in our message. the last \n\r sets a new line not all telnet programs, do that by default.

4. -= TeamSpeak User =-
Join Date
February 2012
Posts
18
Originally Posted by dante696

I don't see any error in our message. the last \n\r sets a new line not all telnet programs, do that by default.

\n\r\0 do not exist on the end of banned messages. The lack of \0 causes the socket to not time-out, because it still thinks the packet has not been finished. The lack of \n\r is not as important, but it is included on the end of every other message, causing confusion when it is not there for 2 messages out of thousands(?). The unexpected appearance of an error message after opening a connection also causes confusion, which could be avoided by making an error message sent after opening a connection standard procedure.

There are three issues there.

5. -= TeamSpeak Team =-
Join Date
June 2008
Location
-
Posts
252
Ok we figured out what your problem is :P

InternalTicketID: TS-869

6. -= TeamSpeak User =-
Join Date
February 2012
Posts
18
Originally Posted by MuhChy
Ok we figured out what your problem is :P

InternalTicketID: TS-869
Thank you MuhChy.
If you need anymore information, please let me know. I'm pretty much knee-deep dealing with the Teamspeak Server Query back-end at the moment, so I've got plenty of responses floating around. Great work on the Server Query stuff, however, the rest is working without an issue!

7. -= TeamSpeak Team =-
Join Date
June 2008
Location
-
Posts
252
- Your problem should be fixed with serverversion (Feb 21th and newer).
It would be nice if you could retest your problem when the serverversion becomes available.

8. -= TeamSpeak User =-
Join Date
February 2012
Posts
18
Originally Posted by MuhChy
- Your problem should be fixed with serverversion (Feb 21th and newer).
It would be nice if you could retest your problem when the serverversion becomes available.
Thank you. Should the 3.0.2 release contain the fix, or will it be included in 3.0.3 pre-release?

9. Join Date
June 2008
Posts
18,513
This will be fixed in our Server 3.0.2