Results 1 to 8 of 8
Thread: [PluginSDK] Query parent channel
-
28-04-2012, 00:58 #1
-= TeamSpeak Lover =-
- Join Date
- Feb 2010
- Location
- Netherlands
- Posts
- 95
[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.
-
28-04-2012, 01:10 #2
-= TeamSpeak Fanatic =-
- Join Date
- Jan 2010
- Location
- Germany
- Posts
- 2,039
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.
-
28-04-2012, 01:22 #3
-= TeamSpeak Lover =-
- Join Date
- Feb 2010
- Location
- Netherlands
- Posts
- 95
-
28-04-2012, 01:40 #4
-= TeamSpeak Fanatic =-
- Join Date
- Jan 2010
- Location
- Germany
- Posts
- 2,039
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.
-
02-05-2012, 10:29 #5
-= TeamSpeak Team =-
- Join Date
- Jun 2008
- Location
- Krün, Germany
- Posts
- 464
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);
-
02-05-2012, 10:40 #6
-= TeamSpeak Lover =-
- Join Date
- Feb 2010
- Location
- Netherlands
- Posts
- 95
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.
-
02-05-2012, 10:56 #7
-= TeamSpeak Team =-
- Join Date
- Jun 2008
- Location
- Krün, Germany
- Posts
- 464
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.
-
02-05-2012, 11:26 #8
-= TeamSpeak Team =-
- Join Date
- Jun 2008
- Location
- Krün, Germany
- Posts
- 464
Erm, I take everything back which I wrote above. Such a function already exists, see ts3_functions.h:
Sorry for the confusion. :-)Code:unsigned int (*getParentChannelOfChannel)(uint64 serverConnectionHandlerID, uint64 channelID, uint64* result);
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Similar Threads
-
Channel created server callback : can't get parent channel id
By maitredede in forum General QuestionsReplies: 0Last Post: 14-07-2011, 12:29 -
[No Bug] Server Query: channelinfo, no channel parent id
By Balon in forum Bug ReportsReplies: 2Last Post: 05-06-2011, 08:52 -
[PluginSDK]Featurerequest: Query friend/foe list
By Thomas in forum Suggestions and FeedbackReplies: 0Last Post: 21-10-2010, 07:31 -
Where is 'Whisper to parent channel'?
By Legolasindar in forum Client SupportReplies: 3Last Post: 19-02-2010, 10:33


Reply With Quote
