Connect to ServerQuery (with SFML)

mardi 25 août 2015

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.

IMPORTANT: You don't have to be able to code C++ or know SFML, the mistake is not at this point I think. The packets being send, the TeamSpeak ServerQuery just don't "unterstand" them :(.

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

Best regards
TheBrownShape
Connect to ServerQuery (with SFML)

0 commentaires:

Enregistrer un commentaire