-
struct ServerLibFunctions
Server callbacks. Zero initialize and set members to functions that are to be called when the event in question happens. Every callback you use should exit quickly to avoid stalling the server. If you need any expensive activity upon receiving callbacks, consider starting the activity in a new thread and allow the callback to exit quickly.
Public Members
-
unsigned int (*permFileTransferInitUpload)(uint64 serverID, const struct ClientMiniExport *client, const struct ts3sc_ftinitupload *params)
called when a file is to be uploaded. Allows you to deny a client from uploading files, files above a certain size, etc.
Return ERROR_ok to allow the action, or ERROR_permissions to reject it.
- Param serverID:
the server for which the callback was called
- Param client:
describes the client that attempts to upload the file.
- Param params:
describes the file to be uploaded.
- Return:
ERROR_ok to allow, ERROR_permissions to deny
-
unsigned int (*permFileTransferInitDownload)(uint64 serverID, const struct ClientMiniExport *client, const struct ts3sc_ftinitdownload *params)
called when a file is to be downloaded. Allows you to deny a client from downloading files, files above a certain size, etc.
Return ERROR_ok to allow the action, or ERROR_permissions to reject it.
- Param serverID:
the server for which the callback was called
- Param client:
describes the client that attempts to download the file
- Param params:
describes the file to be downloaded.
- Return:
ERROR_ok to allow, ERROR_permissions to deny
-
unsigned int (*permFileTransferGetFileInfo)(uint64 serverID, const struct ClientMiniExport *client, const struct ts3sc_ftgetfileinfo *params)
called when a client requests file information using ts3client_requestFileInfo. Allows to deny clients from getting file information.
Return ERROR_ok to allow the action, or ERROR_permissions to reject it.
- Param serverID:
the server for which the callback was called
- Param client:
describes the client attempting to get information of the file.
- Param params:
describes the file that information is requested for.
- Return:
ERROR_ok to allow, ERROR_permissions to deny
-
unsigned int (*permFileTransferGetFileList)(uint64 serverID, const struct ClientMiniExport *client, const struct ts3sc_ftgetfilelist *params)
called when a client requests a directory listing using ts3client_requestFileList. Allows to deny listing files and directories in channels / directories.
Return ERROR_ok to allow the action, or ERROR_permissions to reject it.
- Param serverID:
the server for which the callback was called
- Return:
ERROR_ok to allow, ERROR_permissions to deny
-
unsigned int (*permFileTransferDeleteFile)(uint64 serverID, const struct ClientMiniExport *client, const struct ts3sc_ftdeletefile *params)
called when a client attempts to delete one or more files using ts3client_requestDeleteFile. Allows denying clients deleting files.
Return ERROR_ok to allow the action, or ERROR_permissions to reject it.
- Param serverID:
the server for which the callback was called
- Param client:
describes the client attempting to delete the file
- Param params:
describes the file to be deleted
- Return:
ERROR_ok to allow, ERROR_permissions to deny
-
unsigned int (*permFileTransferCreateDirectory)(uint64 serverID, const struct ClientMiniExport *client, const struct ts3sc_ftcreatedir *params)
called when a directory is to be created using ts3client_requestCreateDirectory. Allows to deny creating certain directories.
Return ERROR_ok to allow the action, or ERROR_permissions to reject it.
- Param serverID:
the server for which the callback was called
- Param client:
describes the client attempting to create the directory
- Param params:
describes the directory to create.
- Return:
ERROR_ok to allow, ERROR_permissions to deny
-
unsigned int (*permFileTransferRenameFile)(uint64 serverID, const struct ClientMiniExport *client, const struct ts3sc_ftrenamefile *params)
called when a file is to be renamed or moved using ts3client_requestRenameFile. Allows to deny moving files or even renaming files.
Return ERROR_ok to allow the action, or ERROR_permissions to reject it.
- Param serverID:
the server for which the callback was called
- Param client:
describes the client attempting to rename or move the file.
- Param params:
describes the file to be renamed or moved, and where the file should be moved to if it’s being moved.
- Return:
ERROR_ok to allow, ERROR_permissions to deny
-
unsigned int (*permFileTransferInitUpload)(uint64 serverID, const struct ClientMiniExport *client, const struct ts3sc_ftinitupload *params)