These are chat archives for TheHolyWaffle/TeamSpeak-3-Java-API

30th
Jun 2016
dope
@dsfx3d
Jun 30 2016 13:31
Hey I'm a student I just started working with the api can you gimmie a headstart
Roger Baumgartner
@rogermb
Jun 30 2016 13:31
Sure, what do you need help with?
Have you read through the readme page and looked at the examples already?
dope
@dsfx3d
Jun 30 2016 13:50
Firstly, I'm using a free server so I don't know the server admin's credentials will it matter
Roger Baumgartner
@rogermb
Jun 30 2016 13:51
For most commands, you'll have to have some kind of login credentials. As long as you have the permission to generate a server query login, you should be fine
With such a generated server query login, the server query will have (with minor changes) the same permissions as you on your server would.
dope
@dsfx3d
Jun 30 2016 13:54
Ok actually I'm new to TeamSpeak don't know much about the permissions but when I use query.login(null,null) the log prints Welcome to TeamSpeak 3 ServerQuery interface...
does that mean I'm good to go
Roger Baumgartner
@rogermb
Jun 30 2016 13:55
Is null, null a valid login? No.
Generate a login from your TS3 client
Join your server, then in the top of the window click on Tools -> ServerQuery Login
dope
@dsfx3d
Jun 30 2016 13:57
ok
Roger Baumgartner
@rogermb
Jun 30 2016 13:57
Without a login, what you could do on the server would be extremely limited. I don't think you could even get a list of all online clients
dope
@dsfx3d
Jun 30 2016 13:57
Yea i got the password now
wait I'll try and get back to you
thanks man, you guys have an awesome support
Roger Baumgartner
@rogermb
Jun 30 2016 13:58
Note that you shouldn't put the password directly into the source code if you intend on sharing that code on GitHub or similar
dope
@dsfx3d
Jun 30 2016 13:58
ok
Roger Baumgartner
@rogermb
Jun 30 2016 13:59
Environment variables, for example, could be used to keep the password out of the source code.
Thanks for using the API :smile: If there are any more questions, feel free to ask at any time.
dope
@dsfx3d
Jun 30 2016 14:02
So for now I just want to connect the client to the virtual server how can i do that
I'm using 'api.selectVirtualServerByPort()'
Roger Baumgartner
@rogermb
Jun 30 2016 14:03
Use selectVirtualServerById or selectVirtualServerByPort, depending on what you know.
If there is only one virtual server running (so not a commercially hosted TS3 server, but rather the one available for free download), that server should always have the ID 1
dope
@dsfx3d
Jun 30 2016 14:05
ok but I don't think anything after the api.login() is executed cos I wrote a Log after that statement but it doesn't get printed
Roger Baumgartner
@rogermb
Jun 30 2016 14:06
By the way, note that the methods inside TS3Api are named after the actual server query commands, so if you already know these, it should be easy to find the corresponding methods in TS3Api
Can you send me an extract of the log (with sensitive information like IP, port, username / password removed)?
Setting the logging to Level.ALL can also help to track down bugs as more things will be written to the log that way
dope
@dsfx3d
Jun 30 2016 14:09
`private class ConnectionTask extends AsyncTask<Void,Void,Void> {
    @Override
    protected Void doInBackground(Void... params) {
        Log.v("__ConnectionTask", "Executing...");
        try {
            query.connect();
            api = query.getAsyncApi();
            api.login(admin, password);
            Log.v("__TS3", "HERE");
            api.selectVirtualServerByPort(port);
            api.setNickname("TEST");
            api.registerAllEvents();
            api.addTS3Listeners(ts3EventAdapter);
        } catch (Exception e) {
            Log.e("__TS3","Exception"+e.getMessage());
        }
        return null;
    }

    TS3EventAdapter ts3EventAdapter = new TS3EventAdapter() {
        @Override
        public void onClientJoin(ClientJoinEvent e) {
            super.onClientJoin(e);
            Log.v("__TS3", "client join with id" + e.getClientId());
        }
    };
}`
I'm I doing it in a wrong way
LOG
06-30 19:29:06.787 21965-22355/dope.dsfx3d.bbxindia I/System.out: [2016-06-30 19:29:06.789] < TS3
06-30 19:29:28.268 21965-22355/dope.dsfx3d.bbxindia I/System.out: [2016-06-30 19:29:28.269] <
06-30 19:29:28.268 21965-22355/dope.dsfx3d.bbxindia I/System.out: [2016-06-30 19:29:28.278] < Welcome to the TeamSpeak 3 ServerQuery interface, type "help" for a list of commands and "help <command>" for information on a specific command.
06-30 19:34:05.038 21965-27198/dope.dsfx3d.bbxindia I/FA: Tag Manager is not found and thus will not be used
06-30 19:34:09.362 21965-21965/dope.dsfx3d.bbxindia D/AbsListView: unregisterIRListener() is called
06-30 19:39:07.764 21965-22355/dope.dsfx3d.bbxindia I/System.out: [2016-06-30 19:39:07.771] <
06-30 19:39:07.834 21965-31742/dope.dsfx3d.bbxindia I/System.out: [2016-06-30 19:39:07.849] [WARNING] Connection closed by the server.
06-30 19:39:07.844 21965-31742/dope.dsfx3d.bbxindia I/System.out: [2016-06-30 19:39:07.850] [WARNING] SocketReader has stopped!
06-30 19:39:07.844 21965-31745/dope.dsfx3d.bbxindia I/System.out: [2016-06-30 19:39:07.853] [SEVERE] [Connection] Disconnected from TS3 server
06-30 19:29:06.787 21965-22355/dope.dsfx3d.bbxindia I/System.out: [2016-06-30 19:29:06.789] < TS3 06-30 19:29:28.268 21965-22355/dope.dsfx3d.bbxindia I/System.out: [2016-06-30 19:29:28.269] < 06-30 19:29:28.268 21965-22355/dope.dsfx3d.bbxindia I/System.out: [2016-06-30 19:29:28.278] < Welcome to the TeamSpeak 3 ServerQuery interface, type "help" for a list of commands and "help <command>" for information on a specific command. 06-30 19:34:05.038 21965-27198/dope.dsfx3d.bbxindia I/FA: Tag Manager is not found and thus will not be used 06-30 19:34:09.362 21965-21965/dope.dsfx3d.bbxindia D/AbsListView: unregisterIRListener() is called 06-30 19:39:07.764 21965-22355/dope.dsfx3d.bbxindia I/System.out: [2016-06-30 19:39:07.771] < 06-30 19:39:07.834 21965-31742/dope.dsfx3d.bbxindia I/System.out: [2016-06-30 19:39:07.849] [WARNING] Connection closed by the server. 06-30 19:39:07.844 21965-31742/dope.dsfx3d.bbxindia I/System.out: [2016-06-30 19:39:07.850] [WARNING] SocketReader has stopped! 06-30 19:39:07.844 21965-31745/dope.dsfx3d.bbxindia I/System.out: [2016-06-30 19:39:07.853] [SEVERE] [Connection] Disconnected from TS3 server
Roger Baumgartner
@rogermb
Jun 30 2016 14:11
``` makes a block comment
without the backslash
dope
@dsfx3d
Jun 30 2016 14:11
'''

06-30 19:29:06.787 21965-22355/dope.dsfx3d.bbxindia I/System.out: [2016-06-30 19:29:06.789] < TS3
06-30 19:29:28.268 21965-22355/dope.dsfx3d.bbxindia I/System.out: [2016-06-30 19:29:28.269] < 
06-30 19:29:28.268 21965-22355/dope.dsfx3d.bbxindia I/System.out: [2016-06-30 19:29:28.278] < Welcome to the TeamSpeak 3 ServerQuery interface, type "help" for a list of commands and "help <command>" for information on a specific command.
06-30 19:34:05.038 21965-27198/dope.dsfx3d.bbxindia I/FA: Tag Manager is not found and thus will not be used
06-30 19:34:09.362 21965-21965/dope.dsfx3d.bbxindia D/AbsListView: unregisterIRListener() is called 
06-30 19:39:07.764 21965-22355/dope.dsfx3d.bbxindia I/System.out: [2016-06-30 19:39:07.771] < 
06-30 19:39:07.834 21965-31742/dope.dsfx3d.bbxindia I/System.out: [2016-06-30 19:39:07.849] [WARNING] Connection closed by the server.
06-30 19:39:07.844 21965-31742/dope.dsfx3d.bbxindia I/System.out: [2016-06-30 19:39:07.850] [WARNING] SocketReader has stopped!
06-30 19:39:07.844 21965-31745/dope.dsfx3d.bbxindia I/System.out: [2016-06-30 19:39:07.853] [SEVERE] [Connection] Disconnected from TS3 server
I'm a fuckin noob :smile:
Roger Baumgartner
@rogermb
Jun 30 2016 14:12
If this is all the data sent back and forth, it looks like you might be banned from the TS3 server
dope
@dsfx3d
Jun 30 2016 14:13
how?? is it because of the server provider
Roger Baumgartner
@rogermb
Jun 30 2016 14:15

Three other things I've noticed that are a bit off-topic, but I still want to mention them:

  • Is extends AsyncTask<Void,Void,Void> really necessary? It seems like implements Runnable or extends Thread would be enough for most async / threaded frameworks
  • You're using the asynchronous TS3 API, but I don't see you doing anything async-y with it. You might just want to use the regular TS3Api class
  • By doing

          } catch (Exception e) {
          Log.e("__TS3","Exception"+e.getMessage());

    you're essentially swallowing the whole stack trace, so you're throwing away important debug information.

I don't know exactly why you're banned, but it might have been because you've tried to log in with incorrect credentials (null, null) too many times.
By the way, what's up with that massive logging framework of yours? Seems a bit over-the-top for a student project :stuck_out_tongue:
dope
@dsfx3d
Jun 30 2016 14:22
I'm a student but this is not a college project I'm making this app for the Indian Beatbox Community :tongue:
I'll be back after dinner hope I'll find you here
Roger Baumgartner
@rogermb
Jun 30 2016 14:22
ah, alright ^^
dope
@dsfx3d
Jun 30 2016 14:22
do you wana try it
Roger Baumgartner
@rogermb
Jun 30 2016 14:23
Sorry but no, I don't do beatboxing or anything like that, sorry :stuck_out_tongue:
dope
@dsfx3d
Jun 30 2016 14:24
its ok man brb
Roger Baumgartner
@rogermb
Jun 30 2016 14:24
On-topic: Check out the ban list on your TS3 server and consider adding the IP of your server query client to the server's whitelist file
dope
@dsfx3d
Jun 30 2016 16:10
how do I add my ip to whitelit
whitelist
Roger Baumgartner
@rogermb
Jun 30 2016 16:20

"The whitelist is a list of approved hosts that are allowed to ignore the flood protection settings on a TeamSpeak 3 Server. For example, if you're using a web administration interface, we strongly recommend that you add the IP address of your web server to the whitelist file. In a new installation of the TeamSpeak 3 Server, this file is called query_ip_whitelist.txt and it contains the loopback IP address of your server (127.0.0.1). You can enter an infinite number of IP addresses to the whitelist, one IP address per line"

From: http://media.teamspeak.com/ts3_literature/TeamSpeak%203%20Server%20Query%20Manual.pdf

Basically in the install directory of your TS3 server, there should be a file called query_ip_whitelist.txt. Add the IP where your server query connects from on a new line
dope
@dsfx3d
Jun 30 2016 16:32
I'm using a free server I don't have access to the root directory I can partially control the virtual server from the desktop client
Roger Baumgartner
@rogermb
Jun 30 2016 16:32
Then you'll have to use the server query without whitelisting - that just means that too many failed login attempts will get you banned more easily and you can only send 3 commands per second
3 commands / second is already the default behavior of the API, so you're fine there
dope
@dsfx3d
Jun 30 2016 16:34
ok so it means that my phone is banned now
for how long??
its temporary??
I apologize but I'm gonna ask a lot of questions
Roger Baumgartner
@rogermb
Jun 30 2016 16:58
I don't know - it might just be temporary. To confirm that you haven't been permabanned, open a TS3 client, join the server and take a look at the ban list.
dope
@dsfx3d
Jun 30 2016 17:30
yea its not there thanks