Forum


Notice to all users

We are migrating towards a new forum system located at community.teamspeak.com, as such this forum will become read-only on January 29, 2020

Page 1 of 3 123 LastLast
Results 1 to 15 of 32
  1. #1
    Join Date
    September 2005
    Location
    Germany / Dortmund
    Posts
    1,376

    Sticky TS3 IPC Plugin - Use the plugin sdk in your external apps

    I'm glad to introduce the ts3 ipc plugin.

    What it does:
    With this plugin enabled, you have the possibility to interact with the client and react to the client's events within your external applications.

    Why would I need it?
    Some of you missed some kind of TSRemote app (known from TeamSpeak 2), with this plugin and your own app this could be realized.

    Why should I use this plugin and lib instead of using the clientquery plugin?
    My clientlib is nearly the whole plugin SDK transformed into interprocess communication functions and it offers a similar interface. If you use the clientquery plugin you need to parse the output yourself, with this lib, you get the data types you need (eg. string, clientids[anyID], channelids[uint64],...).

    What you will get:
    Included in the download are the plugin (ts3_ipcplugin.so/libts3_ipcplugin.so), the shared library to interact with the plugin (ts3_ipcplugin_client_lib.dll/libts3_ipcplugin_client_lib.so), the lib to link with and the C-Headers to include in your project.
    libts3_ipcplugin.so/ts3_ipcplugin.dll - This is the plugin, put it in your TS3 plugins directory.
    libts3_ipcplugin_client_lib.so/ts3_ipcplugin_client_lib.dll - This is the library you can use in your project. Put it in a directory of your PATH variable or in the working directory of your project.

    Can I use the full plugin sdk?
    Not quite. The functions to interact with the FMOD library are not implemented and the new functions ts3plugin_infoTitle, ts3plugin_infoData, ts3plugin_freeMemory are also not, because of the possible high frequency of calling.
    The "clients" can't change the return values of events like processCommand, onClientPoke, onTextMessage, etc.
    The event onUserLoggingMessage won't be broadcastet, if the ts3 ipc plugin itself logs a message.
    Everything else can be used.

    Which programming languages are supported?
    Every language which can load shared C libraries, so for example C, C++, C#, Delphi, VB,...
    There is a C/C++ header included, so C and C++ can be used immediately. For other languages you need to load the library manually (see your language documentation for more information).


    Supported OS: Linux 32/64 bit, Windows 32/64 bit

    Hopefully, I will add a release for Mac in a couple of days.


    Download: http://www.planetteamspeak.com/compo...id,69/gid,106/ (Plugin API version 8 / Client Beta29)
    EDIT: Updated to plugin/lib version 1.02 (21.08.2010)
    EDIT: Updated to plugin/lib version 1.03 (18.09.2010)

    Download Example: http://download.planetteamspeak.com/...ib_example.zip
    (Shows how to react on the events and how to call some functions)

    Note for windows users: The plugin is compiled with MinGW, if you don't have it, copy the two other DLL in the MAIN directory of your TeamSpeak 3 installation.
    The windows plugin is listening to port 61337, but only allows clients from the same machine. (On Linux the plugin uses unix domain sockets, so no port is used.)

    Note for linux users: You need to link your applications with pthread (link with -lpthread).


    I am looking forward to some feedback



    Code-Example
    Code:
    ...
    
    #include "ipc_client_commands.h"
    #include "public_errors.h"
    #ifdef linux
      #include <sys/ipc.h>
    #endif
    
    void onProcessCommand(uint64 schid, const char* cmd, void* ptr) {
      //react here on the event or do some pseudo oop call with ((myclasstype*)ptr)->processCommand(schid, cmd)
    }
    
    void onPluginLoaded() {
      //will be called, when the ts3 client starts and the plugin is loaded
    }
    
    int main(int argc, char** argv) {
    #ifdef WIN32
      unsigned int ret = initSDK("plus");
    #else
      key_t key = ftok("./", 42);
      unsigned int ret = initSDK(key);
    #endif
      if (ret == ERROR_ok) {
        ts3_ipc_event_callbacks cbs;
        memset(&cbs, 0, sizeof(ts3_ipc_event_callbacks));
    
        cbs.processCommand = onProcessCommand;
        //cbs.object = pmyclass;
    
        if (registerCallbacks(cbs) != ERROR_ok) 
          ;//error
    
        //do some other fantastic code
        //...
      }
      else if (ret == IPC_ERROR_NO_SERVER) {
        if (callOnPluginInitiation(onPluginLoaded) == ERROR_ok) 
          printf("plugin is not running, but I will be called, if it's up\n");
        else printf("some error occured in specifying callback function\n");
      }
    
      //...
    
      if (shutdownSDK() != ERROR_ok)
          ;//error while shutting down the connection to the plugin
    }
    
      return 0;
    }
    Last edited by Thomas; September 23rd, 2010 at 06:38 PM.

  2. #2
    Join Date
    September 2005
    Location
    Germany / Dortmund
    Posts
    1,376
    -== Updated to version 1.01 ==-
    Plugin:
    - Handles now crashes of the clientlib
    - Fixed a big bug in the command calling function (now clients can send more than one command )

    Lib:
    - Clients will unregister now correctly
    - initSDK, registerCallbacks and shutdownSDK returns now "unsigned int"


    (See the first post for a download link)

    ***Added an example*** (see first post as well)
    Last edited by Thomas; August 19th, 2010 at 12:12 AM.

  3. #3
    Join Date
    September 2005
    Location
    Germany / Dortmund
    Posts
    1,376
    -== Updated to version 1.02 ==-
    Plugin:
    - plugin wakes up the clients, which specified an initiation callback

    Lib:
    - shutdownSDK will return now the correct value, if initSDK failed
    - you can specify a callback function which is called, when the plugin inits (call it, if initSDK fails with IPC_ERROR_NO_SERVER)


    (See the first post for a download link)
    Last edited by Thomas; August 28th, 2010 at 04:38 PM.

  4. #4
    Join Date
    April 2009
    Location
    italy
    Posts
    44
    Thanks I think many people are happy in your work!
    I unfortunately with C + + are unable to work, you can use your dll with vb.net? can you help me with an example?

  5. #5
    Join Date
    September 2005
    Location
    Germany / Dortmund
    Posts
    1,376
    I'm not very familiar with VB, but I am quite sure, that you can load C libraries in your VB project.

  6. #6
    Join Date
    April 2009
    Location
    italy
    Posts
    44
    I do not understand how you can work, maybe I could do it with c # but I need help. another thing that should explain a bit how to install the files.
    excuse my English but I use google to translate! Thanks

  7. #7
    Join Date
    September 2005
    Location
    Germany / Dortmund
    Posts
    1,376
    You need to port the header (ipc_client_commands.h and if you need callbacks ipc_events.h as well) to VB (here is an example).

    Otherwise you can use the WINAPI functions LoadLibrary and GetProcAdress to dynamically load the library.


    libts3_ipcplugin.so/ts3_ipcplugin.dll - This is the plugin, put it in your TS3 plugins directory.
    libts3_ipcplugin_client_lib.so/ts3_ipcplugin_client_lib.dll - This is the library you can use in your project. Put it in a directory of your PATH variable or in the working directory of your project.

    EDIT: MeiserM transfered the SDK to VB.Net, this seems to be a good example to create your own VB interface.
    Last edited by Thomas; August 28th, 2010 at 04:47 PM.

  8. #8
    Join Date
    January 2007
    Location
    Berlin
    Posts
    25
    Hello!

    Does someone know how i can use this with delphi????



    Bye Sven!

  9. #9
    Join Date
    September 2005
    Location
    Germany / Dortmund
    Posts
    1,376
    Same like VB: you need a delphi interface.

    TheJomo has ported the plugin sdk interface to delphi. The plugin sdk and this lib is very similar.
    Hope that helps.

  10. #10
    Join Date
    June 2010
    Location
    Alzenau / Germany
    Posts
    97
    The addon sounds pretty useful. As you belong to the TS3 support team, can I suppose, that the addon will be updated regularily (with new API plugin versions) ?
    If it's able to handle multiple applications at a time, I'd like to use it to communicate with my overlay (http://ts3overlay.r-dev.de)

  11. #11
    Join Date
    September 2005
    Location
    Germany / Dortmund
    Posts
    1,376
    As you belong to the TS3 support team
    To make clear: the plugin is my private project and no software by TeamSpeak Systems GmbH.

    that the addon will be updated regularily
    But yes, I will try to

    If it's able to handle multiple applications at a time
    Don't understand what you mean. You can access the different connections (the TS3 client opened) with the identifying serverConnectionHandlerID, similar to the Plugin SDK of the TeamSpeak 3 client.

  12. #12
    Join Date
    April 2009
    Location
    italy
    Posts
    44
    I can not do without an example in vb I can not!

  13. #13
    Join Date
    June 2010
    Location
    Alzenau / Germany
    Posts
    97
    Quote Originally Posted by Thomas View Post
    Don't understand what you mean. You can access the different connections (the TS3 client opened) with the identifying serverConnectionHandlerID, similar to the Plugin SDK of the TeamSpeak 3 client.
    The TS3 overlay is a DLL that is injected into multiple processes, so I'd have multiple instances (different applications), that try to communicate with your plugin.
    My question is: can I "connect" to the plugin multiple times (from different applications) and receive the "ts3plugin_onTalkStatusChangeEvent" in every application? Or do I need to create one single instance that connects to the plugin and distribute the information to the other instances by myself?

  14. #14
    Join Date
    September 2005
    Location
    Germany / Dortmund
    Posts
    1,376
    Ah ok, got it

    Yes, multiple instances are possible.
    But you need to send different keys (on windows a 4 character-wide char-array) to the plugin (in initSDK()).

  15. #15
    Join Date
    April 2009
    Location
    italy
    Posts
    44
    Please one exemple in c or vb.net for swich channel!

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Where are the newest plugin.c and plugin.h files?
    By PatPeter in forum General Questions
    Replies: 5
    Last Post: July 24th, 2015, 11:43 AM
  2. Change Username from external without .dll Plugin
    By Androxin in forum Client Plugins / Lua Scripts
    Replies: 0
    Last Post: April 19th, 2015, 07:28 AM
  3. ts3 overlay plugin (Failed to open plugin)
    By netmario in forum Windows
    Replies: 0
    Last Post: September 22nd, 2010, 08:29 AM
  4. Using external lib in plugin
    By Otharath in forum Client Plugins / Lua Scripts
    Replies: 3
    Last Post: June 12th, 2010, 10:58 AM
  5. Replies: 0
    Last Post: April 9th, 2010, 12:21 AM

Posting Permissions

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