Forum

Results 1 to 2 of 2
  1. #1
    Join Date
    October 2015
    Location
    Germany, Bavaria
    Posts
    132

    Usage of ts3Functions.startConnection's defaultChannelArray parameter

    I am trying to establish a new server connection using the C SDK,
    but there is parameter that really confuses me.

    The documentations say its an array of strings, but it only takes a single const char**? Is this a pointer to a pointer to an array??

    I also haven't found any open source code using this, and the SDK Demo doesn't implement this either.

    Can someone provide me a context of this function being used?

  2. #2
    Join Date
    September 2005
    Location
    Germany / Dortmund
    Posts
    1,376
    Thats an array of c-strings.

    Code:
    void bar(char** arr) {
      for (int i = 0; arr[i]; ++i) {
        printf("%s\n", arr[i]);
      }
    }
    
    char* foo[] = {"asd", "muh", nullptr};
    bar(foo);
    But if I remember correctly, you should use guiConnect to start a new connection affecting the UI of the client.

    Edit: the function is documented in the official docs and you have to terminate the array with an empty string, otherwise the client will crash. @devs: I hope the new api will be more consistent in terms of handling string arrays.
    Last edited by Thomas; August 29th, 2018 at 11:47 PM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. ts3Functions.getClientList()... How do I use that?
    By Jhhhj_original in forum Client Plugins / Lua Scripts
    Replies: 71
    Last Post: March 15th, 2017, 08:49 PM
  2. ts3Functions.requestChannelGroupClientList
    By Bluscream in forum Suggestions and Feedback
    Replies: 1
    Last Post: October 26th, 2016, 05:44 AM
  3. C# - ts3client_startConnection - How to pass in defaultChannelArray
    By maeglinFefalas in forum General Questions
    Replies: 1
    Last Post: August 26th, 2016, 03:55 PM
  4. [Resolved] startConnection 519 could not validate client identity
    By stargate75 in forum General Questions
    Replies: 2
    Last Post: June 29th, 2016, 05:22 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
  •