How can I send a text message to a client when i only have the UID?

Lustig123

Member
Mar 7, 2016
3
0
48
I want to make a plugin to send a private textmessage to an other client, but how can I send a text message to a client when i only have the UID?
The function ts3Functions.requestSendPrivateTextMsg need the clientid.
 

Bluscream

Retired Staff
Contributor
May 8, 2015
967
934
211
PluginSDK said:
Code:
    unsigned int (*requestClientDBIDfromUID)(uint64 serverConnectionHandlerID, const char* clientUniqueIdentifier, const char* returnCode);
    unsigned int (*requestClientNamefromUID)(uint64 serverConnectionHandlerID, const char* clientUniqueIdentifier, const char* returnCode);

I think you have to iterate through the clientlist and check every client for a match.
 

Bluscream

Retired Staff
Contributor
May 8, 2015
967
934
211
Building: Sex (Debug)
Performing main compilation...

Precompiling headers

Compiling source to object files
g++ -MMD "/home/bluscream/Documents/Sex/Sex/plugin.c" -g -O0 -DDEBUG -DMONODEVELOP -I"/home/bluscream/Downloads/pluginsdk/include" -I"/home/bluscream/Documents/Sex/Sex/obj/Debug/prec/Debug" -c -o "/home/bluscream/Documents/Sex/Sex/bin/Debug/plugin.o"
/home/bluscream/Documents/Sex/Sex/plugin.c: In function ‘char from_hex(char)’:
/home/bluscream/Documents/Sex/Sex/plugin.c:255:19: error: ‘isdigit’ was not declared in this scope
return isdigit(ch) ? ch - '0' : tolower(ch) - 'a' + 10;
^
/home/bluscream/Documents/Sex/Sex/plugin.c:255:44: error: ‘tolower’ was not declared in this scope
return isdigit(ch) ? ch - '0' : tolower(ch) - 'a' + 10;
^
/home/bluscream/Documents/Sex/Sex/plugin.c: In function ‘char* url_encode(char*)’:
/home/bluscream/Documents/Sex/Sex/plugin.c:267:33: error: invalid conversion from ‘void*’ to ‘char*’ [-fpermissive]
char *pstr = str, *buf = malloc(strlen(str) * 3 + 1), *pbuf = buf;
^
/home/bluscream/Documents/Sex/Sex/plugin.c:269:20: error: ‘isalnum’ was not declared in this scope
if (isalnum(*pstr) || *pstr == '-' || *pstr == '_' || *pstr == '.' || *pstr == '~')
^
/home/bluscream/Documents/Sex/Sex/plugin.c:299:160: error: ‘getClientIdByUniqueId’ was not declared in this scope
ts3Functions.requestSendPrivateTextMsg(serverConnectionHandlerID, "!test", getClientIdByUniqueId(serverConnectionHandlerID, "8b5xFHACgjIvDJ1Ha88OScV7WPE="), NULL);
^
Build complete -- 7 errors, 0 warnings

---------------------- Done ----------------------

Build: 7 errors, 0 warnings
 
Top