Forum

Results 1 to 7 of 7
  1. #1
    Join Date
    October 2015
    Location
    Germany, Bavaria
    Posts
    144

    Question Dynamin Name Comparison Algorithm

    (Sorry, I accedently deleted the last thread because my browser was making problems...)

    Does anyone know which algorithm TS utilizes when getting the clientinfo from an incomplete clientname?
    Or does anyone know any good algorithm?
    I've come over the Levenshetin Algorithm... But that just finds the nearest, and not the nearest within a specific margin...
    The Algorithm used in SQ would be really useful I guess...
    Last edited by Jhhhj_original; June 16th, 2017 at 03:26 PM. Reason: Corrected the Thread Name

  2. #2
    Join Date
    September 2012
    Posts
    6,079
    Where does TeamSpeak use partial user names that are automatically guessed to the nearest existing user?
    When sending PMs please make sure to include a reference link to the thread in question in the body of your message.

  3. #3
    Join Date
    October 2015
    Location
    Germany, Bavaria
    Posts
    144
    In ServerQuery...

    TeamSpeak ServerQuery Manual page 25: clientfind

    If you have a user "abcde" then you can use the clientfind with only "abc" and it still finds the client

    But also, if you look for "xyz" is will give you no user, since its too far off
    Last edited by Chris; June 16th, 2017 at 05:14 PM.

  4. #4
    Join Date
    September 2012
    Posts
    6,079
    clientfind just looks if the searched string is present in the clientname.
    When sending PMs please make sure to include a reference link to the thread in question in the body of your message.

  5. #5
    Join Date
    October 2015
    Location
    Germany, Bavaria
    Posts
    144
    Ooh ok thanks

  6. #6
    Join Date
    October 2015
    Location
    Germany, Bavaria
    Posts
    144
    Well, I suppose that function should be working...

    Code:
    anyID getClientIDByName(String^ name) {
    	anyID* clList;
    	int res = ts3Functions.getClientList(schid, &clList);
    	if (res == ERROR_ok) {
    
    		for (int i = 0; clList[i]; i++) {
    			char* clName;
    			res = ts3Functions.getClientVariableAsString(schid, clList[i], CLIENT_NICKNAME, &clName);
    			if (res == ERROR_ok) {
    				String^ cl_name = marshal_as<String^>(clName);
    				if (cl_name->ToLower()->Contains(name->ToLower())) {
    					anyID clid = clList[i];
    					ts3Functions.freeMemory(clList);
    					ts3Functions.freeMemory(clName);
    					return clid;
    				}
    			}
    			ts3Functions.freeMemory(clName);
    		}
    	}
    	ts3Functions.freeMemory(clList);
    }
    Allthough it should be quite... Expensive.

  7. #7
    Join Date
    September 2012
    Posts
    6,079
    Except that you'll want to only free the list if the call actually succeeded, as otherwise you'd attempt to free something that wasn't allocated.

    It sure is somewhat expensive, but whether or not that becomes an issue depends on how often you intend to use that function. If you need it more often you could add some cache, keeping that up to date with events you're sent anyway and only do the whole get every client and check their names dance if you can't find a result in the cache.
    When sending PMs please make sure to include a reference link to the thread in question in the body of your message.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Do I have to keep the short identity string secret?
    By KieranMeow in forum Client Support
    Replies: 3
    Last Post: March 18th, 2017, 02:45 PM
  2. Error - Failed to convert string nan to float
    By cmpik in forum Client Support
    Replies: 113
    Last Post: September 18th, 2015, 05:18 PM
  3. [Fixed] onTextMessageEvent : can't handle multibyte string
    By haru_arc in forum Bug Reports [EN/DE]
    Replies: 9
    Last Post: September 8th, 2010, 11:08 PM
  4. Password Hash Algorithm
    By HerHde in forum Server Support
    Replies: 0
    Last Post: September 3rd, 2010, 10:39 PM

Tags for this Thread

Posting Permissions

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