Forum

Results 1 to 7 of 7
  1. #1
    Join Date
    December 2009
    Location
    Germany
    Posts
    9

    [Java] [WIP] YATSQUO - Yet Another TeamSpeak Query Library (Object Oriented)

    There are many query libraries out there, but none of them were really good at what they did.

    So I decided to write my own library in the language I use the most: Java.

    YATSQUO is an object oriented library for querying a TeamSpeak3 Server with that aspect in mind.

    Meaning: You will never ever again write manual query code. Everything is handled by changing variables or calling functions.

    You can create Servers just by creating a new Server Object and calling its function createAndRegister();
    Voila, your new server with all the settings you set in the variables will be created for you.
    Creating channels works the same way! Just create a new Channel Object with the required information in the constructor, call createAndRegister() and your channel sits there waiting for you to talk in it.

    PLUS: A fully functional event listener which is able to receive it's notifies even when you are spamming the server with commands. Example2.java shows that functionality.

    Here is an example code for getting all available servers and their channels:

    Code:
      public static void main(String[] args) throws QueryException {
        QueryInterface qi = new QueryInterface();
        // Connect to the given ip : port
        qi.connect(ip, port);
        // Login using given user and passwd
        qi.login(user, passwd);
        // Populate the internal server list
        qi.fillServerList();
        /*
         * Connection behaviour will change in future versions!
         * Connection is then established while creating the QueryInterface object:
         * new QueryInterface(ip, port, user, passwd, true);
         * fillServerList() will be called automatically if the last parameter is true!
         */
        // Iterate through all servers available
        for (Server s : qi.getServers()) {
          // Print out the ID and name of the server
          System.out.println("Server (" + s.getID() + "): '" + s.getName() + "'");
          for (Channel c : s.getChannels()) {
            // Print out ID and name of the channels belonging to Server s
            System.out.println(" - Channel (" + c.getID() + "): " + c.getName());
          }
        }
      }
    Find the example here.

    MUCH easier than with the other Java libraries hanging around.

    If you feel the need to manually send commands.. Even this is simplified with the QueryCommand class.

    Oh, and don't worry about the missing documentation.. It'll be added some day.. ; )

    So what are you waiting for? Grab your copy from github..
    Here's the Addons Download Link:
    http://addons.teamspeak.com/director...Oriented).html

    YATSQUO is still Work In Progress!

    Developers: Feel free to create pull-requests if you think you added something really nice or just want to contribute to the development.

    github: https://github.com/prodigy1/YATSQUO
    Javadoc: http://dev.servertube.net/YATSQUO/javadoc/
    Last edited by prodigy; May 21st, 2013 at 12:57 PM. Reason: title changed, addons download link added

  2. #2
    Join Date
    November 2009
    Location
    Germany
    Posts
    24
    Sounds great, thanks for sharing!

    Is it possible, with the help of this library, to create a bot with following functionality?
    - User enters a certain, predefined, channel (lets say we define the channel by channelID 42)
    - Bot instantly sends to User as he enters the channel: "Hi, I'm a bot. Try my !echo function!"
    - User sends back to Bot: "!echo foobar"
    - Bot sends back to User: "foobar"


    If this is possible, then I totally want to try to use this! Ideally the bot should also be able to find out which servergroups a user has and be able to set servergroups.

  3. #3
    Join Date
    December 2009
    Location
    Germany
    Posts
    9
    At the current state such a bot is possible. Finding out servergroups is possible too, but changing not yet. You may implement it in the Client.java - and if you do so, feel free to send a pull request via github.
    Permission Management isn't implemented yet, too.

    I will continue development any time soon.

  4. #4
    Join Date
    November 2009
    Location
    Germany
    Posts
    24
    I've worked deep into the TS3ServerQuery API now and think I fully understand how it works. I've experimented around with the JTS3ServerQuery library and managed to pull off quite some cool things, but the code really fast ends up being ugly and non-modular; creating a bigger bot would probably end up in chaos, so I may decide to switch over to this

    Compared to JTS3ServerQuery, this library takes MUCH longer to load/connect to the server until it's ready for use though. Is this known/intended?

    Code-wise I'd rather use this library, but sadly the given functionality is still missing quite a few of the base features which I currently already use/need (especially move events and client management). Currently you can't even read out client servergroups because the Server misses a function to get the client list.

    I'm not fully worked into your library yet, still got to figure out a few things. I'll try to find some time this weekend to fully get into your library and see how much work it would take to get the required missing functions to work.

  5. #5
    Join Date
    June 2012
    Location
    Portugal
    Posts
    317
    Haven't looked yet into the code but when I get home I have a small bot in mind and will test this!

  6. #6
    Join Date
    December 2009
    Location
    Germany
    Posts
    9
    Unfortunatley I don't have that much time to continue development. The increased connection times were to this point unknown to me. The tests I do are done on a local server and it kind of instantly connects and does it's stuff.

    I'd love it if someone else would help me continuing the work, as it is in terms of code management and readability MUCH better than the JTS3ServerQuery you mentioned. This was the reason why I started developing this library. It just didn't respect the object orientation which Java is built for.

    I need this library for a project of mine, so I guarantee contuing of development. But as I mentioned above, the time I can spent developing is about 6-8 hours a week. But theres more important stuff going on here. Got a pretty tough time schedule over here..

    What's really missing in order to work properly is full client and partly permission management..

    //edit:
    Startup times are indeed increased. This results from the library collecting all the necessary information on startup (available servers, channels, and soon clients). But I don't think this is such a big problem, as you don't start your bots every now and then.
    When they execute normally they should not shutdown, thus not requiring to collect all information on the next startup.

    I updated some of the code, included getting clients and changed the constructor.
    Example1 should reflect all these changes. (see commit details on github: https://github.com/prodigy1/YATSQUO/...742b3aa09ac855)
    Last edited by prodigy; May 17th, 2013 at 02:52 AM.

  7. #7
    Join Date
    December 2009
    Location
    Germany
    Posts
    9
    A little update to the code:
    The way errors are handled is changed slightly to allow more flexibility in the implementing program.
    The QueryListener works again and an example is added.

    Please make sure to update to the newest version.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [TS3QueryLib.Net] .Net Query Port Library
    By Scordo in forum Tools / Web Based
    Replies: 135
    Last Post: June 9th, 2017, 12:00 AM
  2. [WIP] JTS3ServerQuery - Java Server Query Library
    By Stefan1200 in forum Tools / Web Based
    Replies: 78
    Last Post: November 20th, 2016, 12:29 PM
  3. [DEV] TeamSpeak 3 Server Query Java API
    By Bertieboy7 in forum Tools / Web Based
    Replies: 11
    Last Post: February 28th, 2016, 05:39 PM
  4. Replies: 9
    Last Post: January 3rd, 2010, 02:26 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •