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

Results 1 to 8 of 8
  1. #1
    Join Date
    February 2010
    Location
    Netherlands
    Posts
    108

    [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
    January 2010
    Location
    Germany
    Posts
    2,029
    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
    February 2010
    Location
    Netherlands
    Posts
    108
    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
    January 2010
    Location
    Germany
    Posts
    2,029
    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
    June 2008
    Location
    Krün, Germany
    Posts
    510
    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
    February 2010
    Location
    Netherlands
    Posts
    108
    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; May 2nd, 2012 at 12:01 PM.

  7. #7
    Join Date
    June 2008
    Location
    Krün, Germany
    Posts
    510
    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
    June 2008
    Location
    Krün, Germany
    Posts
    510
    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. [Resolved] Edit channel parent by query?
    By barricas in forum Server Support
    Replies: 1
    Last Post: May 23rd, 2013, 09:27 AM
  2. Replies: 1
    Last Post: May 15th, 2013, 11:06 AM
  3. [No Bug] Server Query: channelinfo, no channel parent id
    By Balon in forum Bug Reports [EN/DE]
    Replies: 2
    Last Post: June 5th, 2011, 09:52 AM
  4. [PluginSDK]Featurerequest: Query friend/foe list
    By Thomas in forum Suggestions and Feedback
    Replies: 0
    Last Post: October 21st, 2010, 08:31 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
  •