Forum

Page 1 of 2 12 LastLast
Results 1 to 15 of 17
  1. #1
    Join Date
    February 2017
    Posts
    45

    callback documentation

    Hi,

    is there somewhere a documentation about the callback functions??

    I'm looking for a callback that is triggered when someone joins or leaves my channel. The only one that i found is ts3plugin_onClientMoveEvent. But that is for the whole server. A workaround is to check whether the oldID or newID is the same as the one i'm in. But i couldn't find a function that returns the channel id i'm currently in.

    Any help about those functions??

  2. #2
    Join Date
    September 2005
    Location
    Germany / Dortmund
    Posts
    1,376
    There are docs in the download archive.

    ts3plugin_onClientMoveEvent is the only event to achieve something like this and your described way is imho the only possible solution to your problem. (But keep in mind, that there are other callbacks triggered for client movements like kicked, moved by another user, ...)

    Use getClientID to get your id and getChannelOfClient to get the channel you are in.

  3. #3
    Join Date
    February 2017
    Posts
    45
    thank you that getChannelFromClient was what i was looking for.

    Are those Kick, moveMoved,.. Alternative callbacks, or additional callbacks??

    And what callbacks are for Connect/disconnect of others?? i found the one for myselfe, but not for other users.

  4. #4
    Join Date
    September 2005
    Location
    Germany / Dortmund
    Posts
    1,376
    Quote Originally Posted by GT-Anakin View Post
    Are those Kick, moveMoved,.. Alternative callbacks, or additional callbacks??
    Those are additional callbacks. So if a client was moved by another user, ts3plugin_onClientMoveEvent won't be called, but ts3plugin_onClientMoveMovedEvent is called instead (same for the other callbacks).

    Quote Originally Posted by GT-Anakin View Post
    And what callbacks are for Connect/disconnect of others?? i found the one for myselfe, but not for other users.
    ts3plugin_onClientMoveEvent is called everytime, a client enters or has left your view. So this is called, whenever a client joined the server (and you subscribed his default channel) or comes from a channel you did not subscribe to (analogous for disconnected clients). Third option is when a client moves to another channel and you subscribed both the old and the new one (retained).

  5. #5
    Join Date
    February 2017
    Posts
    45
    what does subscribe mean?? Do i automatically subscribe a channel?? I haven't made much with TS and i just know some basics (connect, change channel, talk, chat)

  6. #6
    Join Date
    September 2005
    Location
    Germany / Dortmund
    Posts
    1,376
    If you subscribe to a channel (if you have permissions to do so), you'll see the clients in that channel. Try rightclick -> (un)subscribe on a channel.

    The channel you are currently in, is of course automatically subscribed.

  7. #7
    Join Date
    February 2017
    Posts
    45
    Ah i see in german it is "abonnieren"

    how can i find out someone disconnected/connected?? You said that the move event is triggered. But how can i test if it was a connect/disconnect/move?? There is no kind of status parameter

  8. #8
    Join Date
    September 2012
    Posts
    6,078
    If they moved to channel id 0 you will know they disconnected.
    When sending PMs please make sure to include a reference link to the thread in question in the body of your message.

  9. #9
    Join Date
    February 2017
    Posts
    45
    I tried to just print every event and it seams that when someone disconnected the id is no longer valid and i cannot get the name of the one who disconnected

  10. #10
    Join Date
    September 2012
    Posts
    6,078
    Yes, the user is no longer on the server at the time, as such the client ID is invalid and you cannot query any information about that client.
    When sending PMs please make sure to include a reference link to the thread in question in the body of your message.

  11. #11
    Join Date
    February 2017
    Posts
    45
    So there is no way to get the information about who disconnected except saving the names of all on the server and compare with the new list after someone disconnected right??

  12. #12
    Join Date
    September 2012
    Posts
    6,078
    If you have to know the name of the client who disconnected, then yes you'll have to maintain a local mapping of client ids to nicknames e.g. QHash<anyID, QString> (or its STL counterpart if you don't need/use Qt already).
    When sending PMs please make sure to include a reference link to the thread in question in the body of your message.

  13. #13
    Join Date
    February 2017
    Posts
    45
    hi there,

    i just wonder about the different between onNewChannelEvent and onNewChannelCreatedEvent
    and between onChannelUpdateEvent and onChannelUpdateEditedEvent

  14. #14
    Join Date
    September 2005
    Location
    Germany / Dortmund
    Posts
    1,376
    Quote Originally Posted by GT-Anakin View Post
    i just wonder about the different between onNewChannelEvent and onNewChannelCreatedEvent
    onNewChannelEvent is fired whenever a new channel enters your view. Eg. when you connect, you'll get this event for every existing channel. onNewChannelCreatedEvent is fired when a new channel is created (by a client).

    Quote Originally Posted by GT-Anakin View Post
    and between onChannelUpdateEvent and onChannelUpdateEditedEvent
    onChannelUpdateEditedEvent is fired when a client changed some channel variables. onChannelUpdateEvent is called, when the client "refreshed" the channel variables from the server (so clicking in the tree may trigger this).

  15. #15
    Join Date
    February 2017
    Posts
    45
    is there a callback to inform me that the client is muted (because he switched to a different server)??

    I found this:

    Code:
    void ts3plugin_onClientSelfVariableUpdateEvent(uint64 serverConnectionHandlerID, int flag, const char* oldValue, const char* newValue) {
    
    	if (flag == CLIENT_INPUT_HARDWARE)
    	{
    		// from speak to mute
    		if (atoi(oldValue) == 1 && atoi(newValue) == 0)
    		{
    			getController(serverConnectionHandlerID)->debugPrint("muted");
    		}
    		// from mute to speak
    		else if (atoi(oldValue) == 0 && atoi(newValue) == 1)
    		{
    			getController(serverConnectionHandlerID)->debugPrint("unmuted");
    		}
    		// this should not happen
    		else
    		{
    			getController(serverConnectionHandlerID)->debugPrint("This should not happen");
    		}
    	}
    }
    But only unmuted is printed. So the client is not informed about changing from state unmute to mute. Is there a different way for that?

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Client Side Callback after ts3server_clientMove?
    By King_Xulu in forum General Questions
    Replies: 2
    Last Post: February 20th, 2017, 04:08 PM
  2. Bug in onClientMoved() Callback Sequence?
    By King_Xulu in forum General Questions
    Replies: 0
    Last Post: January 25th, 2012, 06:56 PM
  3. requestClientMove() invokes wrong callback then crashes
    By King_Xulu in forum General Questions
    Replies: 2
    Last Post: January 10th, 2012, 03:06 PM
  4. Replies: 2
    Last Post: January 18th, 2011, 07:43 AM
  5. Any Callback or Event for HotKeys
    By jimbojackhammer in forum Client Plugins / Lua Scripts
    Replies: 0
    Last Post: June 24th, 2010, 06:34 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
  •