Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: TeamSpeak Bot / connect to TeamSpeak 3 ServerQuery  (Read 2749 times)

0 Members and 1 Guest are viewing this topic.

TheBrownShape

  • Newbie
  • *
  • Posts: 8
    • View Profile
    • Email
TeamSpeak Bot / connect to TeamSpeak 3 ServerQuery
« on: August 25, 2015, 03:43:56 pm »
Hello,

I want to code a little TeamSpeak 3 Bot with the ServerQuery. The ServerQuery uses Telnet on port 10011. I am using Linux Ubuntu and when the server is started I can connect easy with "telnet localhost 10011" and it works finely. At first you have to login and tell the ServerQuery which virtual server you want to use. So the first 2 commands that I use everytime are "login USERNAME PASSWORD" and "use port=9987". As I said, that works fine. Now to my problem: I can connect to the server, the status is "Done". I also can receive the welcome message ("Welcome to TeamSpeak 3 the ServerQuery ...") with socket.receive(buffer, 512, received) (yes, the size of the buffer is 512 and received is a std::size_t, thats not the mistake ;) ). And I also can send the messages "login USERNAME PASSWORD" and "use port=9987" with socket.send(msg.c_str(), msg.size() + 1);, the status is always "Done". But I can't receive the answers. Normally it must say "error id=0 msg=ok". The commands are the same as them that I use in the terminal and there i get the answer "error id=0 msg=ok". Also the commands sent with SFML have no effect. When I type "clientpoke clid=1 msg=TEST" in the terminal, I get poked (I'm connected to localhost with my TeamSpeak Client also), but when I send this with SFML, nothing happens.

Why the TeamSpeak ServerQuery don't "understand" the commands, maybe its the wrong coding (UTF-8 and so) ?Please help me.

//Sorry for my bad english, I come from germany ;)

Best regards
TheBrownShape

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: TeamSpeak Bot / connect to TeamSpeak 3 ServerQuery
« Reply #1 on: August 25, 2015, 03:53:10 pm »
I don't think it is an encoding issue because all this stuff is plain ASCII. But it could be line ending or another similar detail. You should compare, if possible, the exact output (ie. bytes) of both telnet and SFML terminals, and try to spot a difference.

For example, by sending size + 1 you also send the final null character. Is this really expected? Doesn't the server want a \r, \n or \r\n instead?
« Last Edit: August 25, 2015, 04:27:19 pm by Laurent »
Laurent Gomila - SFML developer

TheBrownShape

  • Newbie
  • *
  • Posts: 8
    • View Profile
    • Email
Re: TeamSpeak Bot / connect to TeamSpeak 3 ServerQuery
« Reply #2 on: August 25, 2015, 04:21:28 pm »
Thank you so much!

It works with /r/n and without the "+1". I didn't know /r before, I will look it up on Google now.
Thank you again!!!

Best regards
TheBrownShape

//Close