Forum

Page 1 of 6 123 ... LastLast
Results 1 to 15 of 79
  1. #1
    Join Date
    December 2009
    Location
    Germany
    Posts
    2,356

    JTS3ServerQuery - Java Server Query Library

    This is a Server Query library written in Java SE 5, which can be used by a Java developer to create an own application which needs to use the Server Query interface of a Teamspeak 3 server.

    -= Library Documentation =-
    http://www.stefan1200.de/documentation/jts3serverquery/

    -= Features =-
    • The connection to the TS3 telnet port, the selection of the virtual TS3 server and changing the telnet username is easy to do.
    • One function to request many different lists (server, channel, client, ban, complains, etc.). These will be returned as HashMap within a Vector, which allow to get the telnet variables.
    • One function to request single informations (server, channel, client). These will be returned as HashMap, which allow to get the telnet variables.
    • Direct function to kick, poke and move Clients, delete channels, add or delete complains, send chat messages, etc..
    • Support for the telnet event system (receive chat messages, connect and disconnect events from clients).


    -= History =-
    Click here

    -= Own projects using this library =-
    JTS3ServerMod - TS3 Bot with many functions

    -= Download =-
    http://www.stefan1200.de/dlrequest.p...uery&type=.zip
    Notice: Version 2.0 and newer are not compatible with version 1.0.10 or older!

    Edit (06.02.2010): Updated documentation, more functions ready for use.
    Edit (07.02.2010): Download link for beta 1 added and updated documentation.
    Edit (09.02.2010): Download link for beta 2 added and updated documentation.
    Edit (09.02.2010): Download link for beta 2 hotfix added
    Edit (10.02.2010): Download link for beta 3 added and updated documentation.
    Edit (11.02.2010): Download link for beta 4 added and updated documentation.
    Edit (12.02.2010): Download link for beta 5 added and updated documentation.
    Edit (13.02.2010): Download link for beta 6 added and updated documentation.
    Edit (15.02.2010): Download link for beta 6 hotfix added
    Edit (15.02.2010): Download link for beta 7 added and updated documentation.
    Edit (17.02.2010): Download link for beta 8 added and updated documentation.
    Edit (17.02.2010): Download link for beta 9 added and updated documentation.
    Edit (20.02.2010): Download link for beta 10 added
    Edit (10.04.2010): Download link for beta 11 added and updated documentation.
    Edit (23.04.2010): Download link for beta 12 added
    Edit (19.07.2010): Download link for RC 1 added and updated documentation.
    Edit (11.09.2010): Download link for 1.0 Final added and updated documentation.
    Edit (26.09.2010): Download link for 1.0.1 Final added and updated documentation.
    Edit (02.10.2010): Download link for 1.0.2 Final added
    Edit (25.10.2010): Download link for 1.0.3 Final added
    Edit (07.12.2010): Download link for 1.0.4 Final added
    Edit (12.03.2011): Download link for 1.0.5 Final added
    Edit (30.03.2011): Download link for 1.0.6 Final added
    Edit (16.07.2011): Small updates to the documentation (and new address)
    Edit (17.11.2011): Download link for 1.0.7 Final added
    Edit (05.04.2013): Version 1.0.9 Final released
    Edit (18.06.2014): Download link for 1.0.10 Final added and updated documentation.
    Edit (16.11.2014): Download link for 2.0 Final added and updated documentation.
    Edit (04.07.2015): Download link for 2.0.1 Final added and updated documentation.
    Edit (06.07.2015): Download link for 2.0.2 Final added and updated documentation.
    Edit (31.10.2015): Download link for 2.0.3 Final added and updated documentation.
    Edit (02.04.2016): Download link for 2.0.4 Final added and updated documentation.
    Edit (31.08.2016): Download link for 2.0.5 Final added and updated documentation.
    Edit (20.11.2016): Download link for 2.0.6 Final added and updated documentation.
    Last edited by Stefan1200; November 20th, 2016 at 01:28 PM. Reason: new version

  2. #2
    Join Date
    December 2009
    Location
    Germany
    Posts
    2,356
    Currently works:

    Code:
    JTS3ServerQuery query = new JTS3ServerQuery();
    		
    // Connect to TS3 Server
    query.connectTS3Query("server.com", 10011);
    
    // Server List
    Vector<HashMap<String, String>> dataServerList = query.getList(JTS3ServerQuery.LISTMODE_SERVERLIST);
    for (HashMap<String, String> hashMap : dataServerList)
    {
    	System.out.println(hashMap.get("virtualserver_name"));
    }
    
    // Select virtual Server
    query.selectVirtualServer(1);
    
    // Server Info
    Vector<HashMap<String, String>> dataServerInfo = query.getList(JTS3ServerQuery.LISTMODE_SERVERINFO);
    for (HashMap<String, String> hashMap : dataServerInfo)
    {
    	System.out.println(hashMap.get("virtualserver_clientsonline"));
    }
    
    // Channel List
    Vector<HashMap<String, String>> dataChannelList = query.getList(JTS3ServerQuery.LISTMODE_CHANNELLIST);
    for (HashMap<String, String> hashMap : dataChannelList)
    {
    	System.out.println(hashMap.get("channel_name"));
    }
    
    // Client List
    Vector<HashMap<String, String>> dataClientList = query.getList(JTS3ServerQuery.LISTMODE_CLIENTLIST, "-times");
    for (HashMap<String, String> hashMap : dataClientList)
    {
    	System.out.println(hashMap.get("client_nickname") + ": " + hashMap.get("client_idle_time"));
    }
    
    // Login
    query.loginTS3("serveradmin", "password", null);
    
    // Permission List
    Vector<HashMap<String, String>> dataPermissionList = query.getList(JTS3ServerQuery.LISTMODE_PERMISSIONLIST);
    for (HashMap<String, String> hashMap : dataPermissionList)
    {
    	System.out.println(hashMap.get("permname"));
    }
    
    // Server Group List
    Vector<HashMap<String, String>> dataServerGroupList = query.getList(JTS3ServerQuery.LISTMODE_SERVERGROUPLIST);
    for (HashMap<String, String> hashMap : dataServerGroupList)
    {
    	System.out.println(hashMap.get("name"));
    }
    
    // Client DB List
    Vector<HashMap<String, String>> dataClientDBList = query.getList(JTS3ServerQuery.LISTMODE_CLIENTDBLIST, "start=0,duration=5");
    for (HashMap<String, String> hashMap : dataClientDBList)
    {
    	System.out.println(hashMap.get("client_nickname"));
    }
    
    // Close connection
    query.closeTS3Connection();
    Last edited by Stefan1200; February 7th, 2010 at 12:52 PM.

  3. #3
    Join Date
    December 2009
    Location
    Germany
    Posts
    2,356
    First beta version is ready, see first post.

    I did only some tests, so it may have some bugs.

  4. #4
    Join Date
    December 2009
    Location
    Germany
    Posts
    2,356
    Second beta version released, see first post:
    Version 0.4 (09.02.2010)
    + Function pokeClient() added
    + Function getLogEntries() added
    - Bugfix: String escaping for TS3 server was wrong

  5. #5
    Join Date
    December 2009
    Location
    Germany
    Posts
    118
    I dont use JAVA, but C#'s synatx is very similar to java. So I think your decoding is still wrong. Here is the example:

    Original: Test\safe
    Encoded: Test\\safe
    Decoded: Test\ afe

  6. #6
    Join Date
    December 2009
    Location
    Germany
    Posts
    2,356
    Quote Originally Posted by Scordo View Post
    I dont use JAVA, but C#'s synatx is very similar to java. So I think your decoding is still wrong. Here is the example:

    Original: Test\safe
    Encoded: Test\\safe
    Decoded: Test\ afe
    Yes, you are right. I will try to find a solution, currently there should be only a bug if a Channel, Client name or Client user hash contains a backslash '\'.

    Thanks for the bug report .

  7. #7
    Join Date
    December 2009
    Location
    Germany
    Posts
    118
    The solution is to not replace parts of the string that were already touched by a previous replace.

  8. #8
    Join Date
    December 2009
    Location
    Germany
    Posts
    2,356
    Hotfix for the second beta version released, see first post:

    Version 0.4.1 (09.02.2010)
    - Bugfix: In rare cases the String decoding was wrong. Now it should be right. (thx to Scordo)

  9. #9
    Join Date
    December 2009
    Location
    Germany
    Posts
    118
    Btw. you forgot to escape & unescape:

    Bell \a
    Backspace \b
    Formfeed \f
    Newline \n
    Carriage Return \r
    Horizontal Tab \t
    Vertical Tab \v

  10. #10
    Join Date
    December 2009
    Location
    Germany
    Posts
    2,356
    Quote Originally Posted by Scordo View Post
    Btw. you forgot to escape & unescape:
    I know, this things was not so important in my opinions. But you are right, a library should do this. New version will be ready very soon.

  11. #11
    Join Date
    December 2009
    Location
    Germany
    Posts
    2,356
    Third beta version released:

    Version 0.5 Beta 3 (10.02.2010)
    + Added escaping of all special characters, even uncommon ones.
    + Function encodeTS3String() and decodeTS3String()

  12. #12
    Join Date
    December 2009
    Location
    Germany
    Posts
    2,356
    Again a new beta release:

    Version 0.6 Beta 4 (11.02.2010)
    + Function getCurrentClientID(), getCurrentClientServerID() and getCurrentClientChannelID()
    - Bugfix: Reworked sendTextMessage(), now it should work correctly and without warnings.

  13. #13
    Join Date
    December 2009
    Location
    Germany
    Posts
    2,356
    New beta with Teamspeak events:

    Version 0.7 Beta 5 (12.02.2010)
    + Added TeamspeakActionListener interface
    + Functions addEventNotify() and removeAllEvents() added
    + Functions setTeamspeakActionListener() and removeTeamspeakActionListener() added
    o Many internal changes
    o Created a new example which shows the new features of version 0.7.

  14. #14
    Join Date
    December 2009
    Location
    Germany
    Posts
    2,356
    New version with important bugfixes:

    Version 0.7.1 Beta 6 (13.02.2010)
    - Bugfix: getCurrentClientID() return wrong client ID after login.
    - Bugfix: Fixed some bugs in function getLogEntries(). Timestamp argument is now a long.
    o Catch exceptions while call teamspeakActionPerformed to save library.
    o Synchronized a function to get this library threadsave, still need some tests.

  15. #15
    Join Date
    December 2009
    Location
    Germany
    Posts
    2,356
    New beta, which fix a small issue in beta 6.

    Version 0.7.1 Beta 6 Hotfix (14.02.2010)
    o Call teamspeakActionPerformed in an own Thread which solves some issues.
    Last edited by Stefan1200; February 15th, 2010 at 10:03 AM.

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, 01:00 AM
  2. [DEV] TeamSpeak 3 Server Query Java API
    By Bertieboy7 in forum Tools / Web Based
    Replies: 11
    Last Post: February 28th, 2016, 06:39 PM
  3. Replies: 6
    Last Post: May 21st, 2013, 03:10 PM
  4. Replies: 9
    Last Post: January 3rd, 2010, 03: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
  •