Community Forums Today's Posts     Member List     Archive    
Results 1 to 8 of 8
  1. #1
    Join Date
    Feb 2010
    Location
    Netherlands
    Posts
    98

    [PluginSDK] Query parent channel

    You can query the order of a subchannel in it's hierarchy, but to be able to build the complete hierarchy you also need to know the parent channel of the subchannels with order = 0. Currently, there doesn't seem to be any way to query the parent channel.

  2. #2
    Join Date
    Jan 2010
    Location
    Germany
    Posts
    2,050
    You can get the whole Path of any Channel by a single call to getChannelConnectInfo, which you could then use to get the ChannelID of the parent Channel.
    Might not be an ideal solution, but it works for now.

  3. #3
    Join Date
    Feb 2010
    Location
    Netherlands
    Posts
    98
    Quote Originally Posted by SilentStorm View Post
    You can get the whole Path of any Channel by a single call to getChannelConnectInfo, which you could then use to get the ChannelID of the parent Channel.
    Might not be an ideal solution, but it works for now.
    Thanks for the quick reply, that certainly does work, but it would be much simpler if we could just query the parent ChannelID.

  4. #4
    Join Date
    Jan 2010
    Location
    Germany
    Posts
    2,050
    Yes it would make it easier, I was merely pointing out a way which works right now as from experience I know these Ideas usually come to mind when you are in need of the particular feature.

  5. #5
    Join Date
    Jun 2008
    Location
    Krün, Germany
    Posts
    482
    You are right, a quick way to get the parent channel ID is missing. I can add this to the plugin SDK. The TeamSpeak client already has the info, so it can be easily forwarded to plugins.
    Using getChannelConnectInfo sounds ugly.

    Something like this should work, I suppose:
    Code:
    unsigned int getParentChannelID(uint64 serverConnectionHandlerID, uint64 channelID, uint64* result);

  6. #6
    Join Date
    Feb 2010
    Location
    Netherlands
    Posts
    98
    Wouldn't it be better to make it part of getChannelVariableAsInt with a CHANNEL_PARENT flag?

    I now have the join next/previous channel functionality working with getChannelConnectInfo, however it did require a lot of code to actually sort the array of channels. Being able to query the parent would make this a bit easier, but to really be able to sort these channels in a convenient fashion I would also need a way to query it's subchannels. I suggest also adding a CHANNEL_CHILD flag to query the top channel in it's subchannel hierarchy (the one where order = 0).

    Also, getChannelConnectInfo is the only function I know of where you need to do your own memory management for the output strings. However, there doesn't seem to be any upper limit defined for the resulting strings, so I have no idea how big my buffer should be. And I just hate the "big enough" allocating scheme.

    Thank you for listening to my suggestions.
    Last edited by Armada651; 02-05-2012 at 11:01.

  7. #7
    Join Date
    Jun 2008
    Location
    Krün, Germany
    Posts
    482
    No for internal reasons (now that was a good argument, wasn't it?) :-)
    All those CHANNEL_* variables are also managed by the server, which isn't needed in this case. Using an individual function can bypass this mechanism.

    For a plugin author it would appear logical, I agree. But for architectural reasons it would just add unnecessary load to the server and network traffic.

  8. #8
    Join Date
    Jun 2008
    Location
    Krün, Germany
    Posts
    482
    Erm, I take everything back which I wrote above. Such a function already exists, see ts3_functions.h:

    Code:
    unsigned int (*getParentChannelOfChannel)(uint64 serverConnectionHandlerID, uint64 channelID, uint64* result);
    Sorry for the confusion. :-)

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Channel created server callback : can't get parent channel id
    By maitredede in forum General Questions
    Replies: 0
    Last Post: 14-07-2011, 12:29
  2. [No Bug] Server Query: channelinfo, no channel parent id
    By Balon in forum Bug Reports
    Replies: 2
    Last Post: 05-06-2011, 08:52
  3. [PluginSDK]Featurerequest: Query friend/foe list
    By Thomas in forum Suggestions and Feedback
    Replies: 0
    Last Post: 21-10-2010, 07:31
  4. Where is 'Whisper to parent channel'?
    By Legolasindar in forum Client Support
    Replies: 3
    Last Post: 19-02-2010, 10:33

Posting Permissions

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