Community Forums Today's Posts     Member List     Archive    
Results 1 to 3 of 3
  1. #1
    Join Date
    Oct 2011
    Posts
    6

    Seeing which clients have a plugin enabled

    I'm working on a plugin that is only useful if everyone in your channel has it enabled. Is there a way to publish that you have a plugin enabled?

    Ideally, I'd like an icon next to the flag/group icons, but I'd even be happy with some text showing on the 'info' window when you click a client's name (like a channel's info).

    Any ideas? I see client's have a CLIENT_DESCRIPTION field but I don't seem to be able to update it from the plugin.

    EDIT: It looks like the Now Playing plugin does something like this, where they put some data below your description in the info panel. But how?

    EDIT: So I've added a server group that anyone can add/remove themselves from, is temporary, and includes a custom icon. If I can make the plugin add you to that group, it would be perfect. But I can't figure out how to get a list of server groups so I can get the sgid from the group with the correct name.

    Does anyone know how requestServerGroupList() works?

    Code:
    unsigned int (*requestServerGroupList)(uint64 serverConnectionHandlerID, const char* returnCode);
    Last edited by Wilson29thID; 03-03-2012 at 01:54. Reason: Added ideas

  2. #2
    Join Date
    Jan 2010
    Location
    Germany
    Posts
    2,046
    Once you call requestServerGroupList at some point later the

    Code:
    void ts3plugin_onServerGroupListEvent(uint64 serverConnectionHandlerID, uint64 serverGroupID, const char* name, int type, int iconID, int saveDB) {
        // serverConnectionHandlerID = the Server this Info is for
        // serverGroupID = ID of the ServerGroup
        // name = Name of this Servergroup
        // type = GroupType (Channel or ServerGroup) since this only gets called for Servergroups its irrelevant.
        // iconID = ID of the Icon for this Group
        // saveDB = Whether this Group is Permanent or not (Boolean)
    }
    Function will get called once for each ServerGroup.

    Once the Server has successfully send you the Information for each Group there is on the Server which you called the requestServerGroupList Function on the following Function will be called:
    Code:
    void ts3plugin_onServerGroupListFinishedEvent(uint64 serverConnectionHandlerID) {
        // You now know that you got all Servergroups on Server serverConnectionHandlerID
    }
    In order to add someone to a servergroup you would have to call
    Code:
    unsigned int (*requestServerGroupAddClient)(uint64 serverConnectionHandlerID, uint64 serverGroupID, uint64 clientDatabaseID, const char* returnCode);
    You will only be able to tell whether it worked or not by using a returnCode and checking that returnCode in the following two Functions to see if there actually was an error which is nonzero for that returncode. (if the error is 0 it worked)
    Code:
    int ts3plugin_onServerErrorEvent(uint64 serverConnectionHandlerID, const char* errorMessage, unsigned int error, const char* returnCode, const char* extraMessage) {
        return 1;
    }
    int ts3plugin_onServerPermissionErrorEvent(uint64 serverConnectionHandlerID, const char* errorMessage, unsigned int error, const char* returnCode, anyID failedPermissionID) {
        return 1;
    }

  3. #3
    Join Date
    May 2007
    Location
    Eastern NC
    Posts
    1,604
    Quote Originally Posted by Wilson29thID View Post
    I'm working on a plugin that is only useful if everyone in your channel has it enabled. Is there a way to publish that you have a plugin enabled?

    Ideally, I'd like an icon next to the flag/group icons, but I'd even be happy with some text showing on the 'info' window when you click a client's name (like a channel's info).

    Any ideas? I see client's have a CLIENT_DESCRIPTION field but I don't seem to be able to update it from the plugin.

    EDIT: It looks like the Now Playing plugin does something like this, where they put some data below your description in the info panel. But how?
    I think I can answer that, LOL. For Now Playing I use ts3Functions.sendPluginCommand, ts3plugin_infoData and ts3plugin_onPluginCommandEvent. For Nowplaying I actually have the client that is playing music, broadcast that to anyone that is subscribed to the channel the client is in using the sendPluginCommand. Those users (with and without the plugin) receive the command via ts3plugin_onPluginCommandEvent and if they are running the plugin it will process the data and either add a record or update a record in a vector. When you select a client it ts3plugin_infoData fires and I have code there to see if the selected item is a client and if I have their CID in the vector. If found it will it will update "data". See the sample in the SDK for details on ts3plugin_infodata.

    The plugin is a little more complex, but that is the jest of it. I thought about having the plugin not broadcast on each song play and instead use a method of requesting the song with you select a client from the infodata, but with the anti-spam updates that would be a problem if you were just scrolling through the users and you would be sending a plugincommand every time the selected user changed (the TS3 client will spam lock you on its own fast enough doing this, no need to have it happen faster). I'm still working on other issues due to the update with the plugin and subscribing a whole public server. I'm actually thinking the fix is to not restrict my song playing updates to only subscribed channels, but to the entire server. That would also remove most of the subscription changed, client moved, code that I have running and make it simpler. But when I first updated it the anti-spam was not and issue and my though was on the least bandwidth as needed.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. TS3MassMover - TS3 Client Plugin to move clients
    By Stefan1200 in forum Plugins
    Replies: 138
    Last Post: 16-04-2014, 23:59
  2. [Lua Plugin] Enable script to add clients to servergroup/channel group
    By willy_sunny in forum Suggestions and Feedback
    Replies: 0
    Last Post: 18-04-2011, 19:55
  3. Replies: 3
    Last Post: 21-09-2010, 10:33
  4. Replies: 1
    Last Post: 26-08-2010, 16:45
  5. Replies: 3
    Last Post: 14-07-2010, 09:30

Posting Permissions

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