Deleting a channel
A channel can be removed by calling
-
unsigned int ts3client_requestChannelDelete(uint64 serverConnectionHandlerID, uint64 channelID, int force, const char *returnCode)
Request a channel to be deleted.
Whether or not this was successful can be determined through the associated onServerErrorEvent callback.
- Parameters:
serverConnectionHandlerID – the connection handler on which the channel is located
channelID – the channel id to delete
force – boolean value on whether to kick clients out and delete any sub channels before deleting the channel. 1 = kick everyone, then delete sub channels and finally the requested channel; 0 = fail if there are clients in the channel or the channel has sub channels.
returnCode – a c string to identify this request in callbacks. Pass an empty string if unused.
- Returns:
An Error code from the Ts3ErrorType enum indicating either success or the failure reason
Delay channel deletion
With the delayed temporary channel deletion feature, users can define
by how many seconds the deletion of a temporary channel will be delayed
after the last client has left the channel. The delay is defined by
setting the channel variable CHANNEL_DELETE_DELAY
.
This variable can be set and queried as described in the Channel information section.
To query the time in seconds since the last client has left a temporary channel call
-
unsigned int ts3client_getChannelEmptySecs(uint64 serverConnectionHandlerID, uint64 channelID, int *result)
get time in seconds since last client left the specified channel
- Parameters:
serverConnectionHandlerID – connection handler on which the channel is located
channelID – id of the channel to get the
result – address of a variable to receive the result on success
- Returns:
An Error code from the Ts3ErrorType enum indicating either success or the failure reason
Callback
After the server is done moving clients and the channel was removed the following callback is called (potentially multiple times, if sub channels need to be deleted).
-
struct ClientUIFunctions
Defines available callbacks that you can receive.
Set the members of this struct to a function to call when the specific event happens.
Public Members
-
void (*onDelChannelEvent)(uint64 serverConnectionHandlerID, uint64 channelID, anyID invokerID, const char *invokerName, const char *invokerUniqueIdentifier)
called when a channel is deleted
- Param serverConnectionHandlerID:
specifies on which connection the callback was called
- Param channelID:
the id of the channel that is deleted. This channel is gone already when this is called. It’s not possible to get any information about this channel anymore.
- Param invokerID:
client id of the client that deleted the channel. 0 if deleted by the server.
- Param invokerName:
utf8 encoded c string containing the display name of the client that caused deletion
- Param invokerUnqiueIdentifier:
utf8 encoded c string containing the unique identifier of the client that caused deletion
-
void (*onDelChannelEvent)(uint64 serverConnectionHandlerID, uint64 channelID, anyID invokerID, const char *invokerName, const char *invokerUniqueIdentifier)