Forum

Results 1 to 8 of 8
  1. #1
    Join Date
    December 2006
    Location
    Germany
    Posts
    13

    ts3Functions.createIdentity - where the heck is it?

    Hey folks,

    i just was about to finish my plugin when i suddenly saw that i cannot create an identity, which i need to use ts3Functions.startConnection. The commands ts3Functions.createIdentity doesn't exist, also i searched in all library etc. - no command to create an identity. Do you know what i should do to get the identity or is it just a bug?

    -greetz, sea212

  2. #2
    Join Date
    June 2008
    Location
    Krün, Germany
    Posts
    510
    createIdentity is not exported to plugins. We don't want that. Instead you should reuse existing identities.

    A possiblilty would be to parse the ts3clientui_qt.secrets.conf file and extract the identities (or default identity if you are not sure) from it. The file location can be queried with the getConfigPath function.
    Another option would be if the client exports a list of existing identities to the plugins. Easier for plugin authors. However, the first option is already available now.

  3. #3
    Join Date
    December 2006
    Location
    Germany
    Posts
    13
    Thanks for that info. May you should edit it in the documentation also cuz i got a little bit confused there

    -greetz, sea212

  4. #4
    Join Date
    December 2009
    Location
    France
    Posts
    11
    this C++ source code is in french but can help some people

    Code:
    char* identity;
    
    int ts3plugin_init()
    {
    	identity = NULL;
    	getIdentity();
    }
    
    void ts3plugin_shutdown()
    {
    	if (identity != NULL)
    		delete identity;
    }
    
    void getIdentity()
    {
    	char* rep;
    	std::string rep_fichier;
    
    	rep = new char[1000];
    	ts3Functions.getConfigPath(rep, 1000);
    	rep_fichier = rep;
    	delete rep;
    	rep_fichier += "ts3clientui_qt.secrets.conf";
    	
    	std::ifstream fichier( rep_fichier.c_str() );
    	if ( fichier )
    	{
    		size_t pos1, pos2;
    		std::stringstream buffer;
    
    		buffer << fichier.rdbuf();
    		fichier.close();
    
    		rep_fichier = buffer.str();
    		pos1 = rep_fichier.find("identity=");
    		if (pos1 != -1) {
    			pos2 = rep_fichier.find("\n", pos1);
    			rep_fichier = rep_fichier.substr( pos1 + 9, pos2 - pos1 - 9);
    			identity = new char[rep_fichier.size()+1];
    			strcpy(identity, rep_fichier.c_str());
    		}
    	}
    }

  5. #5
    Join Date
    January 2010
    Location
    Germany
    Posts
    36
    PHP Code:
    QSettings x(QSettings::NativeFormatQSettings::UserScope"TS3Client""ts3clientui_qt.secrets");
    QString ident x.value("Identities/identity").toString(); 
    that's it (not tested)

  6. #6
    Join Date
    December 2009
    Location
    France
    Posts
    11
    Wow I love Qt !
    But I can't make it work with the plugin (I used your config dialog source code to try it). Qt seams to work only if I create a makefile project. I don't understand how you can do without doing this (no "qmake -project & qmake & nmake" ???)
    I have this error when I try to compile your code:
    Code:
    config.obj : error LNK2001: symbole externe non résolu "public: virtual int __thiscall Config::qt_metacall(enum QMetaObject::Call,int,void * *)" ([email protected]@@[email protected]@@[email protected])
    config.obj : error LNK2001: symbole externe non résolu "public: virtual void * __thiscall Config::qt_metacast(char const *)" ([email protected]@@[email protected])
    config.obj : error LNK2001: symbole externe non résolu "public: virtual struct QMetaObject const * __thiscall Config::metaObject(void)const " ([email protected]@@[email protected]@XZ)
    My environment variables are:
    QTDIR: C:\Qt\4.6.1 (my qt install directory)
    QMAKESPEC: win32-msvc2008
    PATH: .....;%QTDIR%\bin
    Last edited by Le_CuLtO; March 1st, 2010 at 12:53 PM.

  7. #7
    Join Date
    January 2010
    Location
    Germany
    Posts
    36
    Quote Originally Posted by Le_CuLtO View Post
    Wow I love Qt !
    But I can't make it work with the plugin (I used your config dialog source code to try it). Qt seams to work only if I create a makefile project. I don't understand how you can do without doing this (no "qmake -project & qmake & nmake" ???)
    I have this error when I try to compile your code:
    Code:
    config.obj : error LNK2001: symbole externe non résolu "public: virtual int __thiscall Config::qt_metacall(enum QMetaObject::Call,int,void * *)" ([email protected]@@[email protected]@@[email protected])
    config.obj : error LNK2001: symbole externe non résolu "public: virtual void * __thiscall Config::qt_metacast(char const *)" ([email protected]@@[email protected])
    config.obj : error LNK2001: symbole externe non résolu "public: virtual struct QMetaObject const * __thiscall Config::metaObject(void)const " ([email protected]@@[email protected]@XZ)
    My environment variables are:
    QTDIR: C:\Qt\4.6.1 (my qt install directory)
    QMAKESPEC: win32-msvc2008
    PATH: .....;%QTDIR%\bin
    include the generated moc file from dialog to your project

  8. #8
    Join Date
    December 2009
    Location
    France
    Posts
    11
    It works ! thanks !

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Plugin SDK documentation, how to createIdentity
    By romillet in forum General Questions
    Replies: 2
    Last Post: July 9th, 2014, 06:44 PM
  2. [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
  •