Forum

Results 1 to 6 of 6
  1. #1
    Join Date
    September 2018
    Location
    Germany
    Posts
    15

    Question SDK event when a user joins client's channel?

    Is there such an event?

  2. #2
    Join Date
    May 2016
    Location
    Idar-Oberstein
    Posts
    148
    Not specific to one's own channel.
    You'll wanna forward the general purpose client move events to a common function like:
    Code:
    void onClientMoveCommon(uint64 sc_handler_id, anyID client_id, uint64 old_channel_id, uint64 new_channel_id, int visibility)
    {
        if (visibility == LEAVE_VISIBILITY)
            return;
    
        uint64 mover_channel;
        unsigned int error = ts3client_getChannelOfClient(sc_handler_id, client_id, &mover_channel);
        if (error != ERROR_ok)
        {
            ts3client_logMessage("Couldn't get mover's channel", LogLevel_ERROR, "", sc_handler_id);
            return;
        }
    
        anyID my_id;
        error = ts3client_getClientID(sc_handler_id, &my_id);
        if (error != ERROR_ok)
        {
            ts3client_logMessage("Couldn't get my id", LogLevel_ERROR, "", sc_handler_id);
            return;
        }
        uint64 my_channel;
        error = ts3client_getChannelOfClient(sc_handler_id, my_id, &my_channel);
        if (error != ERROR_ok)
        {
            ts3client_logMessage("Couldn't get my channel", LogLevel_ERROR, "", sc_handler_id);
            return;
        }
        if (mover_channel == my_channel)
            ts3client_logMessage("Client joined my channel", LogLevel_INFO, "", sc_handler_id);
    }
    Last edited by thorwe; October 23rd, 2018 at 02:11 PM. Reason: Second getchannelofclient should use my id

  3. #3
    Join Date
    September 2018
    Location
    Germany
    Posts
    15
    Thanks, I'll try that

  4. #4
    Join Date
    May 2016
    Location
    Idar-Oberstein
    Posts
    148
    Please note there‘s been an edit in the code above...
    Name:  43AE4E2E-322B-4C75-9547-BDF4633C3D0A.jpeg
Views: 47
Size:  11.4 KB

  5. #5
    Join Date
    September 2018
    Location
    Germany
    Posts
    15
    Quote Originally Posted by thorwe View Post
    Not specific to one's own channel.
    You'll wanna forward the general purpose client move events to a common function like:
    Code:
    void onClientMoveCommon(uint64 sc_handler_id, anyID client_id, uint64 old_channel_id, uint64 new_channel_id, int visibility)
    {
        if (visibility == LEAVE_VISIBILITY)
            return;
    
        uint64 mover_channel;
        unsigned int error = ts3client_getChannelOfClient(sc_handler_id, client_id, &mover_channel);
        if (error != ERROR_ok)
        {
            ts3client_logMessage("Couldn't get mover's channel", LogLevel_ERROR, "", sc_handler_id);
            return;
        }
    
        anyID my_id;
        error = ts3client_getClientID(sc_handler_id, &my_id);
        if (error != ERROR_ok)
        {
            ts3client_logMessage("Couldn't get my id", LogLevel_ERROR, "", sc_handler_id);
            return;
        }
        uint64 my_channel;
        error = ts3client_getChannelOfClient(sc_handler_id, my_id, &my_channel);
        if (error != ERROR_ok)
        {
            ts3client_logMessage("Couldn't get my channel", LogLevel_ERROR, "", sc_handler_id);
            return;
        }
        if (mover_channel == my_channel)
            ts3client_logMessage("Client joined my channel", LogLevel_INFO, "", sc_handler_id);
    }
    But isn't the channel of the joining user given as new_channel_id thus I don't need to get "mover_channel"?

    Also, with what command do I get whetever the user is a buddy or not?

    Also another little question I have :> How do I get userinput? (I couldn't find it in the sdk)
    Last edited by Keyinator; October 23rd, 2018 at 10:25 PM.

  6. #6
    Join Date
    May 2016
    Location
    Idar-Oberstein
    Posts
    148
    Ehr, indeed it is. Well, too much work...braindead...

    The buddy system and hotkeys are not part of the sdk, as that's already part of the game or application the sdk is embedded into usually.
    Same goes for the permission system etc., as the users are put into the channels on a per match/map instance basis and aren't supposed to have access to managing who talks to who manually.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Autojumping if user joins specific channel
    By Tenou in forum Client Plugins / Lua Scripts
    Replies: 1
    Last Post: August 17th, 2017, 04:58 PM
  2. Replies: 1
    Last Post: March 27th, 2017, 04:57 PM
  3. [Resolved] [Temporary Channel] Created after certain User joins ?
    By h9lz44 in forum General Questions
    Replies: 4
    Last Post: April 30th, 2013, 05:38 PM
  4. [Rejected] Notify when a user joins a specific channel
    By SinisterSaint in forum Suggestions and Feedback
    Replies: 4
    Last Post: July 27th, 2011, 05:07 PM
  5. Assign non-default channel group when user joins channel.
    By Morfi in forum Permission System
    Replies: 0
    Last Post: May 15th, 2010, 09:06 PM

Posting Permissions

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