Forum

Results 1 to 2 of 2
  1. #1
    Join Date
    February 2013
    Posts
    4

    How do I get UNICODE characters with ts3Functions.getClientDisplayName(...)

    Hello,

    I need to process the player names which may have or some other characters in it.
    How do I do that? getClientDisplayName only accepts a pointer to CHAR.
    My IDE is Microsoft Visual Studio 2010 and I use the built in C++ Compiler.

    thanks

  2. #2
    Join Date
    September 2012
    Posts
    6,080
    It works just fine:

    Code:
    int ts3plugin_processCommand(uint64 scHandlerID, const char* command) {
    	char buf[COMMAND_BUFSIZE];
    	_strcpy(buf, COMMAND_BUFSIZE, command);
    
    	uint64 channelID;
    	anyID myId;
    	ts3.getClientID(scHandlerID, &myId);
    	ts3.getChannelOfClient(scHandlerID, myId, &channelID);
    	if (!strcmp(buf, "names")) {
    		anyID *clList;
    		if (ts3.getChannelClientList(scHandlerID, channelID, &clList) == ERROR_ok) {
    			for (int i = 0; clList[i]; ++i) {
    				char *name = new char[TS3_MAX_SIZE_CLIENT_NICKNAME_NONSDK];
    				if (ts3.getClientDisplayName(scHandlerID, clList[i], name, TS3_MAX_SIZE_CLIENT_NICKNAME_NONSDK) == ERROR_ok) {
    					char *msg = new char[1024];
    					snprintf(msg, 1024, "Client %d has Display Name of %s\n", clList[i], name);
    					ts3.printMessageToCurrentTab(msg);
    					ts3.requestSendPrivateTextMsg(scHandlerID, msg, myId, NULL);
    					delete msg;
    				}
    				delete name;
    			}
    		}
    	}
    	return PLG_OK;
    }
    gives:
    Code:
    <10:02:01> "Ⓒⓗⓡⓘⓢ": Client 3 has Display Name of Ⓒⓗⓡⓘⓢ
    <10:02:43> "Ⓒⓗⓡⓘⓢ with ": Client 3 has Display Name of Ⓒⓗⓡⓘⓢ with 

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 8
    Last Post: June 26th, 2018, 08:56 AM
  2. Problem with ts3Functions.getClientID()
    By Dione in forum Client Plugins / Lua Scripts
    Replies: 2
    Last Post: August 30th, 2014, 11:40 AM
  3. Unicode workaround?
    By willy_sunny in forum Client Plugins / Lua Scripts
    Replies: 17
    Last Post: October 14th, 2010, 08:12 AM
  4. ts3Functions.createIdentity - where the heck is it?
    By sea212 in forum Client Plugins / Lua Scripts
    Replies: 7
    Last Post: March 1st, 2010, 07:14 PM
  5. [Solved] ts3Functions.requestClientMove
    By tomix in forum Client Plugins / Lua Scripts
    Replies: 2
    Last Post: February 22nd, 2010, 10:31 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •