Kicking clients
Clients can be forcefully removed from a channel or the whole server.
From server
To remove the client from the server call
-
unsigned int ts3client_requestClientKickFromServer(uint64 serverConnectionHandlerID, const anyID *clientIDArray, const char *kickReason, const char *returnCode)
Request client(s) to be kicked from the server.
The clients will be disconnected and shown the reason. Reason is also displayed to everyone else on the server. You will receive an onServerErrorEvent with the passed returnCode indicating whether or not the operation was successful.
- Parameters:
serverConnectionHandlerID – the connection handler on which the client is located
clientIDArray – a NULL terminated array of client Ids to kick from their current channel.
kickReason – an explanatory message to display as the reason for everyone.
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
From channel
To remove the client from their current channel and place them in the default channel of the server use
-
unsigned int ts3client_requestClientKickFromChannel(uint64 serverConnectionHandlerID, const anyID *clientIDArray, const char *kickReason, const char *returnCode)
Request client(s) to be kicked from their current channel.
Kicking a client is essentially a glorified move to the server default channel with a message displayed to everyone. You will receive an onServerErrorEvent with the passed returnCode indicating whether or not the operation was successful.
- Parameters:
serverConnectionHandlerID – the connection handler on which the client is located
clientIDArray – a NULL terminated array of client Ids to kick from their current channel.
kickReason – an explanatory message to display as the reason for everyone.
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
Callbacks
One of the following callbacks will be called if the kick was successfull, depending on whether the kick was from the server or channel
-
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 (*onClientKickFromChannelEvent)(uint64 serverConnectionHandlerID, anyID clientID, uint64 oldChannelID, uint64 newChannelID, int visibility, anyID kickerID, const char *kickerName, const char *kickerUniqueIdentifier, const char *kickMessage)
called when a client is kicked from their channel
- Param serverConnectionHandlerID:
specifies on which connection the callback was called
- Param clientID:
id of the client that was kicked
- Param oldChannelID:
id of the previous channel the client used to be in
- Param newChannelID:
id of the current channel the client was kicked to. This is the id of the server default channel.
- Param visibility:
whether we can see the client. One of the values from the Visibility enum.
- Param kickerID:
id of the client that kicked the client. 0 if the server kicked the client.
- Param kickerName:
utf8 encoded c string containing the display name of the client initiating the kick
- Param kickerUniqueIdentifier:
utf8 encoded c string containing the identifier of the client initiating the kick
- Param kickMessage:
utf8 encoded c string containing the provided reason for the kick
-
void (*onClientKickFromServerEvent)(uint64 serverConnectionHandlerID, anyID clientID, uint64 oldChannelID, uint64 newChannelID, int visibility, anyID kickerID, const char *kickerName, const char *kickerUniqueIdentifier, const char *kickMessage)
called when a client was kicked from the server
- Param serverConnectionHandlerID:
specifies on which connection the callback was called
- Param clientID:
id of the client that was kicked
- Param oldChannelID:
id of the previous channel the client used to be in
- Param newChannelID:
always 0
- Param visibility:
whether we can see the client. One of the values from the Visibility enum.
- Param kickerID:
id of the client that kicked the client. 0 if the server kicked the client.
- Param kickerName:
utf8 encoded c string containing the display name of the client initiating the kick
- Param kickerUniqueIdentifier:
utf8 encoded c string containing the identifier of the client initiating the kick
- Param kickMessage:
utf8 encoded c string containing the provided reason for the kick
-
void (*onClientKickFromChannelEvent)(uint64 serverConnectionHandlerID, anyID clientID, uint64 oldChannelID, uint64 newChannelID, int visibility, anyID kickerID, const char *kickerName, const char *kickerUniqueIdentifier, const char *kickMessage)